This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
61 lines (50 loc) · 1.61 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
54
55
56
57
58
59
60
61
cmake_minimum_required(VERSION 3.3.0)
# set the project name and version
project(VIPR VERSION 1.1)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# set function visibility default to hidden
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
# path to find modules
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
# find GMP
find_package(GMP REQUIRED)
include_directories(${GMP_INCLUDE_DIRS})
set(libs ${libs} ${GMP_LIBRARIES})
# option to install viprcomp
option(VIPRCOMP "Use viprcomp" ON)
# add executables
add_executable(viprttn viprttn.cpp)
add_executable(vipr2html vipr2html.cpp)
add_executable(viprchk viprchk.cpp)
target_link_libraries(viprchk ${libs})
if(VIPRCOMP)
# Only install viprcomp if working SoPlex is found
find_package(ZLIB)
if(ZLIB_FOUND)
find_package(SOPLEX)
find_package(Boost 1.77)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()
if(SOPLEX_FOUND)
# include ZLIB
include_directories(${ZLIB_INCLUDE_DIRS})
set(libs ${libs} ${ZLIB_LIBRARIES})
# include SoPlex
include_directories(${SOPLEX_INCLUDE_DIRS})
set(libs ${libs} ${SOPLEX_LIBRARIES})
# add viprcomp target and link
add_executable(viprcomp viprcomp.cpp)
add_definitions(-DSOPLEX_WITH_GMP)
target_link_libraries(viprcomp ${libs})
message(STATUS "Soplex found.")
else()
message(STATUS "viprcomp not installed, because SoPlex could not be found.")
endif()
else()
message(STATUS "viprcomp not installed, because ZLIB could not be found (required by SoPlex).")
endif()
endif()