diff options
author | Brad King <brad.king@kitware.com> | 2013-05-16 18:37:05 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-05-16 18:37:05 (GMT) |
commit | e778522161cf089bae58b16611d513a99ddcf3ef (patch) | |
tree | 153917c09c6f4524b8c7809a9499e084c90c9c63 | |
parent | d04e765d760b3f6c22062fd676240b497af496cc (diff) | |
parent | cd2d2480cc84c4d4b54cee76061e1aa5e57cb832 (diff) | |
download | CMake-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.cmake | 8 |
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 |