diff options
author | Maxime Roussin-BĂ©langer <maxime.roussinbelanger@gmail.com> | 2017-06-26 15:30:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-06-26 17:10:54 (GMT) |
commit | 46d25e782ebd9b6c50771b6f30433c58fae03a51 (patch) | |
tree | 51d84474419e58939972740b15a4d469dca35179 | |
parent | 6c363f5cafe2bfeecd07887d9151e91042810e3f (diff) | |
download | CMake-46d25e782ebd9b6c50771b6f30433c58fae03a51.zip CMake-46d25e782ebd9b6c50771b6f30433c58fae03a51.tar.gz CMake-46d25e782ebd9b6c50771b6f30433c58fae03a51.tar.bz2 |
FindCUDA: 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`.
Fixes: #16509
-rw-r--r-- | Modules/FindCUDA.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
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 |