-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
110 lines (92 loc) · 2.33 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
cmake_minimum_required(VERSION 3.1)
project(temoto_action_engine)
add_compile_options(-std=c++17 -g)
# Check which compiler is required
if( "$ENV{TEMOTO_COMPILER}" STREQUAL "clang")
set(CMAKE_CXX_COMPILER "clang++-6.0")
add_compile_options(-Wthread-safety)
endif()
option(TESTS "Build tests" OFF)
find_package(Boost COMPONENTS filesystem program_options REQUIRED)
find_package(class_loader REQUIRED)
find_package(nlohmann_json REQUIRED)
set(boost_libraries)
if(${Boost_MINOR_VERSION} GREATER_EQUAL 70)
# Get the full paths to boost libraries
foreach(lib_target ${Boost_LIBRARIES})
get_target_property(lib_location ${lib_target} LOCATION)
list(APPEND boost_libraries ${lib_location})
endforeach()
else()
set(boost_libraries ${Boost_LIBRARIES})
endif()
set(headers
include
${Boost_INCLUDE_DIRS}
${class_loader_INCLUDE_DIRS}
test/actions/ta_example_1/include
)
set(libraries
${boost_libraries}
${class_loader_LIBRARIES}
)
include_directories(
${headers}
)
# Library that combines core components of the action engine
add_library(${PROJECT_NAME} SHARED
src/umrf.cpp
src/umrf_node.cpp
src/umrf_node_exec.cpp
src/umrf_graph.cpp
src/umrf_graph_exec.cpp
src/action_indexer.cpp
src/action_match_finder.cpp
src/action_engine.cpp
src/arg_parser.cpp
src/umrf_json.cpp
src/umrf_graph_fs.cpp
)
target_link_libraries(${PROJECT_NAME}
${libraries}
)
#
# TESTS
#
if (TESTS)
add_subdirectory(test)
endif()
#
# INSTALL
#
# Install the headers and the library
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION bin
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(
EXPORT ${PROJECT_NAME}Targets
FILE ${PROJECT_NAME}Targets.cmake
DESTINATION "lib/cmake/${PROJECT_NAME}"
# NAMESPACE ${PROJECT_NAME}::
)
include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "lib/cmake/${PROJECT_NAME}"
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
DESTINATION "lib/cmake/${PROJECT_NAME}"
)
install(DIRECTORY include/temoto_action_engine/
DESTINATION include/${PROJECT_NAME}
)
string(REPLACE ";" " " libraries "${libraries}")
set(TARGET_NAME ${PROJECT_NAME})
set(PKGCONFIG_LIBS
${libraries}
)