-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
69 lines (59 loc) · 2.26 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
cmake_minimum_required(VERSION 3.11)
set (CMAKE_CXX_STANDARD 14)
project(SunRay)
include(ExternalProject)
# Set install directory
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/dist CACHE PATH ${CMAKE_SOURCE_DIR}/dist FORCE)
if(WIN32)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Debug;Release" FORCE)
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
find_package(OpenGL REQUIRED COMPONENTS OpenGL)
find_package(Doxygen)
if(DOXYGEN_FOUND)
set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/docs/doxygen)
set(DOXYGEN_EXCLUDE_PATTERNS */thirdparty/*)
set(DOXYGEN_GENERATE_XML YES)
set(DOXYGEN_INHERIT_DOCS NO)
set(DOXYGEN_COLLABORATION_GRAPH YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_CLASS_DIAGRAMS YES)
set(DOXYGEN_HIDE_UNDOC_RELATIONS NO)
set(DOXYGEN_HAVE_DOT YES)
set(DOXYGEN_CLASS_GRAPH YES)
set(DOXYGEN_CALL_GRAPH YES)
set(DOXYGEN_CALLER_GRAPH YES)
set(DOXYGEN_COLLABORATION_GRAPH YES)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_EXTRACT_PRIVATE YES)
set(DOXYGEN_EXTRACT_PACKAGE YES)
set(DOXYGEN_EXTRACT_STATIC YES)
set(DOXYGEN_EXTRACT_LOCALMETHODS YES)
set(DOXYGEN_UML_LOOK YES)
set(DOXYGEN_UML_LIMIT_NUM_FIELDS 50)
set(DOXYGEN_TEMPLATE_RELATIONS YES)
set(DOXYGEN_DOT_GRAPH_MAX_NODES 100)
set(DOXYGEN_MAX_DOT_GRAPH_DEPTH 0)
set(DOXYGEN_DOT_TRANSPARENT YES)
doxygen_add_docs(doxygen src)
else()
message( "Doxygen need to be installed to generate the doxygen documentation" )
endif()
include(BuildGLEW)
include(BuildGLFW)
include(BuildGLM)
include(BuildSTB)
include(BuildOpenISS)
set(EXEC SunRay)
file(GLOB_RECURSE SRC src/*.cpp)
add_executable(${EXEC} ${SRC})
target_link_libraries(${EXEC} OpenGL::GL glew_s glfw glm openiss-static stb)
list(APPEND BIN ${EXEC})
add_custom_command(TARGET SunRay POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/assets $<TARGET_FILE_DIR:SunRay>/assets
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/src/shaders $<TARGET_FILE_DIR:SunRay>/shaders
)
# install files to install location
install(TARGETS ${BIN} DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY assets DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY src/shaders DESTINATION ${CMAKE_INSTALL_PREFIX})