Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #54640 from m-kuhn/fix_spatialite_no_pkgconf
Do not require pkgconfig
  • Loading branch information
m-kuhn committed Sep 18, 2023
2 parents 8f07c77 + 654bcac commit b14be57
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cmake/FindSpatiaLite.cmake
Expand Up @@ -7,16 +7,21 @@
# CMake module to search for SpatiaLite library
#
# If it's found it sets SPATIALITE_FOUND to TRUE
# and following variables are set:
# SPATIALITE_INCLUDE_DIR
# SPATIALITE_LIBRARY
# and adds the following target
#
# spatialite::spatialite

find_package(PkgConfig REQUIRED)
pkg_search_module(PC_SPATIALITE IMPORTED_TARGET spatialite)
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_search_module(PC_SPATIALITE IMPORTED_TARGET spatialite)
endif()

if(PC_SPATIALITE_FOUND)
add_library(spatialite::spatialite ALIAS PkgConfig::PC_SPATIALITE)
set(SPATIALITE_FOUND TRUE)
else()
# Fallback for systems without PkgConfig, e.g. OSGeo4W

# This macro checks if the symbol exists
include(CheckLibraryExists)

Expand Down

0 comments on commit b14be57

Please sign in to comment.