diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ff1c1973..dc09aa516 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,6 @@ include(CTest) add_feature_info(BUILD_TESTING BUILD_TESTING "Adds tests") mapnik_option(INSTALL_DEPENDENCIES "if ON, all dependencies (eg. required dlls) will be copied into CMAKE_INSTALL_PREFIX/MAPNIK_BIN_DIR." ON) - mapnik_option(BUILD_SHARED_LIBS "build mapnik dynamic(ON) or static(OFF)" ON) mapnik_option(BUILD_SHARED_PLUGINS "build dynamic plugins" ${BUILD_SHARED_LIBS}) # use BUILD_SHARED_LIBS as default option mapnik_option(BUILD_SHARED_CRT "(only windows with msvc) use msvc shared crt" ON) @@ -94,18 +93,6 @@ mapnik_option(USE_GLIBC_WORKAROUND "see https://github.com/mapnik/mapnik/pull/37 feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES) feature_summary(FILENAME "${CMAKE_CURRENT_BINARY_DIR}/features.log" WHAT ENABLED_FEATURES DISABLED_FEATURES) -set(CMAKE_CXX_STANDARD 14 CACHE STRING "Sets the c++ standard. c++14 is minimum.") -message(STATUS "Using c++${CMAKE_CXX_STANDARD}") -# https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html -set(CXX_EXTENSIONS OFF CACHE STRING "Enables the compiler specific extensions.") # Fallsback to -std=c++ if off -message(STATUS "Using c++ extensions: ${CXX_EXTENSIONS}") -# https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD_REQUIRED.html#prop_tgt:CXX_STANDARD_REQUIRED -set(CXX_STANDARD_REQUIRED ON) # require the specified CMAKE_CXX_STANDARD - -# add debug postfix to the libraries -set(MAPNIK_DEBUG_POSTFIX "d" CACHE STRING "sets the debug library postfix on mapnik, wkt and json") -message(STATUS "postfix for debug libraries: ${MAPNIK_DEBUG_POSTFIX}") - include(GNUInstallDirs) # See for more details: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html set(MAPNIK_BIN_DIR ${CMAKE_INSTALL_BINDIR} CACHE STRING "Install directory for binaries") @@ -130,7 +117,26 @@ set(MAPNIK_COMPILE_DEFS "") set(MAPNIK_OPTIONAL_LIBS "") set(MAPNIK_OPTIONAL_LIBS_INCLUDE "") +############################# +############################# # Begin project configuration +############################# +############################# + +set(CMAKE_CXX_STANDARD 14 CACHE STRING "Sets the c++ standard. c++14 is minimum.") +set(CMAKE_CXX_STANDARD_REQUIRED ON) # require the specified CMAKE_CXX_STANDARD +set(CMAKE_CXX_EXTENSIONS OFF CACHE STRING "Enables the compiler specific extensions.") # Fallsback to -std=c++ if off +message(STATUS "Using c++${CMAKE_CXX_STANDARD}") +message(STATUS "Using c++ extensions: ${CXX_EXTENSIONS}") + +# add debug postfix to the libraries +set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "sets the debug library postfix on mapnik, wkt and json") +message(STATUS "postfix for debug libraries: ${CMAKE_DEBUG_POSTFIX}") + +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib") # needs to be before the first call of find_boost. list(APPEND MAPNIK_COMPILE_DEFS BOOST_SPIRIT_X3_HIDE_CXX17_WARNING) diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 0d8e96059..2aa5a4359 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -33,11 +33,7 @@ function(mapnik_create_benchmark) target_include_directories(${TARGET_NAME} PRIVATE include) target_link_libraries(${TARGET_NAME} PRIVATE mapnik::agg mapnik::mapnik) set_target_properties(${TARGET_NAME} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" OUTPUT_NAME "${BENCHNAME}" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" ) endfunction() diff --git a/demo/c++/CMakeLists.txt b/demo/c++/CMakeLists.txt index 567610f7e..7d3095ed9 100644 --- a/demo/c++/CMakeLists.txt +++ b/demo/c++/CMakeLists.txt @@ -1,9 +1,2 @@ add_executable(mapnik-demo rundemo.cpp) -set_target_properties(mapnik-demo PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) - target_link_libraries(mapnik-demo PRIVATE mapnik::agg mapnik::mapnik) diff --git a/demo/viewer/CMakeLists.txt b/demo/viewer/CMakeLists.txt index 2844b332f..6b0812ad5 100644 --- a/demo/viewer/CMakeLists.txt +++ b/demo/viewer/CMakeLists.txt @@ -40,10 +40,6 @@ set_target_properties(mapnik-viewer PROPERTIES AUTORCC ON AUTOUIC ON AUTOMOC ON - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" ) target_link_libraries(mapnik-viewer PRIVATE diff --git a/plugins/input/CMakeLists.txt b/plugins/input/CMakeLists.txt index 7a5336492..8a1bcd5fd 100644 --- a/plugins/input/CMakeLists.txt +++ b/plugins/input/CMakeLists.txt @@ -1,8 +1,6 @@ set(_plugin_prefix "") set(_plugin_suffix ".input") set(_plugin_library_output "${MAPNIK_OUTPUT_DIR}/plugins/input") -set(_plugin_runtime_output "${MAPNIK_OUTPUT_DIR}") -set(_plugin_archive_output "${MAPNIK_OUTPUT_DIR}/lib") set(_plugin_fpic ON) set(_plugin_linkage MODULE) set(_plugin_visibility PRIVATE) @@ -19,9 +17,6 @@ macro(add_plugin_target plugin_target output_name) PREFIX "${_plugin_prefix}" SUFFIX "${_plugin_suffix}" LIBRARY_OUTPUT_DIRECTORY "${_plugin_library_output}" - RUNTIME_OUTPUT_DIRECTORY "${_plugin_runtime_output}" - ARCHIVE_OUTPUT_DIRECTORY "${_plugin_archive_output}" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" ) mapnik_install_plugin(${plugin_target}) endmacro() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8ee62a2e8..65e649228 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,17 +44,12 @@ endif() set_target_properties(mapnik PROPERTIES POSITION_INDEPENDENT_CODE ON - DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}" OUTPUT_NAME "mapnik" PREFIX "lib" IMPORT_PREFIX "lib" # for the archive on dll platforms VERSION ${MAPNIK_VERSION} # see https://github.com/mapnik/mapnik/pull/4248#issuecomment-925596509 => ABI compability only with the full version SOVERSION ${MAPNIK_VERSION} - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" ) if(MSVC) diff --git a/src/json/CMakeLists.txt b/src/json/CMakeLists.txt index 91ca4fbc0..4f64355fd 100644 --- a/src/json/CMakeLists.txt +++ b/src/json/CMakeLists.txt @@ -25,17 +25,12 @@ target_link_libraries(json PRIVATE mapnik::core ${ICUU_LIB}) set_target_properties(json PROPERTIES POSITION_INDEPENDENT_CODE ON - DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}" OUTPUT_NAME "mapnikjson" PREFIX "lib" IMPORT_PREFIX "lib" VERSION ${MAPNIK_VERSION} # see mapnik target for explanation SOVERSION ${MAPNIK_VERSION} - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" ) mapnik_install(json) diff --git a/src/wkt/CMakeLists.txt b/src/wkt/CMakeLists.txt index 54ca57f96..7507fd519 100644 --- a/src/wkt/CMakeLists.txt +++ b/src/wkt/CMakeLists.txt @@ -17,17 +17,12 @@ target_link_libraries(wkt PRIVATE mapnik::core) set_target_properties(wkt PROPERTIES POSITION_INDEPENDENT_CODE ON - DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}" OUTPUT_NAME "mapnikwkt" PREFIX "lib" IMPORT_PREFIX "lib" VERSION ${MAPNIK_VERSION} # see mapnik target for explanation SOVERSION ${MAPNIK_VERSION} - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" ) mapnik_install(wkt) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ecd612ed9..2e817e9fe 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -100,12 +100,7 @@ add_executable(mapnik-test-unit unit/vertex_adapter/transform_path_adapter.cpp unit/vertex_adapter/vertex_adapter.cpp ) -set_target_properties(mapnik-test-unit PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) + target_link_libraries(mapnik-test-unit PUBLIC Catch2::Catch2 mapnik::agg @@ -120,12 +115,6 @@ 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}") add_executable(agg_rasterizer_integer_overflow_test standalone/agg_rasterizer_integer_overflow_test.cpp) -set_target_properties(agg_rasterizer_integer_overflow_test PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) target_link_libraries(agg_rasterizer_integer_overflow_test PUBLIC Catch2::Catch2 mapnik::mapnik @@ -135,12 +124,6 @@ target_link_libraries(agg_rasterizer_integer_overflow_test PUBLIC 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 - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) target_link_libraries(datasource_registration_test PUBLIC Catch2::Catch2 mapnik::mapnik @@ -149,12 +132,6 @@ target_link_libraries(datasource_registration_test PUBLIC 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 - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) target_link_libraries(font_registration_test PUBLIC Catch2::Catch2 mapnik::mapnik @@ -164,12 +141,6 @@ target_link_libraries(font_registration_test PUBLIC target_include_directories(font_registration_test PRIVATE "${Catch2_SOURCE_DIR}/single_include/catch2" "${CMAKE_CURRENT_BINARY_DIR}") add_executable(map_xml_test standalone/map_xml_test.cpp) -set_target_properties(map_xml_test PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) target_link_libraries(map_xml_test PUBLIC Catch2::Catch2 mapnik::mapnik diff --git a/test/visual/CMakeLists.txt b/test/visual/CMakeLists.txt index 339dc6c6c..ee299bdfc 100644 --- a/test/visual/CMakeLists.txt +++ b/test/visual/CMakeLists.txt @@ -4,12 +4,6 @@ add_executable(mapnik-test-visual 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" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) target_link_libraries(mapnik-test-visual PRIVATE Catch2::Catch2 Boost::program_options diff --git a/utils/geometry_to_wkb/CMakeLists.txt b/utils/geometry_to_wkb/CMakeLists.txt index 9c67ddaaf..b2bf944ec 100644 --- a/utils/geometry_to_wkb/CMakeLists.txt +++ b/utils/geometry_to_wkb/CMakeLists.txt @@ -2,9 +2,4 @@ add_executable(geometry_to_wkb main.cpp) target_link_libraries(geometry_to_wkb PRIVATE mapnik::mapnik) -set_target_properties(geometry_to_wkb PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) - mapnik_install_utility(geometry_to_wkb) diff --git a/utils/mapnik-index/CMakeLists.txt b/utils/mapnik-index/CMakeLists.txt index 1a8eaef10..ab466247a 100644 --- a/utils/mapnik-index/CMakeLists.txt +++ b/utils/mapnik-index/CMakeLists.txt @@ -13,9 +13,4 @@ target_link_libraries(mapnik-index PRIVATE Boost::program_options ) -set_target_properties(mapnik-index PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) - mapnik_install_utility(mapnik-index) diff --git a/utils/mapnik-render/CMakeLists.txt b/utils/mapnik-render/CMakeLists.txt index 3b59e2d4f..5f5544b9c 100644 --- a/utils/mapnik-render/CMakeLists.txt +++ b/utils/mapnik-render/CMakeLists.txt @@ -7,9 +7,4 @@ target_link_libraries(mapnik-render PRIVATE Boost::program_options ) -set_target_properties(mapnik-render PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) - mapnik_install_utility(mapnik-render) diff --git a/utils/ogrindex/CMakeLists.txt b/utils/ogrindex/CMakeLists.txt index 69b2ba12b..92bc07350 100644 --- a/utils/ogrindex/CMakeLists.txt +++ b/utils/ogrindex/CMakeLists.txt @@ -2,9 +2,4 @@ add_executable(ogrindex ogrindex.cpp) target_link_libraries(ogrindex PRIVATE mapnik::mapnik) -set_target_properties(ogrindex PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) - mapnik_install_utility(ogrindex) diff --git a/utils/pgsql2sqlite/CMakeLists.txt b/utils/pgsql2sqlite/CMakeLists.txt index b3baddfcd..4f5185a6f 100644 --- a/utils/pgsql2sqlite/CMakeLists.txt +++ b/utils/pgsql2sqlite/CMakeLists.txt @@ -15,9 +15,4 @@ target_link_libraries(pgsql2sqlite PRIVATE mapnik::mapnik ) -set_target_properties(pgsql2sqlite PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) - mapnik_install_utility(pgsql2sqlite) diff --git a/utils/shapeindex/CMakeLists.txt b/utils/shapeindex/CMakeLists.txt index 4c8f0811c..59187d5b0 100644 --- a/utils/shapeindex/CMakeLists.txt +++ b/utils/shapeindex/CMakeLists.txt @@ -10,9 +10,4 @@ target_link_libraries(shapeindex PRIVATE mapnik::mapnik ) -set_target_properties(shapeindex PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) - mapnik_install_utility(shapeindex) diff --git a/utils/svg2png/CMakeLists.txt b/utils/svg2png/CMakeLists.txt index a4918272e..29cae3bf4 100644 --- a/utils/svg2png/CMakeLists.txt +++ b/utils/svg2png/CMakeLists.txt @@ -10,9 +10,4 @@ target_link_libraries(svg2png PRIVATE mapnik::agg ) -set_target_properties(svg2png PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" - MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" -) - mapnik_install_utility(svg2png)