-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (38 loc) · 1.8 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
cmake_minimum_required(VERSION 3.17)
project(Bus)
set(CMAKE_CXX_STANDARD 14)
find_package(OpenMP)
if (OPENMP_FOUND)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${OpenMP_EXE_LINKER_FLAGS}")
endif ()
if (WIN32)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CPLEX_PLATFORM "x64_windows_msvc14/stat_mdd")
elseif (CMAKE_BUILD_TYPE MATCHES Release)
set(CPLEX_PLATFORM "x64_windows_msvc14/stat_mda")
endif ()
set(CPLEX_ROOT_DIR "C:/Program Files/IBM/ILOG/CPLEX_Studio1210")
set(CPLEXLIBS ilocplex concert cplex12100 cp)
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CPLEX_ROOT_DIR "/opt/ibm/ILOG/CPLEX_Studio1210")
set(CPLEX_PLATFORM "x86-64_linux/static_pic")
set(CPLEXLIBS ilocplex concert cplex cp m pthread dl)
endif ()
set(CPLEX_INCLUDE_DIR "${CPLEX_ROOT_DIR}/cplex/include")
set(CPLEX_CONCERT_INCLUDE_DIR "${CPLEX_ROOT_DIR}/concert/include")
set(CPLEX_CP_INCLUDE_DIR "${CPLEX_ROOT_DIR}/cpoptimizer/include")
set(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR} ${CPLEX_CONCERT_INCLUDE_DIR} ${CPLEX_CP_INCLUDE_DIR})
include_directories(${CPLEX_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIL_STD")
set(CPLEXLIBDIR "${CPLEX_ROOT_DIR}/cplex/lib/${CPLEX_PLATFORM}")
set(CONCERTLIBDIR "${CPLEX_ROOT_DIR}/concert/lib/${CPLEX_PLATFORM}")
set(CPLIBDIR "${CPLEX_ROOT_DIR}/cpoptimizer/lib/${CPLEX_PLATFORM}")
set(CCLNDIRS ${CPLEXLIBDIR} ${CONCERTLIBDIR} ${CPLIBDIR})
link_directories(${CCLNDIRS})
file(GLOB SOURCES src/Source.cpp)
add_executable(${CMAKE_PROJECT_NAME} ${SOURCES} src)
target_link_libraries(${CMAKE_PROJECT_NAME} ${CPLEXLIBS})