forked from bjoern-andres/graph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (72 loc) · 3.35 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
project(graph)
include_directories(include)
file(GLOB headers include/andres/*.hxx include/andres/graph/*.hxx include/andres/ilp/*.hxx)
enable_testing()
##############################################################################
# Doxygen
##############################################################################
find_package(Doxygen QUIET)
if(DOXYGEN_FOUND)
message(STATUS "Doxygen found")
else()
message("doxygen not found")
endif()
##############################################################################
# OpenMP
##############################################################################
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
message(STATUS "OpenMP found")
else()
message("OpenMP not found")
endif()
##############################################################################
# Gurobi
##############################################################################
find_package(GUROBI)
if(GUROBI_FOUND)
include_directories(${GUROBI_INCLUDE_DIR})
endif()
##############################################################################
# Cplex
##############################################################################
find_package(CPLEX)
if(CPLEX_FOUND)
include_directories(${CPLEX_INCLUDE_DIR})
include_directories(${CONCERT_INCLUDE_DIR})
add_definitions(-DILOUSESTL)
add_definitions(-DIL_STD)
endif()
##############################################################################
# targets: graph
##############################################################################
add_executable(test-graph-graph src/unittest/graph/graph.cxx ${headers})
add_test(test-graph-graph test-graph-graph)
add_executable(test-graph-digraph src/unittest/graph/digraph.cxx ${headers})
add_test(test-graph-digraph test-graph-digraph)
add_executable(test-graph-shortest-paths src/unittest/graph/shortest-paths.cxx ${headers})
add_test(test-graph-shortest-paths test-graph-shortest-paths)
add_executable(test-graph-paths src/unittest/graph/paths.cxx ${headers})
add_test(test-graph-paths test-graph-paths)
add_executable(test-graph-components src/unittest/graph/components.cxx ${headers})
add_test(test-graph-components test-graph-components)
add_executable(test-graph-max-flow src/unittest/graph/max-flow.cxx ${headers})
add_test(test-graph-max-flow test-graph-max-flow)
if(CPLEX_FOUND)
add_executable(test-graph-multicut-cplex src/unittest/graph/multicut-cplex.cxx ${headers})
target_link_libraries(test-graph-multicut-cplex ${CMAKE_THREAD_LIBS_INIT} ${ILOCPLEX_LIBRARY} ${CPLEX_LIBRARY} ${CONCERT_LIBRARY})
add_test(test-graph-multicut-cplex test-graph-multicut-cplex)
endif()
if(GUROBI_FOUND)
add_executable(test-graph-multicut-gurobi src/unittest/graph/multicut-gurobi.cxx ${headers})
target_link_libraries(test-graph-multicut-gurobi ${CMAKE_THREAD_LIBS_INIT} ${GUROBI_CPP_LIBRARY} ${GUROBI_LIBRARY})
add_test(test-graph-multicut-gurobi test-graph-multicut-gurobi)
endif()
if(DOXYGEN_FOUND)
configure_file("${graph_SOURCE_DIR}/doxygen/doxyfile-graph.in" "${graph_BINARY_DIR}/doxyfile-graph" @ONLY IMMEDIATE)
add_custom_target(doc-graph ALL COMMAND ${DOXYGEN} "${graph_BINARY_DIR}/doxyfile-graph")
endif()