diff options
author | Brad King <brad.king@kitware.com> | 2014-02-25 16:18:11 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-02-25 16:18:11 (GMT) |
commit | 602be01b3397175b9b94e76496220666b58106b0 (patch) | |
tree | 424ef4576737a448cd0b9a584c7e95493b010973 /Modules/CMakeFindDependencyMacro.cmake | |
parent | cd8c797a8592cfae1894c5b81c70e011c1dd9490 (diff) | |
parent | 2be6dbe4207cda39b479e7c81d172d49dd67cc38 (diff) | |
download | CMake-602be01b3397175b9b94e76496220666b58106b0.zip CMake-602be01b3397175b9b94e76496220666b58106b0.tar.gz CMake-602be01b3397175b9b94e76496220666b58106b0.tar.bz2 |
Merge topic 'fix-find_dependency-macro'
2be6dbe4 find_dependency: Ensure that ARGV1 has valid local content
a35ce723 find_dependency: Add namespacing for variables in the macro.
Diffstat (limited to 'Modules/CMakeFindDependencyMacro.cmake')
-rw-r--r-- | Modules/CMakeFindDependencyMacro.cmake | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake index c0a0ef7..08c4990 100644 --- a/Modules/CMakeFindDependencyMacro.cmake +++ b/Modules/CMakeFindDependencyMacro.cmake @@ -29,27 +29,34 @@ macro(find_dependency dep) if (NOT ${dep}_FOUND) - set(version ${ARGV1}) - set(exact_arg) + set(cmake_fd_version) + if (${ARGC} GREATER 1) + set(cmake_fd_version ${ARGV1}) + endif() + set(cmake_fd_exact_arg) if(${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT) - set(exact_arg EXACT) + set(cmake_fd_exact_arg EXACT) endif() - set(quiet_arg) + set(cmake_fd_quiet_arg) if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) - set(quiet_arg QUIET) + set(cmake_fd_quiet_arg QUIET) endif() - set(required_arg) + set(cmake_fd_required_arg) if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED) - set(required_arg REQUIRED) + set(cmake_fd_required_arg REQUIRED) endif() - get_property(alreadyTransitive GLOBAL PROPERTY + get_property(cmake_fd_alreadyTransitive GLOBAL PROPERTY _CMAKE_${dep}_TRANSITIVE_DEPENDENCY ) - find_package(${dep} ${version} ${exact_arg} ${quiet_arg} ${required_arg}) + find_package(${dep} ${version} + ${cmake_fd_exact_arg} + ${cmake_fd_quiet_arg} + ${cmake_fd_required_arg} + ) - if(NOT DEFINED alreadyTransitive OR alreadyTransitive) + if(NOT DEFINED cmake_fd_alreadyTransitive OR cmake_fd_alreadyTransitive) set_property(GLOBAL PROPERTY _CMAKE_${dep}_TRANSITIVE_DEPENDENCY TRUE) endif() @@ -58,8 +65,8 @@ macro(find_dependency dep) set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False) return() endif() - set(required_arg) - set(quiet_arg) - set(exact_arg) + set(cmake_fd_required_arg) + set(cmake_fd_quiet_arg) + set(cmake_fd_exact_arg) endif() endmacro() |