-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
41 lines (38 loc) · 1.7 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 2.6)
project(Ray)
set(ROOT "${CMAKE_CURRENT_LIST_DIR}")
include_directories(${PROJECT_SOURCE_DIR}/include)
set(SRC_DIR "src/")
file(GLOB SRCFILES "${SRC_DIR}/*.cpp")
file(GLOB IMGUI_SRC "${ROOT}/imgui/*.cpp")
file(GLOB IMGUI_BACKENDS__SRC "${ROOT}/imgui/backends/*.cpp")
file(GLOB GLAD_SRC "${ROOT}/glad/src/*.c")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
find_package(OpenGL REQUIRED)
file(GLOB H_FILES ${PROJECT_SOURCE_DIR}/include/*.h)
source_group("Headers" FILES ${H_FILES})
source_group("MySource" ${SRCFILES})
source_group("Shader" ${ROOT}/shader/*)
add_executable(${PROJECT_NAME} ${SRCFILES} ${IMGUI_SRC} ${IMGUI_BACKENDS__SRC} ${ASSIMP_SRC} ${GLAD_SRC} ${H_FILES})
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${ROOT}/imgui/)
include_directories(${ROOT}/imgui/backends/)
include_directories(${ROOT}/eigen/)
include_directories(${ROOT}/glm/)
include_directories(${ROOT}/assimp/)
include_directories(${ROOT}/glfw/include/)
include_directories(${ROOT}/lib/)
include_directories(${ROOT}/glad/include/)
include_directories(${ROOT}/glfw/build/src/Debug/)
find_library(GLFW_LIBRARY glfw3 HINTS ${ROOT}/glfw/)
find_library(ASSIMP_LIBRARY assimp-vc140-mt HINTS ${ROOT}/lib/)
target_link_libraries(${PROJECT_NAME} ${GLFW_LIBRARY} ${OPENGL_gl_LIBRARY} ${ASSIMP_LIBRARY})