-
Notifications
You must be signed in to change notification settings - Fork 36
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
link to ecp components via cmake config targets #514
Conversation
@white238 , we're working to add a CMake config file for SCR. Once this is ready, it would be helpful if you can verify that it works. I also have a question for you. Some of the libraries that SCR uses, like DTCMP, are not CMake projects. Is there a standard practice for specifying those dependencies within our For example, could we do something like install our |
@mcfadden8 , here is the PR to add the https://github.com/LLNL/scr/blob/cmake-config/cmake/scrConfig.cmake.in This seems to be working for a test application, but I don't know whether I'm following good practice. In particular, I'm not clear on the best way to specify dependencies that are not cmake packages, like DTCMP. My current approach is to distribute (install) our module files like Lines 101 to 107 in 8a922aa
and then invoke those from the Lines 14 to 22 in 8a922aa
However, I just realized that the installed
Note that the above line has the full path to So maybe I don't need to call |
I think that leaving the |
Good point.
Not sure either. Perhaps coming through the sequence here: Lines 11 to 14 in fac5cab
Line 50 in 8a922aa
Line 85 in 8a922aa
CMake always feels like smoke and mirrors to me. |
Do we always need to set up TARGET_LINK_LIBRARIES by hand like this (ie. build a list of the libraries we have found and then append them? Doesn't cmake/Find_Library do this for you somehow? The absolute path being inserted in the installed scrTargets.cmake file. It is interesting that the full path for all of the other libraries does not seem to be placed there. |
I think what we want to wind up with is to somehow have a Then, we could have all of the |
I think we probably need both. Find_library locates the library, but it doesn't tell cmake which targets actually depend the library. Then we spell out the dependencies of each target with target_link_libraries.
The ecp components are added with entries like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the approach is reasonable. I approve.
Separately, I wonder if it would make sense to update the bootstrap script to check out the external libraries to an alternate location and use this functionality of cmake
to perform the build of the scr library? It may offer another way of continually testing the packaging functionality.
Thanks, @mcfadden8 . I'll take a look at the bootstrap script. I'll also look at adding an |
8a922aa
to
3c02300
Compare
This uses newly added cmake config files for specifying component dependencies.
As part of this PR, we'll also add a cmake config for SCR itself installed to
share/scr/cmake/scrConfig.cmake
, which will help with: #497. The goal is to enable an SCR application to compile and link by adding the following to the applicationCMakeLists.txt
file:and then build with:
For dependencies that are not cmake projects themselves, we can install cmake module files, like
FindDTCMP.cmake
. This will install a handful ofFind*.cmake
files along side thescrConfig.cmake
file. We then need to add the module path to the user'sCMAKE_MODULE_PATH
in thescrConfig.cmake
file, e.g.,:https://stackoverflow.com/questions/59674070/should-i-modify-cmake-module-path-in-packageconfig-cmake