forked from pnnl/NWGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
94 lines (73 loc) · 3.3 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
86
87
88
89
90
91
92
93
94
# -----------------------------------------------------------------------------
# The date library from MIT provides C++20 std date functionality in C++17
# -----------------------------------------------------------------------------
include(Date)
# -----------------------------------------------------------------------------
# Generate the configuration files used for logging, and -I its built path.
# -----------------------------------------------------------------------------
get_filename_component(NWGRAPH_CXX_COMPILER ${CMAKE_CXX_COMPILER} NAME)
configure_file(config.h.in config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# -----------------------------------------------------------------------------
# Create an interface library for the benchmarks to depend on.
# -----------------------------------------------------------------------------
add_library(bench_lib INTERFACE)
target_sources(bench_lib INTERFACE
common.hpp
Log.hpp
#config.h
)
target_include_directories(bench_lib INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(bench_lib INTERFACE nwgraph docopt nlohmann_json::nlohmann_json)
target_link_libraries(bench_lib INTERFACE date::date)
find_package(nlohmann_json 3.2.0 QUIET)
if (NOT nlohmann_json_FOUND)
message("Installed json not found -- fetching")
FetchContent_Declare(json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.7.3)
FetchContent_GetProperties(json)
if(NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endif()
add_custom_target(bench)
# -----------------------------------------------------------------------------
# NWGRAPH driver to process edgelists.
# -----------------------------------------------------------------------------
add_executable(process_edge_list ProcessEdgelist.cpp)
target_link_libraries(process_edge_list nwgraph docopt)
add_dependencies(bench process_edge_list)
# -----------------------------------------------------------------------------
# NWGRAPH driver to verify that we're correctly generating source lists.
# -----------------------------------------------------------------------------
# Set policy to suppress warnings
cmake_policy(SET CMP0115 NEW)
add_executable(sources SourceVerifier.cpp)
target_link_libraries(sources bench_lib)
add_dependencies(bench sources)
# -----------------------------------------------------------------------------
# NWGRAPH benchmark drivers
# -----------------------------------------------------------------------------
add_executable(bc.exe bc.cpp)
target_link_libraries(bc.exe bench_lib)
add_dependencies(bench bc.exe)
add_executable(bfs.exe bfs.cpp)
target_link_libraries(bfs.exe bench_lib)
add_dependencies(bench bfs.exe)
add_executable(cc.exe cc.cpp)
target_link_libraries(cc.exe bench_lib)
add_dependencies(bench cc.exe)
# add_executable(js.exe js.cpp)
# target_link_libraries(js.exe bench_lib)
# add_dependencies(bench js.exe)
add_executable(pr.exe pr.cpp)
target_link_libraries(pr.exe bench_lib)
add_dependencies(bench pr.exe)
add_executable(sssp.exe sssp.cpp)
target_link_libraries(sssp.exe bench_lib)
add_dependencies(bench sssp.exe)
add_executable(tc.exe tc.cpp)
target_link_libraries(tc.exe bench_lib nlohmann_json::nlohmann_json)
add_dependencies(bench tc.exe)