summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-05-16 18:37:05 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-05-16 18:37:05 (GMT)
commite778522161cf089bae58b16611d513a99ddcf3ef (patch)
tree153917c09c6f4524b8c7809a9499e084c90c9c63
parentd04e765d760b3f6c22062fd676240b497af496cc (diff)
parentcd2d2480cc84c4d4b54cee76061e1aa5e57cb832 (diff)
downloadCMake-e778522161cf089bae58b16611d513a99ddcf3ef.zip
CMake-e778522161cf089bae58b16611d513a99ddcf3ef.tar.gz
CMake-e778522161cf089bae58b16611d513a99ddcf3ef.tar.bz2
Merge topic 'cuda_compute_build_path'
cd2d248 FindCUDA: CUDA_COMPUTE_BUILD_PATH uses relative paths to binary dir.
-rw-r--r--Modules/FindCUDA.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 423ad3d..8248624 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -920,7 +920,13 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
if (IS_ABSOLUTE "${bpath}")
# Absolute paths are generally unnessary, especially if something like
# file(GLOB_RECURSE) is used to pick up the files.
- file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}")
+
+ string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos)
+ if (_binary_dir_pos EQUAL 0)
+ file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}")
+ else()
+ file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}")
+ endif()
endif()
# This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the