<div dir="ltr">I am try to follow instructions at "<span style="color:rgb(0,0,0);font-family:sans-serif;line-height:19.044445037841797px">Using executables in the build created during the build" from the site</span> "<a href="http://www.vtk.org/Wiki/CMake_Cross_Compiling">http://www.vtk.org/Wiki/CMake_Cross_Compiling</a>";<div>
<pre style="padding:1em;border:1px dashed rgb(47,111,171);color:rgb(0,0,0);background-color:rgb(249,249,249);line-height:1.1em"># when crosscompiling import the executable targets from a file
IF(CMAKE_CROSSCOMPILING)
SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Point it to the export file from a native build")
INCLUDE(${IMPORT_EXECUTABLES})
ENDIF(CMAKE_CROSSCOMPILING)
...
# only build the generator if not crosscompiling
IF(NOT CMAKE_CROSSCOMPILING)
ADD_EXECUTABLE(mygenerator mygen.cpp)
TARGET_LINK_LIBRARIES(mygenerator ${SOME_LIBS})
ENDIF(NOT CMAKE_CROSSCOMPILING)
# then use the target name as COMMAND, CMake >= 2.6 knows how to handle this
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.c
COMMAND mygenerator foo.dat -o ${CMAKE_CURRENT_BINARY_DIR}/generated.c
DEPENDS foo.dat )
...
# export the generator target to a file, so it can be imported (see above) by another build
# the IF() is not necessary, but makes the intention clearer
IF(NOT CMAKE_CROSSCOMPILING)
EXPORT(TARGETS mygenerator FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake )
ENDIF(NOT CMAKE_CROSSCOMPILING)
</pre><div><br></div><div>however; i fail on the "INCLUDE(${IMPORT_EXECUTABLES}" since the file "IMPORTFILE-NOTFOUND" isn't found!!!</div><div><br></div><div>i suspect this happens since the CMAKE_CROSSCOMPILING gets processed before the Native (NOT CMAKE_CROSSCOMPILING) part;</div>
<div><br></div><div>i am using CMake 2.8; any ideas?</div><div><br><div><br></div><div><br clear="all"><div><br></div>-- <br>Rami<br> Tel. 4-865-6245<br> Pele. 54-8159949<br> e-mail. <a href="mailto:sramij@gmail.com">sramij@gmail.com</a><br>
</div></div></div></div>