You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modifications to allow Serialbox to be used in CMake superbuild projects (#201)
This PR allows Serialbox to be used in CMake superbuild projects,
so that one could have code like
```
add_subdirectory( serialbox2 ) # --> will set "Serialbox_DIR" in cache
add_subdirectory( project_using_serialbox )
```
and within `project_using_serialbox` we have
```
find_package( Serialbox ) # --> will use Serialbox_DIR as default hint
```
Most issues were related to use of `${CMAKE_BINARY_DIR}` and `${CMAKE_SOURCE_DIR}` which reflect the top-level CMake project rather than `${PROJECT_BINARY_DIR}` and `${PROJECT_SOURCE_DIR}` which reflect the most recent project.
As a result it could be that certain products are no longer in a previously expected directory now, as I am not able to test everything
---
Moreover in this PR I have created alias targets (if possible) `Serialbox::Serialbox_C` and `Serialbox::Serialbox_Fortran` that prefer the shared versions `Serialbox::SerialboxCShared` and `Serialbox::SerialboxFortranShared` over the static versions `Serialbox::SerialboxCStatic` and `Serialbox::SerialboxFortranStatic`
In the client software you can then just use the alias target instead.
0 commit comments