-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
27 lines (26 loc) · 942 Bytes
/
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
cmake_minimum_required(VERSION 3.9)
# Get project name from folder name
get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(REPLACE " " "_" ProjectId ${ProjectId})
project(${ProjectId})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
# all .cpp files
set(SOURCES src/main.cpp src/alpha_safe_paths.cpp src/optimal_paths.cpp src/safety_windows.cpp src/draw_subgraph.cpp)
add_executable(${ProjectId} ${SOURCES})
# compiler flags for debugging
if (APPLE)
set(CMAKE_CXX_FLAGS "-O3 -openmp")
else()
set(CMAKE_CXX_FLAGS "-O3 -fopenmp")
endif()
# GMP
find_package(GMP REQUIRED)
# if .h files are in other folder?
include_directories(./ ${GMP_INCLUDE_DIR})
target_link_libraries(${ProjectId} ${GMP_LIBRARY})
# OpenMP
#find_package(OpenMP REQUIRED)
#target_link_libraries(${ProjectId} OpenMP::OpenMP_CXX)
# runnable output file
set_target_properties(${ProjectId} PROPERTIES OUTPUT_NAME "emerald")