Skip to content
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

Seamless integration with FetchContent #51

Merged
merged 2 commits into from
Sep 8, 2022

Conversation

jngrad
Copy link
Contributor

@jngrad jngrad commented Sep 8, 2022

Allow populating the repa project in a parent project via the FetchContent method, which uses a common CMakeCache.txt file to manage the state of the parent project and all populated projects. Replace CMake relative paths by project-specific relative paths and add a prefix to the repa project options to avoid name collisions with the options of the parent project and the other populated projects.

When repa is included in a parent project via FetchContent,
CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR refer to the parent project,
while PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR still refer to repa.
When repa is included in a parent project via FetchContent, the
parent project options are inherited in the repa project, which
can lead to name conflicts. For example, the parent project may
want to build and run its own tests but none of the repa tests.
@jngrad
Copy link
Contributor Author

jngrad commented Sep 8, 2022

The reasons motivating the proposed changes are summarized in espressomd/espresso#4474 (comment). While we plan on namespacing the ESPResSo project options too, it doesn't fully resolves the issue of option name collisions, since populated projects can also conflict with one another. If the proposed changes are accepted in repa, the corresponding Spack installation script will need to be updated accordingly depending on the repa version.

@hirschsn
Copy link
Member

hirschsn commented Sep 8, 2022

Changes look good, thanks for the contribution

@hirschsn hirschsn merged commit ff050ad into SC-SGS:master Sep 8, 2022
@jngrad jngrad deleted the fetchcontent branch November 29, 2022 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants