cmake_minimum_required (VERSION 2.6) project (DataQueue) set(CMAKE_SKIP_RPATH ON) if (DEBUG_FRAME_LENGHT) message("DEBUG_FRAME_LENGHT enabled") add_definitions(-DDEBUG_FRAME_LENGHT) else(DEBUG_FRAME_LENGHT) message("DEBUG_FRAME_LENGHT disabled") endif(DEBUG_FRAME_LENGHT) if (VERSION) add_definitions(-DVERSION="${VERSION}") add_definitions(-DGIT_REVISION="${VERSION}") elseif(GIT_REVISION) add_definitions(-DVERSION="${GIT_REVISION}") add_definitions(-DGIT_REVISION="${GIT_REVISION}") else(VERSION) add_definitions(-DVERSION="UNKNOWN") endif(VERSION) execute_process(COMMAND "date" "+%y%m%d" OUTPUT_VARIABLE BUILD_DATE) string(STRIP ${BUILD_DATE} BUILD_DATE) add_definitions(-DBUILD_DATE="${BUILD_DATE}") if (BENCH_TIME) message("BENCH_TIME enabled") add_definitions(-DBENCH_TIME) else(BENCH_TIME) message("BENCH_TIME disabled") endif(BENCH_TIME) if (DEBUG_CLB_INTERFACE) message("DEBUG_CLB_INTERFACE enabled") add_definitions(-DDEBUG_CLB_INTERFACE) else(DEBUG_CLB_INTERFACE) message("DEBUG_CLB_INTERFACE disabled") endif(DEBUG_CLB_INTERFACE) if (DEBUG_DAQ_HEADER) message("DEBUG_DAQ_HEADER enabled") add_definitions(-DDEBUG_DAQ_HEADER) else(DEBUG_DAQ_HEADER) message("DEBUG_DAQ_HEADER disabled") endif(DEBUG_DAQ_HEADER) set(BOOST_ROOT "$ENV{BOOST_ROOT}") if (NOT DEFINED JPP_ROOT) set(JPP_ROOT "$ENV{JPP_ROOT}") endif (NOT DEFINED JPP_ROOT) if (NOT DEFINED CHSM_ROOT) set(CHSM_ROOT "$ENV{CHSM_ROOT}") endif (NOT DEFINED CHSM_ROOT) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/") find_package(Boost 1.53 REQUIRED COMPONENTS atomic system thread program_options chrono regex) find_package(CHSM) find_package(JPP) find_package(Curses) # Compiler flags set(GCC_COMPILE_FLAGS "-pthread -Wall -Wno-long-long -Wno-vla -Wno-unused-local-typedefs -std=c++11 -O2") # Linker flags set(GCC_LINK_FLAGS "-pthread") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COMPILE_FLAGS} ${GCC_LINK_FLAGS}") # Global include dirs include_directories("${PROJECT_SOURCE_DIR}") include_directories("${Boost_INCLUDE_DIRS}") # Install prefix set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/arch") # Add simulation programs add_subdirectory (simu) # Add utilities add_subdirectory (util) # Add DQ dependencies add_subdirectory(DFInterface) add_subdirectory(FrameFactory) add_subdirectory(Buffers) add_executable(DataQueueSA saDataQueue.cc log.cc) target_link_libraries(DataQueueSA FrameFarm timer puzzled_frame recipients dfinterface clbdatagram ${Boost_LIBRARIES} ) # Install DataQueue install(TARGETS DataQueueSA DESTINATION bin) # Add the final executable if (JPP_FOUND AND CHSM_FOUND) add_definitions(-DCHSM_MULTITHREADED) # CHSM include dirs include_directories("${CHSM_INCLUDE_DIRS}") include_directories("${JPP_INCLUDE_DIR}") add_executable(DataQueue DataQueue.cc jlog.cc) target_link_libraries(DataQueue ${JPP_LIBRARIES} ${CHSM_LIBRARIES} FrameFarm timer puzzled_frame recipients dfinterface clbdatagram ${Boost_LIBRARIES} ) install(TARGETS DataQueue DESTINATION bin) add_custom_target(default DEPENDS DataQueue) else(JPP_FOUND AND CHSM_FOUND) if (JPP_MANDATORY) message(FATAL_ERROR "CHSM and/or JPP not found. Without them you cannot build the final release version of the DataQueue, but you can build all other components, included the standalone DataQueue (DataQueueSA).") else (JPP_MANDATORY) message(WARNING "CHSM and/or JPP not found. Without them you cannot build the final release version of the DataQueue, but you can build all other components, included the standalone DataQueue (DataQueueSA).") endif(JPP_MANDATORY) endif(JPP_FOUND AND CHSM_FOUND)