-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (44 loc) · 1.86 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
cmake_minimum_required(VERSION 2.8.4)
project(mstsp)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -DIL_STD -m64 -Werror")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O3 -flto")
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build")
set(LINKER_OPTIONS -flto -Wl,--no-as-needed)
set(CPLEX_ROOT_DIR "/opt/ibm/ILOG/CPLEX_Studio201")
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -save-temps=obj")
endif()
link_libraries(stdc++fs)
find_package(Cplex)
find_package(X11)
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
include_directories(SYSTEM ${CPLEX_INCLUDE_DIRS})
include_directories(PUBLIC include)
set(SOURCE_FILES
src/target.h
src/target_shift.h
src/solution.h
src/solver_grasp.cpp
src/solver_grasp.h
src/solver_ilp.cpp
src/solver_ilp.h
src/insertion.h
src/main.cpp
src/uav_agent.h
src/mstsp.cpp
src/mstsp.h)
add_executable( mstsp ${SOURCE_FILES})
target_link_libraries( mstsp PRIVATE ${CPLEX_LIBRARIES})
target_link_libraries( mstsp PRIVATE dl)
target_link_libraries( mstsp PRIVATE config++)
target_link_libraries( mstsp PRIVATE stdc++fs)
target_link_libraries ( mstsp PRIVATE Eigen3::Eigen)
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/config.cfg $<TARGET_FILE_DIR:${PROJECT_NAME}>)
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/config_grasp.cfg $<TARGET_FILE_DIR:${PROJECT_NAME}>)