-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (41 loc) · 1.24 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
cmake_minimum_required(VERSION 3.0.2)
project(bandit_with_gmock)
option(BUILD_DEPENDENCY "Whether to build the dependencies" OFF)
option(BUILD_LIBRARY "Whether to build the libraries" OFF)
option(BUILD_TEST "Whether to build the tests" OFF)
option(BUILD_EXAMPLE "Whether to build the examples" OFF)
option(BUILD_SHAERD "Whether to build the shared libraries" ON)
if(BUILD_SHAERD)
set(library_type SHARED)
else()
set(library_type STATIC)
endif()
message("Building vendor...")
try_compile(vendor_status
${PROJECT_BINARY_DIR}/vendor
${PROJECT_SOURCE_DIR}/vendor
vendor
CMAKE_FLAGS
-DBUILD_DEPENDENCY=${BUILD_DEPENDENCY}
-DBUILD_LIBRARY=${BUILD_LIBRARY}
-DBUILD_TEST=${BUILD_TEST}
-DBUILD_EXAMPLE=${BUILD_EXAMPLE}
-DBUILD_SHAERD=${BUILD_SHAERD}
OUTPUT_VARIABLE vendor_result
)
if(NOT vendor_status)
message("${vendor_result}")
return()
endif()
message("Built vendor")
include(${PROJECT_BINARY_DIR}/vendor/cmake/vendor.cmake)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "-std=gnu++11 -stdlib=libc++ -Wall -Wextra")
else()
set(CMAKE_CXX_FLAGS "-std=gnu++11 -Wall -Wextra")
endif()
enable_testing()
add_subdirectory(bandit_with_gmock)
add_subdirectory(lib)
add_subdirectory(test)
add_subdirectory(examples)