summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/cmake/cmake/0001-FindCUDA-Use-find_program-if-find_host_program-is-no.patch
blob: 9b820db00963176be7000bbd2f815c3a8aed9c0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 46d25e782ebd9b6c50771b6f30433c58fae03a51 Mon Sep 17 00:00:00 2001
From: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
Date: Mon, 26 Jun 2017 11:30:07 -0400
Subject: [PATCH] cmake: Use find_program if find_host_program is not
 available

CMake does not define the `find_host_program` command we've been using
in the cross-compiling code path.  It was provided by a widely used
Android toolchain file.  For compatibility, continue to use
`find_host_program` if available, but otherwise use just `find_program`.

Upstream-Status: Accepted
[https://gitlab.kitware.com/cmake/cmake/merge_requests/1009]
        - Will be in 3.10

Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
---
 Modules/FindCUDA.cmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index a4dca54..77ca351 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -679,7 +679,11 @@ if(CMAKE_CROSSCOMPILING)
   # add known CUDA targetr root path to the set of directories we search for programs, libraries and headers
   set( CMAKE_FIND_ROOT_PATH "${CUDA_TOOLKIT_TARGET_DIR};${CMAKE_FIND_ROOT_PATH}")
   macro( cuda_find_host_program )
-    find_host_program( ${ARGN} )
+    if (COMMAND find_host_program)
+      find_host_program( ${ARGN} )
+    else()
+      find_program( ${ARGN} )
+    endif()
   endmacro()
 else()
   # for non-cross-compile, find_host_program == find_program and CUDA_TOOLKIT_TARGET_DIR == CUDA_TOOLKIT_ROOT_DIR
--
2.1.4