CMakeLists.txt 1.8 KB
Newer Older
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
cmake_minimum_required(VERSION 2.8)

# Create the project.
project(ted-join-experiments)

# 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
)

# Link the timing library and header file.
add_library(
  TimingLibrary                              # LIBRARY NAME
  external/common-code/timings/timing.cxx    # LIBRARY 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
)

# Create header-only library 'TreeSimilarity' with our algorithms.
add_library(
  TreeSimilarity INTERFACE
)
target_include_directories(
  TreeSimilarity INTERFACE
44
45
46
47
  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
48
  external/tree-similarity-private/src/label
49
  external/tree-similarity-private/src/node
50
  external/tree-similarity-private/src/parser
51
  external/tree-similarity-private/src/tree_to_set_converter
52
  external/tree-similarity-private/src/ted
53
  external/tree-similarity-private/src/ted_ub
54
55
56
57
58
59
60
)

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