[CMake] building host tools during cross compiliations (was: dependencies of cross compiliations)

Brad King brad.king at kitware.com
Tue Nov 27 07:01:36 EST 2018


On 11/27/18 5:28 AM, Rolf Eike Beer wrote:
> Then I came up with:
> 
>    add_host_build("relative source dir" "build dir" [VARS])
> 
> This would create an entirely new CMake scope (with it's own 
> CMakeCache.txt and the like) in "${CMAKE_CURRENT_BUILD_DIR}/build dir", 
> and would not take the CMAKE_TOOLCHAIN_FILE into account.
[snip]
> My idea would be that things added by add_executable() inside such a
> sub-build are visible as targets from the outer build.

For reference, some projects are already using the ExternalProject
module to approximate that approach and bring in the host tools as
imported executable targets.  The actual host build is viewed as
a custom target from the cross-compiled project.

-Brad


More information about the CMake mailing list