/
CMakeLists.txt
49 lines (42 loc) · 1.49 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
IF(NOT MSVC)
ADD_SUBDIRECTORY(wms)
ENDIF(NOT MSVC)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/external
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/server
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/server
${CMAKE_SOURCE_DIR}/src/test
)
#note for tests we should not include the moc of our
#qtests in the executable file list as the moc is
#directly included in the sources
#and should not be compiled twice. Trying to include
#them in will cause an error at build time
#No relinking and full RPATH for the install tree
#See: http://www.cmake.org/Wiki/CMake_RPATH_handling#No_relinking_and_full_RPATH_for_the_install_tree
MACRO (ADD_QGIS_TEST TESTSRC)
SET (TESTNAME ${TESTSRC})
STRING(REPLACE "test" "" TESTNAME ${TESTNAME})
STRING(REPLACE "qgs" "" TESTNAME ${TESTNAME})
STRING(REPLACE ".cpp" "" TESTNAME ${TESTNAME})
SET (TESTNAME "qgis_${TESTNAME}test")
ADD_EXECUTABLE(${TESTNAME} ${TESTSRC} ${util_SRCS})
SET_TARGET_PROPERTIES(${TESTNAME} PROPERTIES AUTOMOC TRUE)
TARGET_LINK_LIBRARIES(${TESTNAME}
${Qt5Core_LIBRARIES}
${Qt5Test_LIBRARIES}
qgis_server)
ADD_TEST(${TESTNAME} ${CMAKE_BINARY_DIR}/output/bin/${TESTNAME} -maxwarnings 10000)
ENDMACRO (ADD_QGIS_TEST)
#############################################################
# Tests:
SET(TESTS
testqgsserverquerystringparameter.cpp
)
FOREACH(TESTSRC ${TESTS})
ADD_QGIS_TEST(${TESTSRC})
ENDFOREACH(TESTSRC)