-
Notifications
You must be signed in to change notification settings - Fork 280
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
Don't set NO_CMAKE_FIND_ROOT_PATH in find_xxx #379
Comments
At the moment you have to set CMAKE_PREFIX_PATH to the absolute path (/path/to/machine/sysroot/path/to/ros;/path/to/native/sysroot/path/to/ros) but normally it should only contain the local prefix (/path/to/ros) and the system root paths (/path/to/machine/sysroot; /path/to/native/sysroot) are passed via CMAKE_FIND_ROOT_PATH. This allows the cross compiler framework to install cross compiled libraries and headers into the machine system root and binaries and scripts into the native system root. Additionally the cross compiler framework installs the CMake files into the correspondent system root. |
Can you point to docs that we can read more about the best practices? On Wed, Mar 13, 2013 at 3:43 AM, herbrechtsmeier
|
At first you could take a look at the http://www.vtk.org/Wiki/CMake_Cross_Compiling but OpenEmbedded (Yocto) have simplify the usage of executables in the build process. They first build all buildtool_depends as native version and install them into a native sysroot. As next they cross compile all depends and install all header, libraries and CMake files into the cross sysroot. The native sysroot is append to the cross sysroot in the |
@tfoote This is the common cmake configuration of yocto: http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/cmake.bbclass |
All paths in the CMake files should be generated by the find_xxx macro and don't set NO_CMAKE_FIND_ROOT_PATH outside of the develspace. This allows the CMake files to work with different DESTDIR (sysroots) for programs and libraries. pkgConfig.cmake.in:
Example (genpy-extras.cmake.em):
|
Most other packages in ROS (e.g. genmsg, gencpp, etc.) explicitly don't use By now catkin generates output which should be completely relocatable and supports using DESTDIR during (isolated) compilation. Is there any other specific use case which currently does not work? |
Without any specific feedback this can not be acted on. I will close it for now and mark it "wontfix". Please feel free to provide further information and the ticket might be reopened. |
Don't set NO_CMAKE_FIND_ROOT_PATH in find_xxx functions to enable the cross compiler to set the system roots to the target system root and host system root. Additionally don't assume that the CMAKE_PREFIX_PATH contains absolute paths (IS_DIRECTORY) as they are relative to a system root.
The text was updated successfully, but these errors were encountered: