Skip to content

Adjusted relative paths of CMakeLists.txt#524

Open
JanNiklasB wants to merge 15 commits intoCRPropa:masterfrom
JanNiklasB:master
Open

Adjusted relative paths of CMakeLists.txt#524
JanNiklasB wants to merge 15 commits intoCRPropa:masterfrom
JanNiklasB:master

Conversation

@JanNiklasB
Copy link
Contributor

Hi,

as mentioned in issue #523 when including CRPropa over add_subdirectory in other projects, the relative paths are not pointing to the correct folders.

To better support CRPropas behavior when included elsewhere, I changed all relative paths to the correct absolute paths utilizing CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR respectively.

I also added a new cache variable for CRPROPA_EXTRA_INCLUDES so the include paths can be used on the above levels (I do not know how to hide this from the user if possible).

@JanNiklasB
Copy link
Contributor Author

Here is a short example where the problem might occur when using the CRPropa:master instead of JanNiklasB:master:

https://gist.github.com/JanNiklasB/ca187681f446d323bdc773c425d2e57f

The issue is that when CRPropa is compiled as subproject, the main project can not find the includes of the crpropa subproject (like for example KISS), since those are first added to the usual include folder in the install step which is never done during FetchContent.
The solution is to add all CRPROPA_EXTRA_INCLUDES as hidden cache variable (with mark_as_advanced) so the main project can include those as well.

@JanNiklasB
Copy link
Contributor Author

I merged the newest master and took the opportunity to make some other small changes.

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.

1 participant