-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
80 lines (70 loc) · 2.29 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
cmake_minimum_required(VERSION 3.9)
set(CMAKE_CXX_STANDARD 14)
project(Force_Directed_Drawing)
set(CSV_DIR ${CMAKE_SOURCE_DIR}/lib/csv-parser/src)
include_directories(
${CSV_DIR}/
${CMAKE_SOURCE_DIR}/lib/svg/src/
${CMAKE_SOURCE_DIR}/lib/cxxopts/include/
${CMAKE_SOURCE_DIR}/src/
)
if(CMAKE_HOST_UNIX)
if(CONFIG STREQUAL "Debug")
add_compile_options(-Wall -O0 -ggdb)
else()
add_compile_options(-fopenmp -O3)
add_definitions(-DNDEBUG)
endif()
endif()
## lib
add_library(Eigen ${CMAKE_SOURCE_DIR}/lib/Eigen/)
set_target_properties(Eigen PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(Eigen PUBLIC
${CMAKE_SOURCE_DIR}/lib/Eigen/
)
add_library(snap ${CMAKE_SOURCE_DIR}/lib/snap-core/Snap.cpp)
target_include_directories(snap PUBLIC
${CMAKE_SOURCE_DIR}/lib/glib-core/
${CMAKE_SOURCE_DIR}/lib/snap-adv/
${CMAKE_SOURCE_DIR}/lib/snap-core/
)
file(GLOB_RECURSE glpk_files "*.c")
add_library(glpk ${glpk_files})
set_target_properties(glpk PROPERTIES LINKER_LANGUAGE C)
target_include_directories(glpk PUBLIC
${CMAKE_SOURCE_DIR}/lib/glpk/src/
${CMAKE_SOURCE_DIR}/lib/glpk/src/amd
${CMAKE_SOURCE_DIR}/lib/glpk/src/api
${CMAKE_SOURCE_DIR}/lib/glpk/src/bflib
${CMAKE_SOURCE_DIR}/lib/glpk/src/colamd
${CMAKE_SOURCE_DIR}/lib/glpk/src/draft
${CMAKE_SOURCE_DIR}/lib/glpk/src/env
${CMAKE_SOURCE_DIR}/lib/glpk/src/intopt
${CMAKE_SOURCE_DIR}/lib/glpk/src/minisat
${CMAKE_SOURCE_DIR}/lib/glpk/src/misc
${CMAKE_SOURCE_DIR}/lib/glpk/src/mpl
${CMAKE_SOURCE_DIR}/lib/glpk/src/npp
${CMAKE_SOURCE_DIR}/lib/glpk/src/proxy
${CMAKE_SOURCE_DIR}/lib/glpk/src/simplex
${CMAKE_SOURCE_DIR}/lib/glpk/src/zlib
)
add_library(force_directed
${CMAKE_SOURCE_DIR}/src/force_directed.h
${CMAKE_SOURCE_DIR}/src/layout.cpp
${CMAKE_SOURCE_DIR}/src/graphs.cpp
)
target_link_libraries(force_directed snap)
add_library(csv_parser
${CSV_DIR}/csv_reader.cpp
${CSV_DIR}/csv_stat.cpp
${CSV_DIR}/csv_writer.cpp
)
target_include_directories(csv_parser PUBLIC CSV_DIR)
## executables
add_executable(animate_spring src/animate_spring.cpp)
target_link_libraries(animate_spring snap force_directed csv_parser)
add_executable(animate_tutte src/animate_barycenter.cpp)
target_link_libraries(animate_tutte snap force_directed)
## tree executables
add_executable(tree_lp src/tree_lp.cpp)
target_link_libraries(tree_lp glpk)