Misc CMake build improvements - #608
Open
LeSpocky wants to merge 3 commits into
Open
Conversation
In certain cross build environments CMAKE_FIND_ROOT_PATH is set globally for all CMake packages. For example in ptxdist CMAKE_FIND_ROOT_PATH is set to the cross-compiling sysroot and OpENer failed to find the buildsupport directory. Because PROJECT_SOURCE_DIR is an absolute path anyway, buildsupport dir is found now regardless if CMAKE_FIND_ROOT_PATH is set (cross-build) or not (usual build). Signed-off-by: Alexander Dahl <ada@thorsis.com>
CMAKE_INSTALL_FULL_BINDIR is not set anywhere, it is sufficient to install to CMAKE_INSTALL_BINDIR which is usually set to just 'bin'. CMake recommends to NOT use absolute pathes with install. If not messing with CMAKE_INSTALL_PREFIX files end up in /usr/bin where one would expect it anyways. Fixes: 46737eb ("Fix that if BINDIR is empty CMake does not fail") Signed-off-by: Alexander Dahl <ada@thorsis.com>
The OpENer executable is linked against SAMPLE_APP so that library must be installed, otherwise the installed OpENer binary won't find all required libraries and refuses to start. Signed-off-by: Alexander Dahl <ada@thorsis.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When trying to package OpENer for a PTXdist based embedded Board Support Package (BSP), some issues with the CMake build came up. Commit message should explain in detail, but some additional notes on the patches here.
find_path()with a path inside the project. This would involve some more magic with the cmake modules for different platforms based onOpENer_PLATFORM, but in principle you could also do this, avoiding any find_path pitfalls:CMAKE_INSTALL_BINDIRyou could just use the standard CMake module GNUInstallDirs, at least on Linux, where it sets all the install paths to reasonable defaults.