summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeFindDependencyMacro.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-06 14:03:42 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-06 14:07:37 (GMT)
commit08ba128f51c94e3e905d45cc36c6fb21d020df56 (patch)
tree69bacad0f6cfb48893007efa1f66ba12f7ab8ddb /Modules/CMakeFindDependencyMacro.cmake
parent948d5d18fd6deed24ede54cb0e3b017511f99559 (diff)
downloadCMake-08ba128f51c94e3e905d45cc36c6fb21d020df56.zip
CMake-08ba128f51c94e3e905d45cc36c6fb21d020df56.tar.gz
CMake-08ba128f51c94e3e905d45cc36c6fb21d020df56.tar.bz2
find_dependency: Don't propagate EXACT argument.
If a package is requested with an EXACT version, that doesn't imply that dependencies must be found EXACTly too. Extend the macro to allow specifying that a dependency must be found by EXACT version instead.
Diffstat (limited to 'Modules/CMakeFindDependencyMacro.cmake')
-rw-r--r--Modules/CMakeFindDependencyMacro.cmake13
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)