-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
42 lines (31 loc) · 1.1 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
cmake_minimum_required(VERSION 3.10)
project(firefly)
set(PROJECT_VERSION 3.0.0)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
cmake_policy(SET CMP0135 NEW)
cmake_policy(SET CMP0076 NEW)
option(Firefly_ENABLE_EXAMPLES "Whether or not to enable examples" OFF)
option(Firefly_ENABLE_TESTS "Whether or not to enable tests" OFF)
include_directories(headers)
add_library(${PROJECT_NAME} INTERFACE)
if (${Firefly_ENABLE_EXAMPLES})
message(STATUS "Enabling examples build")
add_subdirectory(examples)
endif()
if (${Firefly_ENABLE_TESTS})
message(STATUS "Enabling tests")
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
FetchContent_MakeAvailable(googletest)
FetchContent_GetProperties(googletest)
include(GoogleTest)
include_directories("${googletest_SOURCE_DIR}/googlemock/include")
enable_testing()
add_subdirectory(tests)
endif()
install(DIRECTORY headers/ DESTINATION include)