mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-22 00:06:12 -05:00
[cmake] Use native find EXPAT logic
and switch to using target EXPAT::EXPAT
This commit is contained in:
parent
f67e339845
commit
173014016b
@ -361,7 +361,7 @@ if(WITH_CORE)
|
||||
find_package(Proj)
|
||||
find_package(GEOS)
|
||||
find_package(GDAL)
|
||||
find_package(Expat REQUIRED)
|
||||
find_package(EXPAT REQUIRED)
|
||||
find_package(Spatialindex REQUIRED)
|
||||
find_package(LibZip REQUIRED)
|
||||
|
||||
|
@ -1,57 +0,0 @@
|
||||
# Find Expat
|
||||
# ~~~~~~~~~~
|
||||
# Copyright (c) 2007, Martin Dobias <wonder.sk at gmail.com>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
# CMake module to search for Expat library
|
||||
# (library for parsing XML files)
|
||||
#
|
||||
# If it's found it sets EXPAT_FOUND to TRUE
|
||||
# and following variables are set:
|
||||
# EXPAT_INCLUDE_DIR
|
||||
# EXPAT_LIBRARY
|
||||
|
||||
# FIND_PATH and FIND_LIBRARY normally search standard locations
|
||||
# before the specified paths. To search non-standard paths first,
|
||||
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
|
||||
# and then again with no specified paths to search the default
|
||||
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
|
||||
# searching for the same item do nothing.
|
||||
FIND_PATH(EXPAT_INCLUDE_DIR expat.h
|
||||
"$ENV{LIB_DIR}/include/"
|
||||
"$ENV{LIB_DIR}/include/expat"
|
||||
c:/msys/local/include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
FIND_PATH(EXPAT_INCLUDE_DIR expat.h)
|
||||
#libexpat needed for msvc version
|
||||
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat PATHS
|
||||
"$ENV{LIB_DIR}/lib"
|
||||
c:/msys/local/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
|
||||
|
||||
IF (EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
|
||||
SET(EXPAT_FOUND TRUE)
|
||||
ENDIF (EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
|
||||
|
||||
|
||||
IF (EXPAT_FOUND)
|
||||
|
||||
IF (NOT EXPAT_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Expat: ${EXPAT_LIBRARY}")
|
||||
ENDIF (NOT EXPAT_FIND_QUIETLY)
|
||||
|
||||
ELSE (EXPAT_FOUND)
|
||||
|
||||
IF (EXPAT_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find Expat")
|
||||
ELSE (EXPAT_FIND_REQUIRED)
|
||||
IF (NOT EXPAT_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Could not find Expat")
|
||||
ENDIF (NOT EXPAT_FIND_QUIETLY)
|
||||
ENDIF (EXPAT_FIND_REQUIRED)
|
||||
|
||||
ENDIF (EXPAT_FOUND)
|
@ -2252,7 +2252,6 @@ target_include_directories(qgis_core SYSTEM PUBLIC
|
||||
${LIBZIP_INCLUDE_DIRS}
|
||||
${SPATIALINDEX_INCLUDE_DIR} # before GEOS for case-insensitive filesystems
|
||||
${GEOS_INCLUDE_DIR}
|
||||
${EXPAT_INCLUDE_DIR}
|
||||
${SQLITE3_INCLUDE_DIR}
|
||||
${QCA_INCLUDE_DIR}
|
||||
${QTKEYCHAIN_INCLUDE_DIR}
|
||||
@ -2421,7 +2420,7 @@ target_link_libraries(qgis_core
|
||||
${GEOS_LIBRARY}
|
||||
${GDAL_LIBRARY}
|
||||
${SPATIALINDEX_LIBRARY}
|
||||
${EXPAT_LIBRARY}
|
||||
EXPAT::EXPAT
|
||||
${SQLITE3_LIBRARY}
|
||||
${LIBZIP_LIBRARY}
|
||||
${Protobuf_LITE_LIBRARY}
|
||||
|
@ -34,7 +34,6 @@ add_library(provider_gpx MODULE ${GPX_SRCS})
|
||||
target_compile_features(provider_gpx PRIVATE cxx_std_17)
|
||||
|
||||
target_link_libraries(provider_gpx
|
||||
${EXPAT_LIBRARY}
|
||||
qgis_core
|
||||
)
|
||||
|
||||
|
@ -62,7 +62,6 @@ target_include_directories(provider_wfs_a PUBLIC
|
||||
)
|
||||
|
||||
target_link_libraries(provider_wfs_a
|
||||
${EXPAT_LIBRARY}
|
||||
qgis_core
|
||||
)
|
||||
|
||||
@ -120,7 +119,6 @@ else()
|
||||
target_compile_definitions(provider_wfs PRIVATE "-DQT_NO_FOREACH")
|
||||
|
||||
target_link_libraries (provider_wfs
|
||||
${EXPAT_LIBRARY}
|
||||
qgis_core
|
||||
)
|
||||
|
||||
|
@ -31,7 +31,6 @@ include_directories(SYSTEM
|
||||
${LIBZIP_INCLUDE_DIRS}
|
||||
${SPATIALINDEX_INCLUDE_DIR}
|
||||
${GEOS_INCLUDE_DIR}
|
||||
${EXPAT_INCLUDE_DIR}
|
||||
${QCA_INCLUDE_DIR}
|
||||
${QTKEYCHAIN_INCLUDE_DIR}
|
||||
)
|
||||
|
@ -33,7 +33,6 @@ include_directories(SYSTEM
|
||||
${LIBZIP_INCLUDE_DIRS}
|
||||
${SPATIALINDEX_INCLUDE_DIR}
|
||||
${GEOS_INCLUDE_DIR}
|
||||
${EXPAT_INCLUDE_DIR}
|
||||
${SQLITE3_INCLUDE_DIR}
|
||||
${QCA_INCLUDE_DIR}
|
||||
${QTKEYCHAIN_INCLUDE_DIR}
|
||||
|
@ -21,7 +21,6 @@ include_directories(SYSTEM
|
||||
${LIBZIP_INCLUDE_DIRS}
|
||||
${SPATIALINDEX_INCLUDE_DIR}
|
||||
${GDAL_INCLUDE_DIR}
|
||||
${EXPAT_INCLUDE_DIR}
|
||||
${QCA_INCLUDE_DIR}
|
||||
${QTKEYCHAIN_INCLUDE_DIR}
|
||||
)
|
||||
|
@ -26,7 +26,6 @@ include_directories(SYSTEM
|
||||
${LIBZIP_INCLUDE_DIRS}
|
||||
${SPATIALINDEX_INCLUDE_DIR}
|
||||
${GEOS_INCLUDE_DIR}
|
||||
${EXPAT_INCLUDE_DIR}
|
||||
${QCA_INCLUDE_DIR}
|
||||
${QTKEYCHAIN_INCLUDE_DIR}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user