blob: 9b820db00963176be7000bbd2f815c3a8aed9c0a [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 46d25e782ebd9b6c50771b6f30433c58fae03a51 Mon Sep 17 00:00:00 2001
2From: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
3Date: Mon, 26 Jun 2017 11:30:07 -0400
4Subject: [PATCH] cmake: Use find_program if find_host_program is not
5 available
6
7CMake does not define the `find_host_program` command we've been using
8in the cross-compiling code path. It was provided by a widely used
9Android toolchain file. For compatibility, continue to use
10`find_host_program` if available, but otherwise use just `find_program`.
11
12Upstream-Status: Accepted
13[https://gitlab.kitware.com/cmake/cmake/merge_requests/1009]
14 - Will be in 3.10
15
16Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
17---
18 Modules/FindCUDA.cmake | 6 +++++-
19 1 file changed, 5 insertions(+), 1 deletion(-)
20
21diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
22index a4dca54..77ca351 100644
23--- a/Modules/FindCUDA.cmake
24+++ b/Modules/FindCUDA.cmake
25@@ -679,7 +679,11 @@ if(CMAKE_CROSSCOMPILING)
26 # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers
27 set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}")
28 macro( cuda_find_host_program )
29- find_host_program( ${ARGN} )
30+ if (COMMAND find_host_program)
31+ find_host_program( ${ARGN} )
32+ else()
33+ find_program( ${ARGN} )
34+ endif()
35 endmacro()
36 else()
37 # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR
38--
392.1.4
40