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.
This commit is contained in:
Stephen Kelly 2014-02-24 18:59:11 +01:00
parent a35ce7235b
commit 2be6dbe420
1 changed files with 4 additions and 1 deletions

View File

@ -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)