<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
(3)<br>
Use execute_process() to run the CMake command line tool and configure the<br>
host-only project during the configuration step of the main project.  This<br>
will make the results of the export() command from the subproject available<br>
for loading by the main project.  Then add a custom target to drive the<br>
subproject build during the main project build using &quot;cmake --build&quot;.<font color="#888888"><br></font></blockquote><div><br>I tried using that method with a minor change: I&#39;m launching the generated native<br>
executable from the native project, so I don&#39;t have to export / include any target.<br><br>So I just had to replace:<br><br>subdirs(c68k)<br><br>with:<br><br>file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c68k)<br>execute_process(COMMAND cmake ${CMAKE_CURRENT_SOURCE_DIR}/c68k<br>
    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c68k)<br>add_custom_target(c68kinc COMMAND cmake --build ${CMAKE_CURRENT_BINARY_DIR}/c68k)<br><br> </div></div>It does run the configuration and build step at the right time, but for some reason<br>
it detects the cross-compiler instead of the native one ; it almost looks like the<br>sub-porjects inherits some values from the &quot;parent&quot; project despite being run from<br>a separate CMake process.<br><br>Guillaume<br>
<br>