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 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers