Skip to content

Instantly share code, notes, and snippets.

@trondeau
Created February 16, 2016 19:25
Show Gist options
  • Save trondeau/04d6e4ac30b5656aaae1 to your computer and use it in GitHub Desktop.
Save trondeau/04d6e4ac30b5656aaae1 to your computer and use it in GitHub Desktop.
FindThrift.cmake from gnuradio maint
diff --git a/cmake/Modules/FindThrift.cmake b/cmake/Modules/FindThrift.cmake
index 4702f90..e5a8df1 100644
--- a/cmake/Modules/FindThrift.cmake
+++ b/cmake/Modules/FindThrift.cmake
@@ -34,7 +34,11 @@ FIND_LIBRARY(THRIFT_LIBRARIES
)
# Get the thrift binary to build our files during cmake
-FIND_PROGRAM(THRIFT_BIN thrift)
+if (CMAKE_CROSSCOMPILING)
+ FIND_PROGRAM(THRIFT_BIN thrift NO_CMAKE_FIND_ROOT_PATH)
+else (CMAKE_CROSSCOMPILING)
+ FIND_PROGRAM(THRIFT_BIN thrift)
+endif(CMAKE_CROSSCOMPILING)
# Use binary to get version string and test against THRIFT_REQ_VERSION
EXECUTE_PROCESS(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment