[CMake] visual test in own dir

This commit is contained in:
Mathis Logemann 2022-01-27 18:37:03 +01:00
parent ba27149232
commit aee8519bac
2 changed files with 30 additions and 27 deletions

View file

@ -15,6 +15,8 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0")
cmake_policy(SET CMP0110 OLD)
endif()
add_subdirectory(visual)
add_executable(mapnik-test-unit
unit/run.cpp
unit/color/css_color.cpp
@ -114,7 +116,7 @@ target_link_libraries(mapnik-test-unit PUBLIC
# workaround since the "offical" include dir would be <catch2/catch.hpp>
file(COPY catch_ext.hpp DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
file(COPY cleanup.hpp DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
target_include_directories(mapnik-test-unit PRIVATE "${catch2_SOURCE_DIR}/single_include/catch2" ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(mapnik-test-unit PRIVATE "${Catch2_SOURCE_DIR}/single_include/catch2" "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
add_executable(agg_rasterizer_integer_overflow_test standalone/agg_rasterizer_integer_overflow_test.cpp)
set_target_properties(agg_rasterizer_integer_overflow_test PROPERTIES
@ -128,7 +130,7 @@ target_link_libraries(agg_rasterizer_integer_overflow_test PUBLIC
mapnik::agg
mapnik::json
)
target_include_directories(agg_rasterizer_integer_overflow_test PRIVATE "${catch2_SOURCE_DIR}/single_include/catch2" ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(agg_rasterizer_integer_overflow_test PRIVATE "${Catch2_SOURCE_DIR}/single_include/catch2" "${CMAKE_CURRENT_BINARY_DIR}")
add_executable(datasource_registration_test standalone/datasource_registration_test.cpp)
set_target_properties(datasource_registration_test PROPERTIES
@ -141,7 +143,7 @@ target_link_libraries(datasource_registration_test PUBLIC
mapnik::mapnik
mapnik::agg
)
target_include_directories(datasource_registration_test PRIVATE "${catch2_SOURCE_DIR}/single_include/catch2" ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(datasource_registration_test PRIVATE "${Catch2_SOURCE_DIR}/single_include/catch2" "${CMAKE_CURRENT_BINARY_DIR}")
add_executable(font_registration_test standalone/font_registration_test.cpp)
set_target_properties(font_registration_test PROPERTIES
@ -155,7 +157,7 @@ target_link_libraries(font_registration_test PUBLIC
mapnik::agg
mapnik::json
)
target_include_directories(font_registration_test PRIVATE "${catch2_SOURCE_DIR}/single_include/catch2" ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(font_registration_test PRIVATE "${Catch2_SOURCE_DIR}/single_include/catch2" "${CMAKE_CURRENT_BINARY_DIR}")
#not workable since boost::filesystem native returns a wstring and the function taskes a std::string
add_executable(map_xml_test standalone/map_xml_test.cpp)
@ -170,30 +172,9 @@ target_link_libraries(map_xml_test PUBLIC
mapnik::agg
mapnik::json
)
target_include_directories(map_xml_test PRIVATE "${catch2_SOURCE_DIR}/single_include/catch2" ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(map_xml_test PRIVATE "${Catch2_SOURCE_DIR}/single_include/catch2" "${CMAKE_CURRENT_BINARY_DIR}")
add_executable(mapnik-test-visual
visual/parse_map_sizes.cpp
visual/report.cpp
visual/runner.cpp
visual/run.cpp
)
set_target_properties(mapnik-test-visual PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
)
target_link_libraries(mapnik-test-visual PRIVATE
Catch2::Catch2
Boost::program_options
Boost::filesystem
mapnik::mapnik
mapnik::agg
)
target_include_directories(mapnik-test-visual PRIVATE "${catch2_SOURCE_DIR}/single_include/catch2" ${CMAKE_CURRENT_BINARY_DIR})
include("${catch2_SOURCE_DIR}/contrib/Catch.cmake")
include("${catch2_SOURCE_DIR}/contrib/ParseAndAddCatchTests.cmake")
include("${Catch2_SOURCE_DIR}/contrib/Catch.cmake")
file(COPY data DESTINATION "${MAPNIK_OUTPUT_DIR}/test")
file(COPY data-visual DESTINATION "${MAPNIK_OUTPUT_DIR}/test")

View file

@ -0,0 +1,22 @@
add_executable(mapnik-test-visual
parse_map_sizes.cpp
report.cpp
runner.cpp
run.cpp
)
set_target_properties(mapnik-test-visual PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
)
target_link_libraries(mapnik-test-visual PRIVATE
Catch2::Catch2
Boost::program_options
Boost::filesystem
mapnik::mapnik
mapnik::agg
)
# needed for cleanup.hpp
target_include_directories(mapnik-test-visual PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
mapnik_install_utility(mapnik-test-visual)