diff --git a/CMakeLists.txt b/CMakeLists.txt index 1267e4fcf..c36d9f7ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ message(STATUS "mapnik version: ${PROJECT_VERSION}") # https://cliutils.gitlab.io/modern-cmake/chapters/features/ides.html set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL ON) # with newer cmake versions put all find_package in global scope set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(FeatureSummary) include(MapnikOption) @@ -132,6 +133,7 @@ set(MAPNIK_OPTIONAL_LIBS_INCLUDE "") # Begin project configuration # needs to be before the first call of find_boost. +list(APPEND MAPNIK_COMPILE_DEFS BOOST_SPIRIT_X3_HIDE_CXX17_WARNING) if(USE_MULTITHREADED) set(Boost_USE_MULTITHREADED ON) list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_THREADSAFE) diff --git a/plugins/input/pgraster/CMakeLists.txt b/plugins/input/pgraster/CMakeLists.txt index 7458a4420..e75370c28 100644 --- a/plugins/input/pgraster/CMakeLists.txt +++ b/plugins/input/pgraster/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(PostgreSQL REQUIRED) +mapnik_find_package(PostgreSQL REQUIRED) add_plugin_target(input-pgraster "pgraster") target_sources(input-pgraster ${_plugin_visibility} diff --git a/plugins/input/postgis/CMakeLists.txt b/plugins/input/postgis/CMakeLists.txt index 93346d6e4..7eaae3402 100644 --- a/plugins/input/postgis/CMakeLists.txt +++ b/plugins/input/postgis/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(PostgreSQL REQUIRED) +mapnik_find_package(PostgreSQL REQUIRED) add_plugin_target(input-postgis "postgis") target_sources(input-postgis ${_plugin_visibility} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d1c98cc08..191524ae6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ -find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS program_options) -find_package(PostgreSQL REQUIRED) +mapnik_find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS program_options) +mapnik_find_package(PostgreSQL REQUIRED) include(FetchContent) @@ -163,7 +163,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}") -#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) set_target_properties(map_xml_test PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}" diff --git a/utils/pgsql2sqlite/CMakeLists.txt b/utils/pgsql2sqlite/CMakeLists.txt index b5264ae60..9b7c929fe 100644 --- a/utils/pgsql2sqlite/CMakeLists.txt +++ b/utils/pgsql2sqlite/CMakeLists.txt @@ -1,6 +1,6 @@ -find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS program_options) -find_package(SQLite3 REQUIRED) -find_package(PostgreSQL REQUIRED) +mapnik_find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS program_options) +mapnik_find_package(SQLite3 REQUIRED) +mapnik_find_package(PostgreSQL REQUIRED) add_executable(pgsql2sqlite main.cpp