Do not require pkgconfig

This commit is contained in:
Matthias Kuhn 2023-09-18 10:23:09 +02:00
parent f67e339845
commit 1b5794302d

View File

@ -7,15 +7,18 @@
# 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()
# This macro checks if the symbol exists
include(CheckLibraryExists)