Always set version variable of find_dependency macro

If there is no ARGV1, that is fine; version will be made empty, and no
version will be passed to find_package().

This is relevant when find_dependency is invoked multiple times,
sometimes with a version specified and sometimes without.

 find_dependency(dep1 3.4)
 find_dependency(dep2) # version still set to 3.4.
This commit is contained in:
Alex Merry 2014-02-22 13:35:14 +00:00 committed by Stephen Kelly
parent 7cbab17871
commit 5878c5d919
1 changed files with 1 additions and 3 deletions

View File

@ -29,9 +29,7 @@
macro(find_dependency dep)
if (NOT ${dep}_FOUND)
if (${ARGV1})
set(version ${ARGV1})
endif()
set(exact_arg)
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT)
set(exact_arg EXACT)