Make g2o headers relocatable by using build/install placeholders #390
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I've made some changes in the CMakeLists of g2o and I though it could be interesting to share it.
First I've set output directory to the BUILD_DIR instead of g2o_SOURCE_DIR.
Then I've updated most of the g2o modules headers to be relocatable (in a modern cmake way) by using placeholders. Before headers paths was hard-coded in the generated
g2oTargets.cmake
, and with this modification path are relatives to the install path.Example with
stuff
modulebefore:
after:
the
${_IMPORT_PREFIX}
is automatically generated by CMake and is relative to the install directory.I think this is much more convenient to deal with transitive dependencies (when using for example ORB_SLAM2, OpenVSLAM, etc...).
I didn't check all the corner-case of g2o library, so let my know if there is anything wrong with this PR.