summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--expat/CMakeLists.txt33
-rw-r--r--expat/Changes6
-rw-r--r--expat/Makefile.am1
-rw-r--r--expat/expat.pc.cmake11
4 files changed, 39 insertions, 12 deletions
diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt
index ae9cdb69..18a9c052 100644
--- a/expat/CMakeLists.txt
+++ b/expat/CMakeLists.txt
@@ -423,24 +423,37 @@ expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL
# pkg-config file
#
if(EXPAT_BUILD_PKGCONFIG)
- set(prefix ${CMAKE_INSTALL_PREFIX})
- set(exec_prefix "\${prefix}")
- set(_EXPAT_LIBRARY_NAME "expat${CMAKE_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}")
-
if(CMAKE_INSTALL_LIBDIR MATCHES "^/")
- set(libdir "${CMAKE_INSTALL_LIBDIR}")
+ set(_expat_pkgconfig_libdir "${CMAKE_INSTALL_LIBDIR}")
else()
- set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
+ set(_expat_pkgconfig_libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
endif()
if(CMAKE_INSTALL_INCLUDEDIR MATCHES "^/")
- set(includedir "${CMAKE_INSTALL_INCLUDEDIR}")
+ set(_expat_pkgconfig_includedir "${CMAKE_INSTALL_INCLUDEDIR}")
else()
- set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+ set(_expat_pkgconfig_includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()
- configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY)
- expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ set_target_properties(expat PROPERTIES
+ pkgconfig_prefix "${CMAKE_INSTALL_PREFIX}"
+ pkgconfig_exec_prefix "\${prefix}"
+ pkgconfig_libdir "${_expat_pkgconfig_libdir}"
+ pkgconfig_includedir "${_expat_pkgconfig_includedir}"
+ pkgconfig_version "${PACKAGE_VERSION}")
+
+ foreach(_build_type ${CMAKE_BUILD_TYPE} Debug Release RelWithDebInfo MinSizeRel)
+ string(TOLOWER "${_build_type}" _build_type_lower)
+ string(TOUPPER "${_build_type}" _build_type_upper)
+ set_property(TARGET expat PROPERTY "pkgconfig_${_build_type_lower}_name" "expat${CMAKE_${_build_type_upper}_POSTFIX}")
+ endforeach()
+
+ file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/expat.pc
+ INPUT ${PROJECT_SOURCE_DIR}/expat.pc.cmake
+ TARGET expat)
+
+ expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
#
diff --git a/expat/Changes b/expat/Changes
index 42bae977..ed0f4f2b 100644
--- a/expat/Changes
+++ b/expat/Changes
@@ -7,10 +7,12 @@ Release 2.4.2 xxx xxx xx xxxx
#497 Autotools: Include files with release archives:
- buildconf.sh
- fuzz/*.c
- #495 CMake: MinGW: Fix pkg-config section "Libs" for non-release
- build types (e.g. -DCMAKE_BUILD_TYPE=Debug)
+ #495 CMake: MinGW: Fix pkg-config section "Libs" for
+ - non-release build types (e.g. -DCMAKE_BUILD_TYPE=Debug)
+ - multi-config CMake generators (e.g. Ninja Multi-Config)
Special thanks to:
+ Joergen Ibsen
Kai Pastor
Release 2.4.1 Sun May 23 2021
diff --git a/expat/Makefile.am b/expat/Makefile.am
index 4ff5c8ab..e6e7971e 100644
--- a/expat/Makefile.am
+++ b/expat/Makefile.am
@@ -75,6 +75,7 @@ _EXTRA_DIST_CMAKE = \
CMakeLists.txt \
CMake.README \
ConfigureChecks.cmake \
+ expat.pc.cmake \
expat_config.h.cmake
_EXTRA_DIST_WINDOWS = \
diff --git a/expat/expat.pc.cmake b/expat/expat.pc.cmake
new file mode 100644
index 00000000..89a401af
--- /dev/null
+++ b/expat/expat.pc.cmake
@@ -0,0 +1,11 @@
+prefix=$<TARGET_PROPERTY:pkgconfig_prefix>
+exec_prefix=$<TARGET_PROPERTY:pkgconfig_exec_prefix>
+libdir=$<TARGET_PROPERTY:pkgconfig_libdir>
+includedir=$<TARGET_PROPERTY:pkgconfig_includedir>
+
+Name: $<TARGET_PROPERTY:pkgconfig_$<LOWER_CASE:$<CONFIG>>_name>
+Version: $<TARGET_PROPERTY:pkgconfig_version>
+Description: expat XML parser
+URL: https://libexpat.github.io/
+Libs: -L${libdir} -l$<TARGET_PROPERTY:pkgconfig_$<LOWER_CASE:$<CONFIG>>_name>
+Cflags: -I${includedir}