Skip to content

Commit 1392d1b

Browse files
authored
πŸ› Ensure spdlog dependency can be found from mqt-core install (#1263)
## Description This pull request updates the build system to improve how the `spdlog` dependency is handled, fixing problems unfortunately only discovered after the `v3.3.0` release yesterday. This also directly prepares a corresponding patch release. ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are focused and relevant to this change. - [x] I have added appropriate tests that cover the new/changed functionality. - [x] I have updated the documentation to reflect these changes. - [x] I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals. - [x] I have added migration instructions to the upgrade guide (if needed). - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Resolved spdlog discovery issues when consuming mqt-core via CMake. * Ensured correct installation path for bundled spdlog CMake files. * Treated spdlog headers as system includes to reduce build warnings. * Updated CMake config to explicitly locate spdlog during dependency resolution. * **Documentation** * Added 3.3.1 release entry with details of the spdlog fix and updated links. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: burgholzer <[email protected]>
1 parent a354ba3 commit 1392d1b

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ This project adheres to [Semantic Versioning], with the exception that minor rel
99

1010
## [Unreleased]
1111

12+
## [3.3.1] - 2025-10-14
13+
14+
### Fixed
15+
16+
- πŸ› Ensure `spdlog` dependency can be found from `mqt-core` install ([#1263]) ([**@burgholzer**])
17+
1218
## [3.3.0] - 2025-10-13
1319

1420
_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md#330)._
@@ -192,7 +198,8 @@ _πŸ“š Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
192198

193199
<!-- Version links -->
194200

195-
[unreleased]: https://github.com/munich-quantum-toolkit/core/compare/v3.3.0...HEAD
201+
[unreleased]: https://github.com/munich-quantum-toolkit/core/compare/v3.3.1...HEAD
202+
[3.3.1]: https://github.com/munich-quantum-toolkit/core/releases/tag/v3.3.1
196203
[3.3.0]: https://github.com/munich-quantum-toolkit/core/releases/tag/v3.3.0
197204
[3.2.1]: https://github.com/munich-quantum-toolkit/core/releases/tag/v3.2.1
198205
[3.2.0]: https://github.com/munich-quantum-toolkit/core/releases/tag/v3.2.0
@@ -204,6 +211,7 @@ _πŸ“š Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
204211

205212
<!-- PR links -->
206213

214+
[#1263]: https://github.com/munich-quantum-toolkit/core/pull/1263
207215
[#1247]: https://github.com/munich-quantum-toolkit/core/pull/1247
208216
[#1246]: https://github.com/munich-quantum-toolkit/core/pull/1246
209217
[#1236]: https://github.com/munich-quantum-toolkit/core/pull/1236

β€Žcmake/ExternalDependencies.cmakeβ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,28 @@ set(SPDLOG_VERSION
9797
set(SPDLOG_URL https://github.com/gabime/spdlog/archive/refs/tags/v${SPDLOG_VERSION}.tar.gz)
9898
# Add position independent code for spdlog, this is required for python bindings on linux
9999
set(SPDLOG_BUILD_PIC ON)
100+
set(SPDLOG_SYSTEM_INCLUDES
101+
ON
102+
CACHE INTERNAL "Treat the library headers like system headers")
100103
cmake_dependent_option(SPDLOG_INSTALL "Install spdlog library" ON "MQT_CORE_INSTALL" OFF)
101104
FetchContent_Declare(spdlog URL ${SPDLOG_URL} FIND_PACKAGE_ARGS ${SPDLOG_VERSION})
102105
list(APPEND FETCH_PACKAGES spdlog)
103106

104107
# Make all declared dependencies available.
105108
FetchContent_MakeAvailable(${FETCH_PACKAGES})
109+
110+
# Patch for spdlog cmake files to be installed in a common cmake directory
111+
if(SPDLOG_INSTALL)
112+
include(GNUInstallDirs)
113+
install(
114+
CODE "
115+
file(GLOB SPDLOG_CMAKE_FILES
116+
\"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/spdlog/*\")
117+
if(SPDLOG_CMAKE_FILES)
118+
file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/cmake/spdlog\")
119+
file(COPY \${SPDLOG_CMAKE_FILES}
120+
DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/cmake/spdlog\")
121+
file(REMOVE_RECURSE \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/spdlog\")
122+
endif()
123+
")
124+
endif()

β€Žcmake/mqt-core-config.cmake.inβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
1414

1515
include(CMakeFindDependencyMacro)
1616
find_dependency(nlohmann_json)
17-
17+
find_dependency(spdlog)
1818
find_dependency(qdmi)
1919

2020
option(MQT_CORE_WITH_GMP "Library is configured to use GMP" @MQT_CORE_WITH_GMP@)

0 commit comments

Comments
Β (0)