Skip to content

♻️ Refactor CMake structure and replace submodules with FetchContent #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 4, 2024

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Jan 3, 2024

Description

This PR was triggered by

it replaces the use of git submodules (which always created problems and made things complicated) with FetchContent directives.
These directives are configured in a way that they first look for a system-installed version of the dependency (via the find_package(...) mechanism) and only fetch the dependency to build it from source when no installed version was found.
There are multiple ways to configure the overall process. Refer to the official CMake documentation: https://cmake.org/cmake/help/latest/module/FetchContent.html

This allows us to simplify quite some processes and also reduces the frequency of updates.
Furthermore, one can take advantage of system installed dependencies and can avoid the need to build these from scratch.

Once we raise our minimum required CMake version, the respective code can be simplified quite a bit.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

@burgholzer burgholzer added dependencies Pull requests that update a dependency file submodules Pull requests that update Submodules code refactor Anything related to code refactoring minor Minor version update labels Jan 3, 2024
@burgholzer burgholzer added this to the MQT Core milestone Jan 3, 2024
@burgholzer burgholzer self-assigned this Jan 3, 2024
@burgholzer burgholzer marked this pull request as ready for review January 4, 2024 12:32
@burgholzer burgholzer enabled auto-merge January 4, 2024 19:06
@burgholzer burgholzer merged commit 51804d5 into main Jan 4, 2024
@burgholzer burgholzer deleted the cmake-restructure branch January 4, 2024 19:19
burgholzer added a commit to munich-quantum-toolkit/qcec that referenced this pull request Jan 5, 2024
## Description

This PR was triggered by the failures in #349 and its purpose is to
better isolate the changes into separate PRs.
- munich-quantum-toolkit/core#515

has dropped the submodules in `mqt-core` and replaced them with
`FetchContent`. As such, the `googletest` test dependency is no longer
available at its typical location.
Consequently, this PR now also uses `FetchContent` to get `googletest`.
In a future PR, this will most likely be extended to the `mqt-core`
submodule as well.

This should unblock #349.

## 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 related to it.
- [x] I have added appropriate tests and documentation.
- [x] I have made sure that all CI jobs on GitHub pass.
- [x] The pull request introduces no new warnings and follows the
project's style guidelines.

---------

Signed-off-by: burgholzer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file minor Minor version update refactor Anything related to code refactoring submodules Pull requests that update Submodules code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant