From 7733c64aac546b627912b668e6500b0bd83cbf1b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 30 Jan 2024 09:49:41 -0800 Subject: [PATCH] build: add cmark-gfm-config to allow wiring up builds Enable wiring up builds with the staged image of cmark. The unified build no longer tries to use custom build handling and instead prefers the standard CMake usage. --- CMakeLists.txt | 9 +++++++-- cmark-gfm-config.cmake.in | 3 +++ extensions/CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 cmark-gfm-config.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index f653939fd..23eca3c50 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,11 @@ if(CMARK_FUZZ_QUADRATIC) add_subdirectory(fuzz) endif() -export(TARGETS libcmark-gfm libcmark-gfm-extensions - FILE cmark-gfmConfig.cmake) +include(CMakePackageConfigHelpers) +configure_package_config_file(cmark-gfm-config.cmake.in + ${CMAKE_BINARY_DIR}/cmake/modules/cmark-gfm-config.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) +install(FILES + ${CMAKE_BINARY_DIR}/cmake/modules/cmark-gfm-config.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) diff --git a/cmark-gfm-config.cmake.in b/cmark-gfm-config.cmake.in new file mode 100644 index 000000000..d60713ff2 --- /dev/null +++ b/cmark-gfm-config.cmake.in @@ -0,0 +1,3 @@ +@PACKAGE_INIT@ +include(${CMAKE_CURRENT_LIST_DIR}/cmark-gfm/cmark-gfm.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/cmark-gfm-extensions/cmark-gfm-extensions.cmake) diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index b30c5f5b5..6927790b0 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -33,4 +33,4 @@ install(FILES include/module.modulemap DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cmark_gfm_extensions) install(EXPORT cmark-gfm-extensions - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake-gfm-extensions) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cmark-gfm-extensions) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4c16041db..d27957d6e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -90,7 +90,7 @@ install(FILES install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcmark-gfm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) install(EXPORT cmark-gfm - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cmark-gfm) export(TARGETS libcmark-gfm FILE ${CMAKE_CURRENT_BINARY_DIR}/cmarkTargets.cmake)