diff --git a/.github/workflows/autotools-cmake.yml b/.github/workflows/autotools-cmake.yml index 060518ad..75e03024 100644 --- a/.github/workflows/autotools-cmake.yml +++ b/.github/workflows/autotools-cmake.yml @@ -125,6 +125,20 @@ jobs: cd expat/expat-*.*.*/ if [[ "${{ runner.os }}" == macOS ]]; then + # There is a known difference between Autotools and CMake for macOS: + # Autotools: + # - /usr/local/lib123/libexpat..dylib + # - /usr/local/lib123/libexpat.dylib + # CMake: + # - /usr/local/lib123/libexpat....dylib + # - /usr/local/lib123/libexpat..dylib + # - /usr/local/lib123/libexpat.dylib + # We patch the CMake side in line here to get the differ below to empty. + ( cd build_cmake/ROOT/usr/local/lib*/cmake/expat-*/ \ + && sed -E 's,(libexpat\.[0-9]+)\.[0-9]+\.[0-9]+(\.dylib),\1\2,' expat-noconfig.cmake > expat-noconfig-patched.cmake \ + && ! diff -u0 expat-noconfig{,-patched}.cmake \ + && mv expat-noconfig{-patched,}.cmake ) + # Autotools' LT_LIB_M has a hardcoded exclude for "*-*-darwin*" hosts, # while macOS does have libm and is successfully found by CMake. # We patch the CMake side in line here to get the differ below to empty. diff --git a/expat/cmake/autotools/expat-noconfig__macos.cmake.in b/expat/cmake/autotools/expat-noconfig__macos.cmake.in index bb48d981..484e5bc6 100644 --- a/expat/cmake/autotools/expat-noconfig__macos.cmake.in +++ b/expat/cmake/autotools/expat-noconfig__macos.cmake.in @@ -8,12 +8,12 @@ set(CMAKE_IMPORT_FILE_VERSION 1) # Import target "expat::expat" for configuration "NoConfig" set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) set_target_properties(expat::expat PROPERTIES - IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@.dylib" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.dylib" IMPORTED_SONAME_NOCONFIG "@rpath/libexpat.@SO_MAJOR@.dylib" ) list(APPEND _cmake_import_check_targets expat::expat ) -list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@.dylib" ) +list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.dylib" ) # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION)