Merge topic 'fix-find_dependency-EXACT'

224f50f4 find_dependency: Make sure invalid EXACT use can be reported.
This commit is contained in:
Brad King 2014-03-12 10:13:13 -04:00 committed by CMake Topic Stage
commit 5082e31ba3
1 changed files with 3 additions and 3 deletions

View File

@ -31,6 +31,9 @@ macro(find_dependency dep)
if (NOT ${dep}_FOUND)
set(cmake_fd_version)
if (${ARGC} GREATER 1)
if (${ARGV1} STREQUAL EXACT)
message(FATAL_ERROR "Invalid arguments to find_dependency. EXACT may only be specified if a VERSION is specified")
endif()
set(cmake_fd_version ${ARGV1})
endif()
set(cmake_fd_exact_arg)
@ -38,9 +41,6 @@ macro(find_dependency dep)
if (NOT ${ARGV2} STREQUAL EXACT)
message(FATAL_ERROR "Invalid arguments to find_dependency")
endif()
if (NOT ${cmake_fd_version})
message(FATAL_ERROR "Invalid arguments to find_dependency. EXACT may only be specified if a VERSION is specified")
endif()
set(cmake_fd_exact_arg EXACT)
endif()
if(${ARGC} GREATER 3)