diff options
author | Brad King <brad.king@kitware.com> | 2014-03-11 13:13:54 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-03-11 13:13:54 (GMT) |
commit | dfcacecd18d0cf26c4a4318eb4ce5901b90eee69 (patch) | |
tree | 8072ea77653806cd9d44decc22164e2b7314f262 /Modules | |
parent | a2d63a9d04cede727ffedcc38ce1c1e8df0c7945 (diff) | |
parent | 08ba128f51c94e3e905d45cc36c6fb21d020df56 (diff) | |
download | CMake-dfcacecd18d0cf26c4a4318eb4ce5901b90eee69.zip CMake-dfcacecd18d0cf26c4a4318eb4ce5901b90eee69.tar.gz CMake-dfcacecd18d0cf26c4a4318eb4ce5901b90eee69.tar.bz2 |
Merge topic 'fix-find_dependency-EXACT'
08ba128f find_dependency: Don't propagate EXACT argument.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeFindDependencyMacro.cmake | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake index 9334ba3..8c61516 100644 --- a/Modules/CMakeFindDependencyMacro.cmake +++ b/Modules/CMakeFindDependencyMacro.cmake @@ -4,7 +4,7 @@ # # :: # -# find_dependency(<dep> [<version>]) +# find_dependency(<dep> [<version> [EXACT]]) # # # ``find_dependency()`` wraps a :command:`find_package` call for a package @@ -34,9 +34,18 @@ macro(find_dependency dep) set(cmake_fd_version ${ARGV1}) endif() set(cmake_fd_exact_arg) - if(${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT) + if(${ARGC} GREATER 2) + if (NOT ${ARGV2} STREQUAL EXACT) + message(FATAL_ERROR "Invalid arguments to find_dependency") + endif() + if (NOT ${cmake_fd_version}) + message(FATAL_ERROR "Invalid arguments to find_dependency. EXACT may only be specified if a VERSION is specified") + endif() set(cmake_fd_exact_arg EXACT) endif() + if(${ARGC} GREATER 3) + message(FATAL_ERROR "Invalid arguments to find_dependency") + endif() set(cmake_fd_quiet_arg) if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) set(cmake_fd_quiet_arg QUIET) |