> (3)
> Use execute_process() to run the CMake command line tool and configure the
> host-only project during the configuration step of the main project. This
> will make the results of the export() command from the subproject available
> for loading by the main project. Then add a custom target to drive the
> subproject build during the main project build using "cmake --build".
>
I tried using that method with a minor change: I'm launching the generated
native
executable from the native project, so I don't have to export / include any
target.
So I just had to replace:
subdirs(c68k)
with:
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c68k)
execute_process(COMMAND cmake ${CMAKE_CURRENT_SOURCE_DIR}/c68k
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c68k)
add_custom_target(c68kinc COMMAND cmake --build
${CMAKE_CURRENT_BINARY_DIR}/c68k)
It does run the configuration and build step at the right time, but for some
reason
it detects the cross-compiler instead of the native one ; it almost looks
like the
sub-porjects inherits some values from the "parent" project despite being
run from
a separate CMake process.
Guillaume
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake