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

# Create the project.
4
project(ted-experiments)
5
6
7

# Compiler flags.
# MUST be declared after project().
Mateusz Pawlik's avatar
Mateusz Pawlik committed
8
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -O3")
9
10
11
12
13
14
15
16
17
18
19

# 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(
20
21
  ted-join-experiments                   # EXECUTABLE NAME
  src/join_algs/join_algs_experiments.cc # EXECUTABLE SOURCE
22
23
24
25
26
27
28
29
30
31
)
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
62
63
  external/tree-similarity/src/cost_model
  external/tree-similarity/src/data_structures
  external/tree-similarity/src/join
  external/tree-similarity/src/join/tjoin
  external/tree-similarity/src/join/tang
  external/tree-similarity/src/join/naive
64
65
66
67
  external/tree-similarity/src/join/binary_branches
  external/tree-similarity/src/join/label_histogram
  external/tree-similarity/src/join/degree_histogram
  external/tree-similarity/src/join/leaf_dist_histogram
68
69
70
71
72
  external/tree-similarity/src/label
  external/tree-similarity/src/node
  external/tree-similarity/src/parser
  external/tree-similarity/src/ted
  external/tree-similarity/src/ted_ub
73
74
75
76
77
78
79
)

# Let the compiler know to find the header files in TreeSimilarity library.
target_link_libraries(
  ted-join-experiments # EXECUTABLE NAME
  TreeSimilarity       # LIBRARY NAME
)
80
81
82
83
84
85

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