-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
77 lines (61 loc) · 2.08 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
project(replay)
cmake_minimum_required(VERSION 3.0)
if(NOT DEFINED Replay_USE_CONAN)
option(Replay_USE_CONAN "Use conan to build replay" ON)
endif()
if(NOT DEFINED Replay_USE_STBIMAGE)
option(Replay_USE_STBIMAGE "Use stb_image.c to load image files" ON)
endif()
if(NOT DEFINED Replay_USE_STBIMAGE_FROM_CONAN)
set(Replay_USE_STBIMAGE_FROM_CONAN_DEFAULT OFF)
if (${Replay_USE_CONAN} AND ${Replay_USE_STBIMAGE})
set(Replay_USE_STBIMAGE_FROM_CONAN_DEFAULT ON)
endif()
option(Replay_USE_STBIMAGE_FROM_CONAN "Use stb_image from conan" ${Replay_USE_STBIMAGE_FROM_CONAN_DEFAULT})
endif()
if(NOT DEFINED Replay_USE_LIBPNG)
option(Replay_USE_LIBPNG "Use libpng to load png files" ON)
endif()
if(NOT DEFINED Replay_ENABLE_UNIT_TESTS)
option(Replay_ENABLE_UNIT_TESTS "Build the unit tests" ON)
endif()
if(NOT DEFINED Replay_ENABLE_INSTALL)
option(Replay_ENABLE_INSTALL "Create the install target" ON)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${replay_BINARY_DIR}/build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${replay_BINARY_DIR}/build)
if(Replay_USE_CONAN)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
set(Replay_BOOST_TARGETS CONAN_PKG::boost)
else()
# Replay is typically included in a host project that already has boost
if(NOT Boost_FOUND AND NOT DEFINED Replay_BOOST_TARGETS)
if(WIN32)
find_package(Boost REQUIRED)
else()
set(Boost_USE_MULTITHREADED OFF)
if(Replay_ENABLE_UNIT_TESTS)
find_package(Boost 1.42 REQUIRED COMPONENTS unit_test_framework)
else()
find_package(Boost 1.42)
endif()
endif()
endif()
if(Replay_USE_LIBPNG)
find_package(PNG REQUIRED)
endif()
if(Replay_USE_STBIMAGE AND NOT DEFINED Replay_STBIMAGE_PATH AND NOT Replay_USE_STBIMAGE_FROM_CONAN)
find_path(Replay_STBIMAGE_PATH stb_image.h)
endif()
endif()
add_subdirectory(source)
if(Replay_ENABLE_UNIT_TESTS)
add_subdirectory(test)
endif()
if (CMAKE_VERSION VERSION_GREATER 3.7.8)
target_sources(replay INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/replay.natvis
)
endif()