-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
32 lines (24 loc) · 926 Bytes
/
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
cmake_minimum_required(VERSION 3.15)
project(larley CXX)
add_library(larley INTERFACE)
set_property(TARGET larley PROPERTY CXX_STANDARD 23)
if(CMAKE_GENERATOR STREQUAL "Ninja")
# gcc/clang won't emit color codes if the output medium isn't a terminal
# ninja interferes with this => force colored output
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options (-fdiagnostics-color=always)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options (-fcolor-diagnostics)
endif()
endif()
target_include_directories(larley INTERFACE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>)
option(ENABLE_EXAMPLE "Enable examples" ON)
if(ENABLE_EXAMPLE)
add_subdirectory(examples)
endif()
## headers
set_target_properties(larley PROPERTIES PUBLIC_HEADER "include/larley")
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/
DESTINATION include)