blob: 36ea9102801adf22a72638034aa97707ae398434 (
plain)
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
|
cmake_minimum_required(VERSION 3.5)
project(OnlineDetectorSimulator)
#define some speciel output paths for libraries and executables
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
#use c++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(Boost_USE_MULTITHREADED ON)
SET(BOOST_MIN_VERSION "1.58.0")
add_definitions(-DBOOST_LOG_DYN_LINK=1)
#find required packages
find_package(LibConfig REQUIRED)
find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS log filesystem)
find_package(OpenMP)
#add openmp
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
include_directories(
${LIBCONFIGPP_INCLUDE_DIR}
${BOOST_INCLUDE_DIRS}
)
file(GLOB SOURCES
"*.cpp"
)
|