summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt12
-rw-r--r--gr-atsc/src/lib/CMakeLists.txt7
-rw-r--r--gr-vocoder/lib/codec2/CMakeLists.txt10
3 files changed, 25 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2536a9731..ddd51f8d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,18 @@ LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
INCLUDE(GrVersion) #setup version info
########################################################################
+# Import executables from a native build (for cross compiling)
+# http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build
+########################################################################
+IF(IMPORT_EXECUTABLES)
+ INCLUDE(${IMPORT_EXECUTABLES})
+ENDIF(IMPORT_EXECUTABLES)
+
+#set file that the native build will fill with exports
+SET(EXPORT_FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake)
+FILE(WRITE ${EXPORT_FILE}) #blank the file (subdirs will append)
+
+########################################################################
# Compiler specific setup
########################################################################
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
diff --git a/gr-atsc/src/lib/CMakeLists.txt b/gr-atsc/src/lib/CMakeLists.txt
index 9b03d48dc..da104e465 100644
--- a/gr-atsc/src/lib/CMakeLists.txt
+++ b/gr-atsc/src/lib/CMakeLists.txt
@@ -31,8 +31,13 @@ LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
########################################################################
# Generate viterbi mux source
+# http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build
########################################################################
-ADD_EXECUTABLE(atsci_viterbi_gen atsci_viterbi_gen.cc)
+IF(NOT CMAKE_CROSSCOMPILING)
+ ADD_EXECUTABLE(atsci_viterbi_gen atsci_viterbi_gen.cc)
+ EXPORT(TARGETS atsci_viterbi_gen APPEND FILE ${EXPORT_FILE})
+ENDIF()
+
SET(atsci_viterbi_mux_cc ${CMAKE_CURRENT_BINARY_DIR}/atsci_viterbi_mux.cc)
diff --git a/gr-vocoder/lib/codec2/CMakeLists.txt b/gr-vocoder/lib/codec2/CMakeLists.txt
index 2b8273d16..3a666fb59 100644
--- a/gr-vocoder/lib/codec2/CMakeLists.txt
+++ b/gr-vocoder/lib/codec2/CMakeLists.txt
@@ -19,10 +19,14 @@
########################################################################
# Create executable to generate other sources
+# http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build
########################################################################
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-ADD_EXECUTABLE(generate_codebook ${CMAKE_CURRENT_SOURCE_DIR}/generate_codebook.c)
-TARGET_LINK_LIBRARIES(generate_codebook -lm)
+IF(NOT CMAKE_CROSSCOMPILING)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+ ADD_EXECUTABLE(generate_codebook ${CMAKE_CURRENT_SOURCE_DIR}/generate_codebook.c)
+ TARGET_LINK_LIBRARIES(generate_codebook -lm)
+ EXPORT(TARGETS generate_codebook APPEND FILE ${EXPORT_FILE})
+ENDIF()
########################################################################
# Create codebook