From: hobbes1069 Date: Tue, 30 Jun 2015 19:21:57 +0000 (+0000) Subject: Implement better way of dealing with native codebook generator when cross-compiling. X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=475a60cb455ef23f0b64508fcdab89aac61dd8f2;p=freetel-svn-tracking.git Implement better way of dealing with native codebook generator when cross-compiling. git-svn-id: https://svn.code.sf.net/p/freetel/code@2231 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/src/CMakeLists.txt b/codec2-dev/src/CMakeLists.txt index 206f9ee2..d72b91e9 100644 --- a/codec2-dev/src/CMakeLists.txt +++ b/codec2-dev/src/CMakeLists.txt @@ -89,12 +89,17 @@ set(CODEBOOKSMEL set(CODEBOOKSGE ${D}/gecb.txt) -# when crosscompiling import the executable targets from a file +# when crosscompiling we need a native executable if(CMAKE_CROSSCOMPILING) - set(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Point to the export file from a native build") - include(${IMPORT_EXECUTABLES}) - #add_executable(generate_codebook IMPORTED) - set_property(TARGET generate_codebook PROPERTY IMPORTED_LOCATION ${GENERATE_CODEBOOK}) + include(ExternalProject) + ExternalProject_Add(codec2_native + SOURCE_DIR ${CMAKE_SOURCE_DIR} + BUILD_COMMAND $(MAKE) generate_codebook + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy src/generate_codebook ${CMAKE_CURRENT_BINARY_DIR} + ) + add_executable(generate_codebook IMPORTED) + set_property(TARGET generate_codebook PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/generate_codebook) + else(CMAKE_CROSSCOMPILING) # Build code generator binaries. These do not get installed. # generate_codebook