-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
84 lines (59 loc) · 1.73 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright (c) 2016 The Space Game Developers. All rights reserved.
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.
cmake_minimum_required(VERSION 3.0)
project(Space-game)
set(BUILD_DOCS OFF CACHE BOOL "Should cmake build doxygen documentation?")
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(Boost REQUIRED system thread)
find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
include_directories(${GLFW_INCLUDE_DIRS})
include_directories(${GLEW_INCLUDE_DIRS})
include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${BOOST_INCLUDE_DIR})
include_directories(src)
set(Space_SOURCES
src/log/Logger.cc
src/thread/ActiveObject.cc
src/main.cpp
src/OpenGLRenderer.cpp
)
set(Space_HEADERS
src/log/Logger.h
)
add_executable(game ${Space_SOURCES})
# make sure we get a c++14 compiler
target_compile_features(game PUBLIC
cxx_defaulted_functions
cxx_lambda_init_captures
)
# link to the libraries we need
target_link_libraries(game
${OPENGL_LIBRARIES}
${GLFW_LIBRARIES}
${GLEW_LIBRARIES}
debug ${Boost_SYSTEM_LIBRARY_DEBUG} ${Boost_THREAD_LIBRARY_DEBUG}
optimized ${Boost_SYSTEM_LIBRARY_RELEASE} ${Boost_THREAD_LIBRARY_RELEASE}
)
if(UNIX)
target_link_libraries(game
pthread
)
endif(UNIX)
# documentation building
if(${BUILD_DOCS})
message("\nBuilding documentation\n")
find_package(Doxygen REQUIRED)
set(doxyfile_in Doxyfile.in)
set(doxyfile ${CMAKE_BINARY_DIR}/Doxyfile)
configure_file(${doxyfile_in} ${doxyfile})
add_custom_target(doc
ALL
COMMAND ${DOXYGEN_EXECUTABLE}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating doxygen documentation"
DEPENDS ${Space_HEADERS} ${Space_SOURCES}
)
endif(${BUILD_DOCS})