diff options
author | Alex Merry <kde@randomguy3.me.uk> | 2014-02-22 13:35:14 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-02-23 10:31:30 (GMT) |
commit | 5878c5d919a206b9a54f48f386ab98b5cff09e08 (patch) | |
tree | 6a82bf33a808c4a1abf99a39ba131d607b7fcb61 /Modules/CMakeFindDependencyMacro.cmake | |
parent | 7cbab178718de26575fe98144e7e388b2f6735a6 (diff) | |
download | CMake-5878c5d919a206b9a54f48f386ab98b5cff09e08.zip CMake-5878c5d919a206b9a54f48f386ab98b5cff09e08.tar.gz CMake-5878c5d919a206b9a54f48f386ab98b5cff09e08.tar.bz2 |
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.
Diffstat (limited to 'Modules/CMakeFindDependencyMacro.cmake')
-rw-r--r-- | Modules/CMakeFindDependencyMacro.cmake | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake index 0f1f56d..c0a0ef7 100644 --- a/Modules/CMakeFindDependencyMacro.cmake +++ b/Modules/CMakeFindDependencyMacro.cmake @@ -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) |