-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
35 lines (24 loc) · 751 Bytes
/
CMakeLists.txt
File metadata and controls
35 lines (24 loc) · 751 Bytes
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
project(Analysis CXX)
cmake_minimum_required(VERSION 2.8.0)
## source file name
set(sourcefile $ENV{BaseFileName})
## install path
set(CMAKE_INSTALL_PREFIX $ENV{CODE_INSTALL_PATH})
## flags
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -lstdc++fs -O3")
## options
option(USE_DEBUG "Debug this code." OFF)
option(USE_THREAD "Use thread library." ON)
option(USE_OMP "Use OpenMP." ON)
if (USE_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-2")
endif()
if (USE_THREAD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()
if (USE_OMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
endif()
include_directories(${PROJECT_SOURCE_DIR}/include)
add_subdirectory($ENV{DirName})