Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ clients compiled against a different minor or major version.

## [Unreleased]

### Changed

- 🚸 Export _all_ device headers (incl. `constants.h`) into device implementation ([#325]) ([\@ystade])

## [1.2.1] - 2025-12-22

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md#121)._
Expand Down Expand Up @@ -112,6 +116,7 @@ changelogs._

<!-- PR links -->

[#325]: https://github.com/Munich-Quantum-Software-Stack/QDMI/pull/325
[#285]: https://github.com/Munich-Quantum-Software-Stack/QDMI/pull/285
[#275]: https://github.com/Munich-Quantum-Software-Stack/QDMI/pull/275
[#274]: https://github.com/Munich-Quantum-Software-Stack/QDMI/pull/274
Expand Down
13 changes: 5 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ set(PROJECT_VERSION_FULL "${PROJECT_VERSION}${PROJECT_VERSION_PRERELEASE}")
# enable organization of targets into folders
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

include(CMakeDependentOption)

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
Expand All @@ -52,14 +54,9 @@ option(
"Use an installed version of QDMI to build examples, templates, and tests"
OFF)

if(USE_INSTALLED_QDMI)
set(QDMI_INSTALL
OFF
CACHE BOOL "Generate installation instructions for QDMI" FORCE)
else()
option(QDMI_INSTALL "Generate installation instructions for QDMI"
${QDMI_MASTER_PROJECT})
endif()
cmake_dependent_option(
QDMI_INSTALL "Generate installation instructions for QDMI"
${QDMI_MASTER_PROJECT} "NOT USE_INSTALLED_QDMI" OFF)
option(BUILD_QDMI_TESTS "Also build tests for the QDMI project"
${QDMI_MASTER_PROJECT})
option(BUILD_QDMI_EXAMPLES "Also build examples for the QDMI project"
Expand Down
6 changes: 3 additions & 3 deletions cmake/PrefixHandling.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function(generate_prefixed_qdmi_headers prefix)
endif()

# Get the list of all QDMI device headers.
file(GLOB_RECURSE QDMI_DEVICE_HEADERS ${QDMI_INCLUDE_DIR}/qdmi/device.h
${QDMI_INCLUDE_DIR}/qdmi/types.h)
file(GLOB_RECURSE QDMI_DEVICE_HEADERS ${QDMI_INCLUDE_DIR}/qdmi/constants.h
${QDMI_INCLUDE_DIR}/qdmi/device.h ${QDMI_INCLUDE_DIR}/qdmi/types.h)

# Determine the correct CMake directory for prefix_defs.txt
set(QDMI_PREFIX_DIR "${QDMI_CMAKE_DIR}")
Expand All @@ -55,7 +55,7 @@ function(generate_prefixed_qdmi_headers prefix)
# Replace the include for the device header with the prefixed version.
string(
REGEX
REPLACE "#include (\"|<)qdmi/(device|types).h(\"|>)"
REPLACE "#include (\"|<)qdmi/(constants|device|types).h(\"|>)"
"#include \\1${QDMI_prefix}_qdmi/\\2.h\\3" header_content
"${header_content}")
# Replace the prefix definitions.
Expand Down
2 changes: 1 addition & 1 deletion examples/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ enable_language(CXX)
# change. Hence, in the test you have to adopt the name of the shared library
# accordingly.
add_library(cxx_device SHARED device.cpp)
target_link_libraries(cxx_device PRIVATE qdmi::qdmi qdmi::qdmi_project_warnings)
target_link_libraries(cxx_device PRIVATE qdmi::qdmi_project_warnings)
generate_prefixed_qdmi_headers("CXX")
target_include_directories(cxx_device
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include)
Expand Down
Loading