-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (69 loc) · 1.88 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 3.20)
project(
"Learning BGL"
VERSION 1.0
DESCRIPTION "Repository with examples for understanding how BGL works"
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 17)
set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message( STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
# ----- begin BOOST related ----- #
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.45.0 COMPONENTS Graph)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()
include_directories(
"${CMAKE_CURRENT_LIST_DIR}/src"
)
# link boost to all targets
link_libraries(
${Boost_LIBRARIES}
)
# ----- begin target definitions ----- #
add_executable(
kevin-bacon
"src/kevin-bacon.cpp"
)
add_executable(
kruskal
"src/kruskal.cpp"
)
add_executable(
tiny-ewg
"src/tiny-ewg.cpp"
)
add_executable(
tiny-ewg-improved
"src/tiny-ewg-improved.cpp"
)
# ----- end target definitions ----- #
# ----- begin copy across needed files ----- #
add_custom_command(
TARGET kevin-bacon POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/src/kevin-bacon.dat
${CMAKE_CURRENT_BINARY_DIR}/kevin-bacon.dat
)
add_custom_command(
TARGET tiny-ewg POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/src/tiny-ewg.txt
${CMAKE_CURRENT_BINARY_DIR}/tiny-ewg.txt
)
add_custom_command(
TARGET tiny-ewg-improved POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/src/tiny-ewg.txt
${CMAKE_CURRENT_BINARY_DIR}/tiny-ewg.txt
)
# ----- end copy across needed files ----- #