summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Bramini <30959007+carlo-bramini@users.noreply.github.com>2022-01-20 21:03:36 +0100
committerGitHub <noreply@github.com>2022-01-20 21:03:36 +0100
commit1e1b52be2d9e1d2e0c3c1cb106eb7c6071747bac (patch)
treeb967e125944477415a5ca0a7f14350e39c24d741
parent57c7da69b78e3698e112a6b5da19d5109b8232d1 (diff)
downloadlibexpat-git-1e1b52be2d9e1d2e0c3c1cb106eb7c6071747bac.tar.gz
[>=2.3.0] Autotools: Fix broken CMake support under Cygwin (#546)
Autotools: Fix broken CMake support under Cygwin
-rw-r--r--expat/cmake/autotools/expat-noconfig__windows.cmake.in4
-rw-r--r--expat/configure.ac10
2 files changed, 11 insertions, 3 deletions
diff --git a/expat/cmake/autotools/expat-noconfig__windows.cmake.in b/expat/cmake/autotools/expat-noconfig__windows.cmake.in
index 78e1430b..cbed0ec9 100644
--- a/expat/cmake/autotools/expat-noconfig__windows.cmake.in
+++ b/expat/cmake/autotools/expat-noconfig__windows.cmake.in
@@ -9,11 +9,11 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
set_target_properties(expat::expat PROPERTIES
IMPORTED_IMPLIB_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a"
- IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/libexpat-@SO_MAJOR@.dll"
+ IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/@CMAKE_SHARED_LIBRARY_PREFIX@expat-@SO_MAJOR@.dll"
)
list(APPEND _IMPORT_CHECK_TARGETS expat::expat )
-list(APPEND _IMPORT_CHECK_FILES_FOR_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a" "${_IMPORT_PREFIX}/bin/libexpat-@SO_MAJOR@.dll" )
+list(APPEND _IMPORT_CHECK_FILES_FOR_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a" "${_IMPORT_PREFIX}/bin/@CMAKE_SHARED_LIBRARY_PREFIX@expat-@SO_MAJOR@.dll" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
diff --git a/expat/configure.ac b/expat/configure.ac
index c285a2b6..9ce54f1d 100644
--- a/expat/configure.ac
+++ b/expat/configure.ac
@@ -395,9 +395,17 @@ AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
+dnl Emulate the use of CMAKE_SHARED_LIBRARY_PREFIX under CMake
+AC_MSG_CHECKING([for shared library name prefix])
+AS_CASE("${host_os}",
+ [cygwin*], [CMAKE_SHARED_LIBRARY_PREFIX=cyg],
+ [CMAKE_SHARED_LIBRARY_PREFIX=lib])
+AC_MSG_RESULT([${CMAKE_SHARED_LIBRARY_PREFIX}])
+AC_SUBST([CMAKE_SHARED_LIBRARY_PREFIX])
+
AS_CASE("${host_os}",
[darwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in],
- [mingw*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in],
+ [mingw*|cygwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in],
[CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in])
AC_CONFIG_FILES([Makefile]
[expat.pc]