-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·68 lines (55 loc) · 2.39 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
cmake_minimum_required(VERSION 3.10.2)
project(skyline)
#Set up different build modes with custom compiler flags
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS ON )
set( GCC_Flags_For_CXX "-Wall -fPIC -pthread" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_Flags_For_CXX}" )
set( CMAKE_CXX_FLAGS_DEBUG "-ggdb") #-D_GLIBCXX_DEBUG" )
#Required packages
#link_directories( /usr/local/lib )
find_package( OpenGL REQUIRED )
include_directories( ${OPENGL_INCLUDE_DIR} )
find_package( OpenCL REQUIRED )
include_directories( ${OPENCL_INCLUDE_DIR} )
find_package( glfw3 3.2 REQUIRED )
include_directories( ${GLFW3_INCLUDE_DIR} )
#YAML parser library for configuration
find_package( yaml-cpp REQUIRED )
#Support for glad
add_library(glad SHARED glad/src/glad.c)
target_include_directories("glad" PRIVATE "glad/include")
target_link_libraries("glad" ${CMAKE_DL_LIBS})
install(TARGETS glad DESTINATION lib)
file(GLOB GLAD_HEADERS ${PROJECT_SOURCE_DIR}/glad/include/*/*.h)
install(FILES ${GLAD_HEADERS} DESTINATION include)
#All components in this project can refer to other components by
#relative path from the root source code directory.
include_directories( ${CMAKE_SOURCE_DIR} )
#Let source code know where this project is installed. Needed for finding shader sources.
add_definitions(-DINSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
#Include build system for the rest of this project. Add new top-level directories here.
add_subdirectory(gl)
add_subdirectory(algebra)
add_subdirectory(camera)
add_subdirectory(engine)
add_subdirectory(serial)
add_subdirectory(imgui)
add_subdirectory(stb_image)
add_subdirectory(app)
add_subdirectory(kernels)
add_subdirectory(examples)
#install setup script
configure_file(setup.sh.in setup.sh)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh DESTINATION bin)
#Make the results of this build into a distributable package. Designed to be distributed as a .tar.gz
#Learned to do this from http://agateau.com/2009/cmake-and-make-dist/
set( CPACK_PACKAGE_VERSION_MAJOR "0" )
set( CPACK_PACKAGE_VERSION_MINOR "0" )
set( CPACK_PACKAGE_VERSION_PATCH "0" )
set( CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}" )
set( CPACK_SOURCE_GENERATOR "TGZ" )
#set( CPACK_SOURCE_IGNORE_FILES
include( CPack )
add_custom_target( dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source )