forked from vdksoft/signals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
36 lines (27 loc) · 958 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
33
34
35
36
cmake_minimum_required(VERSION 3.8)
project(signals CXX)
enable_testing()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include_directories(include)
file(GLOB SOURCES src/*.cc)
add_library(signals "")
target_sources(signals PRIVATE ${CMAKE_SOURCE_DIR}/include/signals.h
${CMAKE_SOURCE_DIR}/src/signals.cpp)
target_include_directories(signals PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_compile_options(signals PUBLIC
$<$<CXX_COMPILER_ID:GNU>:-Wall>
$<$<CXX_COMPILER_ID:Clang>:-Wall>
$<$<CXX_COMPILER_ID:AppleClang>:-Wall>
$<$<CXX_COMPILER_ID:MSVC>:/W4>)
find_package (Threads)
target_link_libraries (signals PUBLIC ${CMAKE_THREAD_LIBS_INIT})
option(SIGNALS__ENABLE_TESTS "Enable tests" OFF)
option(SIGNALS__ENABLE_DEMO "Enable demo" OFF)
if(SIGNALS__ENABLE_TESTS)
add_subdirectory(tests)
endif()
if(SIGNALS__ENABLE_DEMO)
add_subdirectory(demo)
endif()