Skip to content

correct a path in the ElementalConfig.cmake.in file#235

Merged
poulson merged 2 commits intoelemental:masterfrom
trb413:fix-cmake-config
Aug 3, 2017
Merged

correct a path in the ElementalConfig.cmake.in file#235
poulson merged 2 commits intoelemental:masterfrom
trb413:fix-cmake-config

Conversation

@trb413
Copy link
Copy Markdown

@trb413 trb413 commented Aug 3, 2017

Both ElementalConfig.cmake and ElementalTargets.cmake are installed to ${INSTALL_CMAKE_DIR}/elemental. This is now reflected in the include() in the ElementalConfig.cmake.in file.

Also, these .cmake files will not work in the build directory. Unless someone has a more pressing need than I, I'll get to this in a later effort.

@poulson
Copy link
Copy Markdown
Member

poulson commented Aug 3, 2017

Thank you for this fix! Before I merge, would you mind clarifying your last statement that "these .cmake files will not work in the build directory"? Are you saying that something used to work and no longer does with this change?

@trb413
Copy link
Copy Markdown
Author

trb413 commented Aug 3, 2017

Sorry for the lack of clarity! No, the .cmake files would not have worked in the build directory anyway, with or without my change.

Some packages that build with CMake want to support users who never "install", they only "build". Thus, they might use something like this CMake module to create one set of "PackageNameConfig.cmake" files in the build directory and a different set in the install directory, if the install ever happens. For an example of this, see this code in the MFEM library.

All I was saying was that the ElementalConfig.cmake and ElementalTargets.cmake files that get written to the Elemental build directory are not directly useable to import Elemental from its build directory -- an install must be done. If this is your intent, that's totally fine, too, and nothing else need be done. I just discovered this when I tried to pass Elemental_DIR=/path/to/elemental/build and the CMake of the other project failed. With this fix, passing Elemental_DIR=/path/to/elemental/install works fine.

@trb413
Copy link
Copy Markdown
Author

trb413 commented Aug 3, 2017

Ok so I took my own advice and looked at what I had done in MFEM. CMAKE_CURRENT_LIST_DIR is the variable that makes this stuff work in both the build and the install directory. It was a super simple change, so I did that. Still an issue with the include directories if importing from the build directory.

@poulson
Copy link
Copy Markdown
Member

poulson commented Aug 3, 2017

Thank you very much for clarifying! (And for taking the time to contribute the fix!)

@poulson poulson merged commit 25ca05b into elemental:master Aug 3, 2017
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.

3 participants