diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-02-24 17:59:11 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-02-24 18:00:42 (GMT) |
commit | 2be6dbe4207cda39b479e7c81d172d49dd67cc38 (patch) | |
tree | b33b878df9c366f7070ad1291c3289b40bfad47f | |
parent | a35ce7235b94ce040b605d87ee326e8d354a5ecb (diff) | |
download | CMake-2be6dbe4207cda39b479e7c81d172d49dd67cc38.zip CMake-2be6dbe4207cda39b479e7c81d172d49dd67cc38.tar.gz CMake-2be6dbe4207cda39b479e7c81d172d49dd67cc38.tar.bz2 |
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.
-rw-r--r-- | Modules/CMakeFindDependencyMacro.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake index 142130d..08c4990 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) |