Skip to content
Snippets Groups Projects
Commit 224f50f4 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

find_dependency: Make sure invalid EXACT use can be reported.

Test the first argument directly for matching 'EXACT'. The error
check in its previous position was incorrect and would only trigger
with a version of '0' or similar.
parent 29d4f6b0
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment