-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (55 loc) · 1.87 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
cmake_minimum_required(VERSION 2.8.12)
project(GDAPlanner)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_COMMAND} -E time")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set(${PROJECT_NAME}_VERSION_MAJOR_0)
set(${PROJECT_NAME}_VERSION_MINOR_1)
option(BUILD_AND_ENABLE_TESTS "Build and enable tests" ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pedantic-errors -Wall -Wextra")
include_directories(
include)
link_directories(
)
add_executable(${PROJECT_NAME}-bin
src/main.cpp)
add_executable(prolog_tool
src/prolog_tool.cpp)
file(GLOB_RECURSE LIB_SOURCE "src/gdaplanner/*.cpp")
add_library(${PROJECT_NAME}
${LIB_SOURCE})
target_link_libraries(${PROJECT_NAME}-bin
${PROJECT_NAME})
target_link_libraries(prolog_tool
${PROJECT_NAME})
# Tests
if(BUILD_AND_ENABLE_TESTS)
message(STATUS "Building Tests")
enable_testing()
add_custom_target(make-bin-tests-directory ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${EXECUTABLE_OUTPUT_PATH}/tests)
macro(AddTests)
foreach(name ${ARGN})
add_executable(tests/${name} src/tests/${name}.cpp)
target_link_libraries(tests/${name} ${PROJECT_NAME})
add_test(NAME tests/${name}
COMMAND ${EXECUTABLE_OUTPUT_PATH}/tests/${name})
endforeach(name)
endmacro(AddTests)
AddTests(expression_equality)
AddTests(expression_negate)
AddTests(parse_pddl)
AddTests(world_assertions)
AddTests(basic_prolog_operations_and)
AddTests(basic_prolog_operations_or)
AddTests(basic_prolog_operations_equal)
AddTests(basic_prolog_operations_member)
AddTests(basic_prolog_operations_not)
AddTests(basic_prolog_operations_bound)
AddTests(basic_prolog_true_false)
AddTests(basic_prolog_world)
AddTests(basic_prolog_imply)
AddTests(compound_prolog_operations)
else()
message(STATUS "Not building Tests")
endif()