fix config file naming scheme.

Only happens when using older cmake versions. But this was definitly an issue.
Target name should be the same on the file (case sensitive)
This commit is contained in:
Mathis Logemann 2021-07-21 20:03:42 +02:00
parent e5cf5dda39
commit 282986c503
3 changed files with 19 additions and 11 deletions

View file

@ -341,27 +341,35 @@ include(CMakePackageConfigHelpers)
# set the cmake targets install location
set(INCLUDE_INSTALL_DIR include/)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/MapnikConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/mapnikConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
list(JOIN MAPNIK_DEPENDENCIES "\n" MAPNIK_DEPENDENCIES)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/MapnikConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/MapnikConfig.cmake"
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/mapnikConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/mapnikConfig.cmake"
INSTALL_DESTINATION ${INSTALL_CMAKE_DIR}
PATH_VARS INCLUDE_INSTALL_DIR PLUGINS_INSTALL_DIR FONTS_INSTALL_DIR MAPNIK_DEPENDENCIES
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/MapnikConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/MapnikConfigVersion.cmake"
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/mapnikConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/mapnikConfigVersion.cmake"
DESTINATION ${INSTALL_CMAKE_DIR}
)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindCairo.cmake" DESTINATION ${INSTALL_CMAKE_DIR}/Modules)
install(
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindCairo.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindWebP.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindHarfBuzz.cmake"
DESTINATION ${INSTALL_CMAKE_DIR}/Modules
)
install(EXPORT MapnikTargets
FILE MapnikTargets.cmake
FILE mapnikTargets.cmake
NAMESPACE mapnik::
DESTINATION ${INSTALL_CMAKE_DIR}
)

View file

@ -10,6 +10,6 @@ include(CMakeFindDependencyMacro)
@MAPNIK_DEPENDENCIES@
include("${CMAKE_CURRENT_LIST_DIR}/MapnikTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/mapnikTargets.cmake")
check_required_components(mapnik)

View file

@ -28,7 +28,7 @@ find_package(mapnik CONFIG REQUIRED)
target_link_libraries(mytarget ... mapnik::core mapnik::mapnik)
```
All mapnik executables and targets are exported within `MapnikTargets.cmake`.
All mapnik executables and targets are exported within `mapnikTargets.cmake`.
The plugin dir is available in the variable `MAPNIK_PLUGINS_DIR`.
The font path is is available in the variable `MAPNIK_FONTS_DIR`.