-
Notifications
You must be signed in to change notification settings - Fork 21
/
CMakeLists.txt
28 lines (23 loc) · 1.03 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
cmake_minimum_required(VERSION 2.8.4)
project(cplex_example)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DIL_STD -m64 -Wall -Werror")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -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)
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -save-temps=obj")
endif()
find_package(Cplex)
include_directories(SYSTEM ${CPLEX_INCLUDE_DIRS})
set(SOURCE_FILES
src/graph.h
src/graph.cpp
src/solver.h
src/solver.cpp
src/main.cpp)
add_executable( cplex_example ${SOURCE_FILES})
target_link_libraries( cplex_example PRIVATE ${CPLEX_LIBRARIES})
target_link_libraries( cplex_example PRIVATE dl)