@@ -7,8 +7,13 @@ SET (util_SRCS ../core/qgsrenderchecker.cpp)
7
7
# the UI file won't be wrapped!
8
8
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR}
9
9
${CMAKE_CURRENT_BINARY_DIR}
10
- ${CMAKE_CURRENT_SOURCE_DIR} /../../../src/core/
11
- ${CMAKE_CURRENT_SOURCE_DIR} /../../../src/analysis/vector
10
+ ${CMAKE_SOURCE_DIR} /src/core
11
+ ${CMAKE_SOURCE_DIR} /src/core/raster
12
+ ${CMAKE_SOURCE_DIR} /src/core/renderer
13
+ ${CMAKE_SOURCE_DIR} /src/core/symbology
14
+ ${CMAKE_SOURCE_DIR} /src/core/symbology-ng
15
+ ${CMAKE_SOURCE_DIR} /src/analysis
16
+ ${CMAKE_SOURCE_DIR} /src/analysis/vector
12
17
${QT_INCLUDE_DIR}
13
18
${GDAL_INCLUDE_DIR}
14
19
${PROJ_INCLUDE_DIR}
@@ -34,58 +39,39 @@ ENDIF (WIN32)
34
39
35
40
# Since the tests are not actually installed, but rather
36
41
# run directly from the build/src/tests dir we need to
37
- # ensure the omg libs can be found.
42
+ # ensure the qgis libs can be found.
38
43
IF (APPLE)
39
44
# For Mac OS X, the executable must be at the root of the bundle's executable folder
40
- SET (CMAKE_INSTALL_NAME_DIR @executable_path/../../../src/analyzer )
45
+ SET (CMAKE_INSTALL_NAME_DIR @executable_path/../../../src/core )
41
46
ENDIF (APPLE)
42
47
43
48
#note for tests we should not include the moc of our
44
49
#qtests in the executable file list as the moc is
45
50
#directly included in the sources
46
51
#and should not be compiled twice. Trying to include
47
52
#them in will cause an error at build time
53
+
54
+ #No relinking and full RPATH for the install tree
55
+ #See: http://www.cmake.org/Wiki/CMake_RPATH_handling#No_relinking_and_full_RPATH_for_the_install_tree
56
+
57
+ MACRO (ADD_QGIS_TEST testname testsrc)
58
+ SET(qgis_${testname} _SRCS ${testsrc} ${util_SRCS} )
59
+ SET(qgis_${testname} _MOC_CPPS ${testsrc} )
60
+ QT4_WRAP_CPP(qgis_${testname} _MOC_SRCS ${qgis_${testname} _MOC_CPPS})
61
+ ADD_CUSTOM_TARGET(qgis_${testname} moc ALL DEPENDS ${qgis_${testname} _MOC_SRCS})
62
+ ADD_EXECUTABLE(qgis_${testname} ${qgis_${testname} _SRCS})
63
+ ADD_DEPENDENCIES(qgis_${testname} qgis_${testname} moc)
64
+ TARGET_LINK_LIBRARIES(qgis_${testname} ${QT_LIBRARIES} qgis_analysis)
65
+ ADD_TEST(qgis_${testname} ${CMAKE_CURRENT_BINARY_DIR} /../../../output/bin/qgis_${testname} )
66
+ #SET_TARGET_PROPERTIES(qgis_${testname} PROPERTIES
67
+ # INSTALL_RPATH ${CMAKE_INSTALL_PREFIX} /${QGIS_LIB_DIR}
68
+ # INSTALL_RPATH_USE_LINK_PATH true )
69
+ ENDMACRO (ADD_QGIS_TEST)
70
+
48
71
#############################################################
49
72
# Tests:
50
73
51
- #
52
- # QgsVectorAnalyzer test
53
- #
54
- SET(qgis_vectoranalyzertest_SRCS testqgsvectoranalyzer.cpp ${util_SRCS} )
55
- SET(qgis_vectoranalyzertest_MOC_CPPS testqgsvectoranalyzer.cpp)
56
- QT4_WRAP_CPP(qgis_vectoranalyzertest_MOC_SRCS ${qgis_vectoranalyzertest_MOC_CPPS} )
57
- ADD_CUSTOM_TARGET(qgis_vectoranalyzertestmoc ALL DEPENDS ${qgis_vectoranalyzertest_MOC_SRCS} )
58
- ADD_EXECUTABLE(qgis_vectoranalyzertest ${qgis_vectoranalyzertest_SRCS} )
59
- ADD_DEPENDENCIES(qgis_vectoranalyzertest qgis_vectoranalyzertestmoc)
60
- TARGET_LINK_LIBRARIES(qgis_vectoranalyzertest ${QT_LIBRARIES} qgis_core qgis_analysis)
61
- #No relinking and full RPATH for the install tree
62
- #See: http://www.cmake.org/Wiki/CMake_RPATH_handling#No_relinking_and_full_RPATH_for_the_install_tree
63
- SET_TARGET_PROPERTIES(qgis_vectoranalyzertest
64
- # skip the full RPATH for the build tree
65
- PROPERTIES SKIP_BUILD_RPATH TRUE
66
- )
67
- SET_TARGET_PROPERTIES(qgis_vectoranalyzertest
68
- # when building, use the install RPATH already
69
- # (so it doesn't need to relink when installing)
70
- PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE
71
- )
72
- SET_TARGET_PROPERTIES(qgis_vectoranalyzertest
73
- # the RPATH to be used when installing
74
- PROPERTIES INSTALL_RPATH ${QGIS_LIB_DIR}
75
- )
76
- SET_TARGET_PROPERTIES(qgis_vectoranalyzertest
77
- # add the automatically determined parts of the RPATH
78
- # which point to directories outside the build tree to the install RPATH
79
- PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE
80
- )
81
- IF (APPLE)
82
- # For Mac OS X, the executable must be at the root of the bundle's executable folder
83
- INSTALL(TARGETS qgis_vectoranalyzertest RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} )
84
- ADD_TEST(qgis_vectoranalyzertest ${CMAKE_INSTALL_PREFIX} /qgis_vectoranalyzertest)
85
- ELSE (APPLE)
86
- INSTALL(TARGETS qgis_vectoranalyzertest RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} /bin)
87
- ADD_TEST(qgis_vectoranalyzertest ${CMAKE_INSTALL_PREFIX} /bin/qgis_vectoranalyzertest)
88
- ENDIF (APPLE)
74
+ ADD_QGIS_TEST(analyzertest testqgsvectoranalyzer.cpp)
89
75
90
76
91
77
0 commit comments