|
| 1 | +##################################################### |
| 2 | +# Don't forget to include output directory, otherwise |
| 3 | +# the UI file won't be wrapped! |
| 4 | +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} |
| 5 | + ${CMAKE_CURRENT_BINARY_DIR} |
| 6 | + ${CMAKE_SOURCE_DIR}/src/core |
| 7 | + ${CMAKE_SOURCE_DIR}/src/core/geometry |
| 8 | + ${CMAKE_SOURCE_DIR}/src/core/expression |
| 9 | + ${CMAKE_SOURCE_DIR}/src/core/dxf |
| 10 | + ${CMAKE_SOURCE_DIR}/src/core/symbology |
| 11 | + ${CMAKE_SOURCE_DIR}/src/core/metadata |
| 12 | + ${CMAKE_BINARY_DIR}/src/core |
| 13 | + ${CMAKE_SOURCE_DIR}/src/test |
| 14 | + ${CMAKE_SOURCE_DIR}/src/server |
| 15 | + ${CMAKE_BINARY_DIR}/src/server |
| 16 | + ${CMAKE_SOURCE_DIR}/src/server/services/wms |
| 17 | +) |
| 18 | + |
| 19 | +#note for tests we should not include the moc of our |
| 20 | +#qtests in the executable file list as the moc is |
| 21 | +#directly included in the sources |
| 22 | +#and should not be compiled twice. Trying to include |
| 23 | +#them in will cause an error at build time |
| 24 | + |
| 25 | +#No relinking and full RPATH for the install tree |
| 26 | +#See: http://www.cmake.org/Wiki/CMake_RPATH_handling#No_relinking_and_full_RPATH_for_the_install_tree |
| 27 | +SET(MODULE_WMS_SRCS |
| 28 | + ${CMAKE_SOURCE_DIR}/src/server/services/wms/qgswmsparameters.cpp) |
| 29 | + |
| 30 | +MACRO (ADD_QGIS_TEST TESTSRC) |
| 31 | + SET (TESTNAME ${TESTSRC}) |
| 32 | + STRING(REPLACE "test" "" TESTNAME ${TESTNAME}) |
| 33 | + STRING(REPLACE "qgs" "" TESTNAME ${TESTNAME}) |
| 34 | + STRING(REPLACE ".cpp" "" TESTNAME ${TESTNAME}) |
| 35 | + SET (TESTNAME "qgis_${TESTNAME}test") |
| 36 | + ADD_EXECUTABLE(${TESTNAME} ${TESTSRC} ${MODULE_WMS_SRCS}) |
| 37 | + SET_TARGET_PROPERTIES(${TESTNAME} PROPERTIES AUTOMOC TRUE) |
| 38 | + TARGET_LINK_LIBRARIES(${TESTNAME} |
| 39 | + ${Qt5Core_LIBRARIES} |
| 40 | + ${Qt5Xml_LIBRARIES} |
| 41 | + ${Qt5Svg_LIBRARIES} |
| 42 | + ${Qt5Test_LIBRARIES} |
| 43 | + ${PROJ_LIBRARY} |
| 44 | + ${GEOS_LIBRARY} |
| 45 | + ${GDAL_LIBRARY} |
| 46 | + qgis_core |
| 47 | + qgis_server |
| 48 | + ) |
| 49 | + ADD_TEST(${TESTNAME} ${CMAKE_BINARY_DIR}/output/bin/${TESTNAME} -maxwarnings 10000) |
| 50 | +ENDMACRO (ADD_QGIS_TEST) |
| 51 | + |
| 52 | +############################################################# |
| 53 | +# Tests: |
| 54 | + |
| 55 | +SET(TESTS |
| 56 | + testqgswmsparameters.cpp |
| 57 | +) |
| 58 | + |
| 59 | +FOREACH(TESTSRC ${TESTS}) |
| 60 | + ADD_QGIS_TEST(${TESTSRC}) |
| 61 | +ENDFOREACH(TESTSRC) |
0 commit comments