-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
56 lines (38 loc) · 2 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
cmake_minimum_required(VERSION 3.12)
project(cogs VERSION 1.0.0)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../daq-buildtools/cmake ${CMAKE_MODULE_PATH})
include(DAQ)
daq_setup_environment()
find_package(ers REQUIRED)
find_package(nlohmann_json REQUIRED )
# Can delete this include_directories line when "./inc" gets renamed "./include"
include_directories( ./inc )
##############################################################################
daq_point_build_to( src )
add_library(cogs src/stream.cpp)
target_link_libraries(cogs ers::ers nlohmann_json::nlohmann_json)
target_include_directories(cogs PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> )
##############################################################################
daq_point_build_to( demo )
add_executable(cogs-demo demo/cogs-demo.cpp demo/comp.cpp demo/factory.cpp demo/node.cpp)
target_link_libraries(cogs-demo cogs)
install(FILES demo/generate.sh demo/clean.sh
DESTINATION ./demo
PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
install(FILES demo/comp-schema.jsonnet demo/demo-config.jsonnet demo/node-schema.jsonnet demo/demo-codegen.jsonnet demo/head-schema.jsonnet
DESTINATION ./demo
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
##############################################################################
daq_point_build_to( test )
function( cogs_add_test testlabel )
add_executable(test_${testlabel} test/test_${testlabel}.cpp)
target_link_libraries(test_${testlabel} cogs)
endfunction()
cogs_add_test(stream)
cogs_add_test(nljs_sub)
cogs_add_test(logging)
cogs_add_test(exceptions)
##############################################################################
daq_install( TARGETS cogs-demo cogs )
# Can delete this include_directories line when "./inc" gets renamed "./include"
install(DIRECTORY inc/${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h??")