-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
67 lines (55 loc) · 1.12 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
cmake_minimum_required(VERSION 3.11)
project(fsm
VERSION 0.2.0
DESCRIPTION "Finite State Machine library"
HOMEPAGE_URL "https://github.com/EVerest/libfsm"
LANGUAGES CXX
)
find_package(everest-cmake 0.1 REQUIRED
PATHS ../everest-cmake
)
#
# options
#
option(BUILD_EXAMPLES "enable building of examples" OFF)
option(FSM_INSTALL "Install the library (shared data might be installed anyway)" ${EVC_MAIN_PROJECT})
#
# library declaration
#
add_library(fsm INTERFACE)
add_library(fsm::fsm ALIAS fsm)
target_include_directories(fsm INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
#
# examples
#
if (BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
#
# tests
#
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
include(CTest)
add_subdirectory(tests)
endif()
#
# installation definition
#
if (FSM_INSTALL)
install(
TARGETS fsm
EXPORT fsm-targets
)
install(
DIRECTORY include/
TYPE INCLUDE
)
evc_setup_package(
NAME fsm
EXPORT fsm-targets
NAMESPACE fsm
)
endif()