-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (47 loc) · 2.61 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
# $Id: CMakeLists.txt 68058 2013-03-13 14:47:43Z gcosmo $
# xx
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(daqana)
#----------------------------------------------------------------------------
find_package(ROOT REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ROOT_DIR}/Modules)
message(STATUS " module path " ${CMAKE_MODULE_PATH})
message(STATUS " ROOT include dirs " ${ROOT_INCLUDE_DIR})
message(STATUS " ROOT libraries " ${ROOT_LIBRARIES})
# Johns addition to make it work for ROOT6
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
#----------------------------------------------------------------------------
# Setup ROOT include directories and compile definitions
# Setup include directory for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include ${ROOT_INCLUDE_DIRS})
#----------------------------------------------------------------------------
# Locate sources and headers for this project
# NB: headers are included so they will show up in IDEs
#
message(STATUS "source files " ${PROJECT_SOURCE_DIR})
# daqana
file(GLOB daqana_sources ${PROJECT_SOURCE_DIR}/src/daq.cc ${PROJECT_SOURCE_DIR}/src/driver.cc ${PROJECT_SOURCE_DIR}/src/event.cc ${PROJECT_SOURCE_DIR}/src/rootdriver.cc)
file(GLOB daqana_headers ${PROJECT_SOURCE_DIR}/include/daq.hh ${PROJECT_SOURCE_DIR}/include/driver.hh ${PROJECT_SOURCE_DIR}/include/event.hh ${PROJECT_SOURCE_DIR}/include/rootdriver.hh)
# slowdaq
file(GLOB slowdaq_sources ${PROJECT_SOURCE_DIR}/src/s*.cc ${PROJECT_SOURCE_DIR}/src/driver.cc)
file(GLOB slowdaq_headers ${PROJECT_SOURCE_DIR}/include/s*.hh ${PROJECT_SOURCE_DIR}/include/driver.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the ROOT libraries
#
#set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wno-shadow -std=gnu++0x -std=c++0x" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-shadow " )
#set(CMAKE_CXX_FLAGS " -Wno-shadow " )
add_executable(daqana daqana.cc ${daqana_sources} ${daqana_headers})
add_executable(slowdaq slowdaq.cc ${slowdaq_sources} ${slowdaq_headers})
message(STATUS "root libs " ${ROOT_LIBRARIES})
target_link_libraries(daqana ${ROOT_LIBRARIES} ${ROOT_LIBRARIES} -std=c++0x)
target_link_libraries(slowdaq ${ROOT_LIBRARIES} ${ROOT_LIBRARIES} -std=c++0x)
# target_link_libraries(daqana ${ROOT_LIBRARIES})
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS daqana slowdaq DESTINATION bin)
#install(TARGETS slowdaq DESTINATION bin)