summaryrefslogtreecommitdiff
path: root/Modules/CMakeFindDependencyMacro.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-11 14:49:30 +0100
committerStephen Kelly <steveire@gmail.com>2014-03-11 14:51:06 +0100
commit224f50f42f8776e4742851daca32846d1041fbb9 (patch)
treecd48a8a765a2641a0174a386435f9cfd4a8af2ff /Modules/CMakeFindDependencyMacro.cmake
parent29d4f6b03b9ed9fc82e1ffa1e99b070b5dff3046 (diff)
downloadcmake-224f50f42f8776e4742851daca32846d1041fbb9.tar.gz
find_dependency: Make sure invalid EXACT use can be reported.
Test the first argument directly for matching 'EXACT'. The error check in its previous position was incorrect and would only trigger with a version of '0' or similar.
Diffstat (limited to 'Modules/CMakeFindDependencyMacro.cmake')
-rw-r--r--Modules/CMakeFindDependencyMacro.cmake6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake
index 8c615166c8..99ffca80cd 100644
--- a/Modules/CMakeFindDependencyMacro.cmake
+++ b/Modules/CMakeFindDependencyMacro.cmake
@@ -31,6 +31,9 @@ macro(find_dependency dep)
if (NOT ${dep}_FOUND)
set(cmake_fd_version)
if (${ARGC} GREATER 1)
+ if (${ARGV1} STREQUAL EXACT)
+ message(FATAL_ERROR "Invalid arguments to find_dependency. EXACT may only be specified if a VERSION is specified")
+ endif()
set(cmake_fd_version ${ARGV1})
endif()
set(cmake_fd_exact_arg)
@@ -38,9 +41,6 @@ macro(find_dependency dep)
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)