-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
70 lines (51 loc) · 2.82 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
cmake_minimum_required(VERSION 3.3)
project(clique-partitioning)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
include_directories(include)
file(GLOB headers
include/*.hxx
)
enable_testing()
find_package(GUROBI REQUIRED)
include_directories(${GUROBI_INCLUDE_DIRS})
# unit tests
add_executable(test-clique-partitioning-bnc src/unit-tests/clique-partitioning-bnc.cxx ${headers})
target_link_libraries(test-clique-partitioning-bnc ${CMAKE_THREAD_LIBS_INIT} ${GUROBI_CXX_LIBRARY} ${GUROBI_LIBRARY})
add_test(test-clique-partitioning-bnc test-clique-partitioning-bnc)
add_executable(test-property-maps src/unit-tests/property-maps.cxx ${headers})
add_test(test-property-maps test-property-maps)
add_executable(test-load src/unit-tests/load.cxx ${headers})
add_test(test-load test-load)
add_executable(test-callback src/unit-tests/callback.cxx ${headers})
add_test(test-callback test-callback)
# inequalities
add_executable(test-inequality src/unit-tests/inequalities/inequality.cxx ${headers})
add_test(test-inequality test-inequality)
add_executable(test-odd-wheel src/unit-tests/inequalities/odd-wheel.cxx ${headers})
add_test(test-odd-wheel test-odd-wheel)
add_executable(test-two-partition src/unit-tests/inequalities/two-partition.cxx ${headers})
add_test(test-two-partition test-two-partition)
add_executable(test-hypermetric src/unit-tests/inequalities/hypermetric.cxx ${headers})
add_test(test-hypermetric test-hypermetric)
add_executable(test-separator src/unit-tests/inequalities/separator.cxx ${headers})
add_test(test-separator test-separator)
add_executable(test-complete src/unit-tests/inequalities/complete.cxx ${headers})
add_test(test-complete test-complete)
add_executable(test-chvatal-gomory src/unit-tests/inequalities/chvatal-gomory.cxx ${headers})
target_link_libraries(test-chvatal-gomory ${CMAKE_THREAD_LIBS_INIT} ${GUROBI_CXX_LIBRARY} ${GUROBI_LIBRARY})
add_test(test-chvatal-gomory test-chvatal-gomory)
add_executable(test-half-chorded-odd-cycle src/unit-tests/inequalities/half-chorded-odd-cycle.cxx ${headers})
add_test(test-half-chorded-odd-cycle test-half-chorded-odd-cycle)
add_executable(test-clique-web src/unit-tests/inequalities/clique-web.cxx ${headers})
target_link_libraries(test-clique-web ${CMAKE_THREAD_LIBS_INIT} ${GUROBI_CXX_LIBRARY} ${GUROBI_LIBRARY})
add_test(test-clique-web test-clique-web)
# main
add_executable(main src/main.cxx ${headers})
target_link_libraries(main ${CMAKE_THREAD_LIBS_INIT} ${GUROBI_CXX_LIBRARY} ${GUROBI_LIBRARY})
target_compile_features(main PUBLIC cxx_std_17)
# Python interface
set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 CONFIG REQUIRED)
pybind11_add_module(clique_partitioning src/python-interface.cxx)
target_link_libraries(clique_partitioning PRIVATE ${CMAKE_THREAD_LIBS_INIT} ${GUROBI_CXX_LIBRARY} ${GUROBI_LIBRARY})
install(TARGETS clique_partitioning DESTINATION .)