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:
parent
7cbab17871
commit
5878c5d919
|
@ -29,9 +29,7 @@
|
|||
|
||||
macro(find_dependency dep)
|
||||
if (NOT ${dep}_FOUND)
|
||||
if (${ARGV1})
|
||||
set(version ${ARGV1})
|
||||
endif()
|
||||
set(version ${ARGV1})
|
||||
set(exact_arg)
|
||||
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT)
|
||||
set(exact_arg EXACT)
|
||||
|
|
Loading…
Reference in New Issue