generated from LesleyLai/cmake-cpp-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (45 loc) · 1.87 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
cmake_minimum_required(VERSION 3.15)
project(beyond_core VERSION 0.0.2 LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_BINARY_DIR}")
include("cmake/StandardProjectSettings.cmake")
include("CMakeDependentOption")
option(BEYOND_CORE_BUILD_TESTS "Builds the tests" OFF)
CMAKE_DEPENDENT_OPTION(BEYOND_CORE_BUILD_TESTS_COVERAGE
"Build the project with code coverage support for tests" OFF
"BEYOND_CORE_BUILD_TESTS" OFF)
option(BEYOND_CORE_BUILD_DOCUMENTATION
"Build the documentation for the Beyond game engine core" OFF)
option(BEYOND_CORE_ENABLE_TIME_TRACE "Enable compilation time profiling with -ftime-trace" OFF)
option(BEYOND_CORE_USE_CMAKE_CONAN "Use cmake-conan to get dependencies" OFF)
if (BEYOND_CORE_USE_CMAKE_CONAN)
set(CONAN_SYSTEM_INCLUDES ON)
if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif ()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_check(VERSION 1.0.0 REQUIRED)
conan_cmake_run(CONANFILE conanfile.py # or relative build/conanfile.txt
BASIC_SETUP
GENERATORS CMakeDeps
BUILD missing)
endif ()
if (BEYOND_CORE_BUILD_DOCUMENTATION)
include("cmake/doxygen.cmake")
endif ()
include("cmake/compiler.cmake")
add_subdirectory(third-party)
add_subdirectory(src)
if (BEYOND_CORE_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif ()
install(TARGETS core
EXPORT beyond-core
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/beyond" DESTINATION include)