-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
59 lines (45 loc) · 2.25 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
cmake_minimum_required(VERSION 2.6)
project(PPS_TB_RC)
set(CAEN_LOCATION "/usr/lib")
set(GCC_COMPILE_FLAGS "-Wall -fPIC -O2 -g -lsqlite3")
set(GCC_LINK_FLAGS "-lsqlite3")
add_definitions(${GCC_COMPILE_FLAGS})
file(GLOB vme_sources ${PROJECT_SOURCE_DIR}/src/VME*.cpp)
file(GLOB nim_sources ${PROJECT_SOURCE_DIR}/src/NIM*.cpp)
add_library(det_lib OBJECT ${vme_sources} ${nim_sources})
# File reader
file(GLOB reader_sources ${PROJECT_SOURCE_DIR}/src/FileReader.cpp)
add_library(reader_lib OBJECT ${reader_sources})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cpp)
list(REMOVE_ITEM sources ${vme_sources})
list(REMOVE_ITEM sources ${nim_sources})
list(REMOVE_ITEM sources ${reader_sources})
add_library(src_lib OBJECT ${sources})
set_property(TARGET src_lib PROPERTY LINK_FLAGS "-lsqlite3")
include_directories("${PROJECT_SOURCE_DIR}/include")
add_executable(ppsRun main.cpp $<TARGET_OBJECTS:src_lib>)
set_property(TARGET ppsRun PROPERTY LINK_FLAGS "-lsqlite3")
add_executable(listener listener.cpp $<TARGET_OBJECTS:src_lib>)
set_property(TARGET listener PROPERTY LINK_FLAGS "-lsqlite3")
# Here have tests
add_subdirectory(test EXCLUDE_FROM_ALL)
# Here have DQM clients
add_subdirectory(dqm EXCLUDE_FROM_ALL)
# CAEN stuff
add_library(caen SHARED IMPORTED)
set_property(TARGET caen PROPERTY IMPORTED_LOCATION "${CAEN_LOCATION}/libCAENVME.so")
# Copy the XML configuration files to the config/ folder
file(GLOB config_files RELATIVE ${PROJECT_SOURCE_DIR} config/*.xml)
foreach(_script ${config_files})
configure_file(${_script} ${PROJECT_BINARY_DIR}/${_script} COPYONLY)
endforeach()
set(CMAKE_CXX_FLAGS "-DLINUX")
add_executable(ppsFetch fetch_vme.cpp $<TARGET_OBJECTS:src_lib> $<TARGET_OBJECTS:det_lib>)
target_link_libraries(ppsFetch caen)
set_property(TARGET ppsFetch PROPERTY LINK_FLAGS "-lCAENVME -ltinyxml2 -lsqlite3")
add_executable(HVsettings change_hv_settings.cpp $<TARGET_OBJECTS:src_lib> $<TARGET_OBJECTS:det_lib>)
target_link_libraries(HVsettings caen)
set_property(TARGET HVsettings PROPERTY LINK_FLAGS "-lCAENVME -ltinyxml2 -lsqlite3")
add_executable(NINOsettings change_nino_threshold_voltage.cpp $<TARGET_OBJECTS:src_lib> $<TARGET_OBJECTS:det_lib>)
target_link_libraries(NINOsettings caen)
set_property(TARGET NINOsettings PROPERTY LINK_FLAGS "-lCAENVME -ltinyxml2 -lsqlite3")