-
Notifications
You must be signed in to change notification settings - Fork 661
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
Sma/rework cmake module #57
base: devel
Are you sure you want to change the base?
Conversation
Looks like this breaks compiling the combined package, at least the CI testing is not happy. Does the |
Arf! :( The "combined package" is building the whole repository, not just one of the 3 sub-projects, right? Note that I was not able to build dynamicEDT3D without having octomap installed in the sysroot beforehand (even before these patches). I suspect what is breaking the CI is the configure_file cleanup. I can resubmit a PR without renaming the *.cmake.in, and keeping the configure_file() calls. |
Yes, the combined package should compile like that: Also, in the end the CMakeConfigs should behave in the same way as |
Ok, here is the 2nd round ;) I keep the existing template for the build, this should not break the combined package build anymore (tested in native and cross-compilation here). |
Sorry to say, but this now breaks the behavior of the installed CMake config. Essentially you are reverting Fix #14 for the install target. Each generated In the commit you replace the referenced library and include paths with a dynamic lookup via find_library. If that is desired in code that relies in OctoMap then it can be done in the client library (or a FindOctomap.cmake module), as opposed to the exported config. To test, you can compile and install OctoMap into
Then run with Whereas installing the current devel or master version of OctoMap into tmp will return the correct paths:
And I can also explicitly switch to another version
|
Hi,
I'm not sure this is the right way of using CMake. I mean, AFAI understand the CMake doc, when one wants to use something from a location different from the defaults, one should add In the above use-case, if you do: |
hi, are you still interested in this change? regards, |
Hi tSed, I can accept the patch only if it does not break the existing behavior, which requires the fixed absolute paths to remain in the CMake configs. Pointing to the config with libraryname_DIR is the preferred mechanism in CMake, whereas the FIND_ROOT_PATH is used for dynamically finding libs from a client library, e.g. with a FindLibrary.cmake (which is typically used when there is no proper config available / exported). For the current PR to work in the use case I outlined above, users would have to export both octomap_DIR and the FIND_ROOT_PATH (and thus breaks in the default case). Instead, what about adding a flag such as |
dynamicEDT3D was the only subproject installing its CMake module files under lib/cmake/. This patch cleans this up, making dynamicEDT3D installation consistent with the octomap and octovis ones.
dynamicEDT3D was the only subproject naming its CMake module files <project name>Config.cmake. This patch cleans this up, using the <project name>-config.cmake pattern; so make dynamicEDT3D consistent with what is done for octomap and octovis.
Hardcoding absolute install paths in the CMake module files totally breaks the cross-compilation: it makes impossible to be used in a sysroot because the hardcoded paths are the ones of the target, whereas they should point to the sysroot location. This tootally breaks the CMake FIND_ROOT_PATH mechanism designed to handle cross-compilation. This patch introduces a new CMake variable: NO_ABSOLUTE_PATH_IN_MODULE, which, when set on the cmake command-line, will enable the installation of the CMake module files using the CMake primitives find_library and find_path to set the libraries and headers' locations, instead of hard-coding them. Thus, this patch adds non-templated CMake module files for octomap, dynamicEDT3D and octovis for the non hard-coded path version of the modules. In any way, only the installed CMake module files are changed. The templated ones are still needed for combined package build. The non hard-coded path version of the modules are only installed when NO_ABSOLUTE_PATH_IN_MODULE is set; by default the existing behavior remains unchanged to keep honoring the behavior described in [1]. [1] OctoMap#57 (comment)
Hi, For the use case you want to keep (and for which, I still not convinced), how do you do to get the Anyway, I think I'll do a new PR implementing the Regards, |
Yes, Using |
An efficient probabilistic 3D mapping framework based on octrees. Patching the build-system is required because the current upstream CMake modules installed hard-code the headers and libraries, which badly breaks the cross-compilation. Note that these patches are in the path to get merged upstream [1]. [1] OctoMap/octomap#57 Signed-off-by: Samuel Martin <[email protected]>
An efficient probabilistic 3D mapping framework based on octrees. Patching the build-system is required because the current upstream CMake modules installed hard-code the headers and libraries, which badly breaks the cross-compilation. Note that these patches are in the path to get merged upstream [1]. [1] OctoMap/octomap#57 Signed-off-by: Samuel Martin <[email protected]>
An efficient probabilistic 3D mapping framework based on octrees. Patching the build-system is required because the current upstream CMake modules installed hard-code the headers and libraries, which badly breaks the cross-compilation. Note that these patches are in the path to get merged upstream [1]. [1] OctoMap/octomap#57 Signed-off-by: Samuel Martin <[email protected]>
Hi,
Here is a short series reworking CMake module files.
It now uses CMake primitives instead of hard-coded (absolute) paths, which was badly breaking cross-compilation.
Regards,
Samuel