CMakeLists.txt 2.39 KB
Newer Older
1
2
3
cmake_minimum_required(VERSION 2.8)

# Create the project.
4
project(ted-experiments)
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

# Compiler flags.
# MUST be declared after project().
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")

# Verify which timing implementation to use.
# NOTE: Comes from common-code.
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
if(NOT HAVE_CLOCK_GETTIME)
  add_definitions(-DGETRUSAGE)
endif()

# Build executable with the experiments.
add_executable(
  ted-join-experiments # EXECUTABLE NAME
  src/experiments.cc   # EXECUTABLE SOURCE
)
target_link_libraries(
  ted-join-experiments # TARGET EXECUTABLE NAME
  TimingLibrary        # LIBRARY NAME
)
target_include_directories(
  ted-join-experiments                # TARGET EXECUTABLE NAME
  PUBLIC external/common-code/timings # HEADER FILE
)

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Build executable with the experiments.
add_executable(
  ted-algs-experiments                   # EXECUTABLE NAME
  src/ted_algs/ted_algs_experiments.cc   # EXECUTABLE SOURCE
)
target_link_libraries(
  ted-algs-experiments # TARGET EXECUTABLE NAME
  TimingLibrary        # LIBRARY NAME
)
target_include_directories(
  ted-algs-experiments                # TARGET EXECUTABLE NAME
  PUBLIC external/common-code/timings # HEADER FILE
)

# Create the timing library.
add_library(
  TimingLibrary                              # LIBRARY NAME
  external/common-code/timings/timing.cxx    # LIBRARY SOURCE
)

52
53
54
55
56
57
# Create header-only library 'TreeSimilarity' with our algorithms.
add_library(
  TreeSimilarity INTERFACE
)
target_include_directories(
  TreeSimilarity INTERFACE
58
59
60
61
  external/tree-similarity-private/src/allpairs
  external/tree-similarity-private/src/cost_model
  external/tree-similarity-private/src/data_structures
  external/tree-similarity-private/src/join
62
  external/tree-similarity-private/src/label
63
  external/tree-similarity-private/src/node
64
  external/tree-similarity-private/src/parser
65
  external/tree-similarity-private/src/tree_to_set_converter
66
  external/tree-similarity-private/src/ted
67
  external/tree-similarity-private/src/ted_ub
68
69
70
71
72
73
74
)

# Let the compiler know to find the header files in TreeSimilarity library.
target_link_libraries(
  ted-join-experiments # EXECUTABLE NAME
  TreeSimilarity       # LIBRARY NAME
)
75
76
77
78
79
80

# Let the compiler know to find the header files in TreeSimilarity library.
target_link_libraries(
  ted-algs-experiments # EXECUTABLE NAME
  TreeSimilarity       # LIBRARY NAME
)