summarylogtreecommitdiffstats
path: root/CMakeLists.txt
blob: a0e817f0b029ed3e6a23ba01115e30bfd73a8083 (plain)
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

cmake_minimum_required (VERSION 2.8.9)
project (Csdp C)

option (BUILD_SHARED_LIBS "Build shared libraries instead of static." ON)

find_package(LAPACK REQUIRED)


file(GLOB csdp_srcs "lib/*.c")

include_directories(${PROJECT_SOURCE_DIR}/include)

add_library (libcsdp ${csdp_srcs})
set_target_properties(libcsdp PROPERTIES OUTPUT_NAME csdp)
target_link_libraries(libcsdp PRIVATE ${LAPACK_LIBRARIES})
install(TARGETS libcsdp
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
        RUNTIME DESTINATION bin)

add_executable(csdp solver/csdp.c)
target_link_libraries(csdp libcsdp)
install(TARGETS csdp DESTINATION bin)

add_executable(theta theta/theta.c)
target_link_libraries(theta libcsdp)
install(TARGETS theta DESTINATION bin)

add_executable(graphtoprob theta/graphtoprob.c)
target_link_libraries(graphtoprob libcsdp)
install(TARGETS graphtoprob DESTINATION bin)

add_executable(complement theta/complement.c)
target_link_libraries(complement libcsdp)
install(TARGETS complement DESTINATION bin)

add_executable(rand_graph theta/rand_graph.c)
target_link_libraries(rand_graph libcsdp)
install(TARGETS rand_graph DESTINATION bin)

enable_testing()
add_test (NAME theta1 COMMAND csdp ${PROJECT_SOURCE_DIR}/test/theta1.dat-s)
add_test (NAME g50 COMMAND theta ${PROJECT_SOURCE_DIR}/test/g50)