-
Notifications
You must be signed in to change notification settings - Fork 108
/
CMakeLists.txt
49 lines (35 loc) · 1.25 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
cmake_minimum_required(VERSION 3.0)
project (re-bear)
option(CMD_BUILD_TESTING "Enable testing for bearcommander" ON)
# modules:
set ( M_BEARPARSER "parser" )
set ( M_BEARCOMMANDER "commander" )
option(USE_QT4 "Use Qt4" OFF )
option(USE_QT5 "Use Qt5" OFF )
# modules paths:
set (BEARPARSER_INC "${M_BEARPARSER}/include")
set (BEARPARSER_DIR "${CMAKE_SOURCE_DIR}/${M_BEARPARSER}" CACHE PATH "BearParser main path")
set (COMMANDER_DIR "${CMAKE_SOURCE_DIR}/${M_BEARCOMMANDER}" CACHE PATH "BearCommander main path")
# Add bearparser includes:
include_directories( ${BEARPARSER_INC} )
# Add sub-directories
#
# libs
add_subdirectory ( ${M_BEARPARSER} )
set (PARSER_LIB bearparser CACHE PATH "BearParser library path")
# executables
add_subdirectory( ${M_BEARCOMMANDER} )
# dependencies
add_dependencies(bearcommander bearparser)
# Setup testing
if(CMD_BUILD_TESTING)
enable_testing()
# 0) does the application run
add_test (TestRuns ${CMAKE_BINARY_DIR}/bearcommander)
set_tests_properties(TestRuns PROPERTIES PASS_REGULAR_EXPRESSION "Bearparser")
IF (NOT WIN32)
# 1) external tests
add_test (TestExternal ${CMAKE_SOURCE_DIR}/test.sh ${CMAKE_SOURCE_DIR})
set_tests_properties(TestExternal PROPERTIES PASS_REGULAR_EXPRESSION "All passed")
ENDIF()
endif()