summaryrefslogtreecommitdiff
path: root/Modules/CMakeFindDependencyMacro.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-02-24 18:59:11 +0100
committerStephen Kelly <steveire@gmail.com>2014-02-24 19:00:42 +0100
commit2be6dbe4207cda39b479e7c81d172d49dd67cc38 (patch)
treeb33b878df9c366f7070ad1291c3289b40bfad47f /Modules/CMakeFindDependencyMacro.cmake
parenta35ce7235b94ce040b605d87ee326e8d354a5ecb (diff)
downloadcmake-2be6dbe4207cda39b479e7c81d172d49dd67cc38.tar.gz
find_dependency: Ensure that ARGV1 has valid local content
The ARGV1 value could come from a wrapping context if find_dependency is called from a function.
Diffstat (limited to 'Modules/CMakeFindDependencyMacro.cmake')
-rw-r--r--Modules/CMakeFindDependencyMacro.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake
index 142130dcf5..08c4990c2a 100644
--- a/Modules/CMakeFindDependencyMacro.cmake
+++ b/Modules/CMakeFindDependencyMacro.cmake
@@ -29,7 +29,10 @@
macro(find_dependency dep)
if (NOT ${dep}_FOUND)
- set(cmake_fd_version ${ARGV1})
+ 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(cmake_fd_exact_arg EXACT)