mirror of
https://github.com/reactos/CMake.git
synced 2024-11-23 19:49:51 +00:00
Merge topic 'fix-find_dependency-empty-version'
a25b809f
Tests: Check find_dependency empty extra arguments9914e7cd
Merge branch 'fix-find_dependency-empty-version'34cd5fc4
find_dependency: Give more helpful message if VERSION is emptyd363cbf3
Tests: Make RunCMake.find_dependency tolerate line number changes
This commit is contained in:
commit
32b7d2ed8a
@ -31,14 +31,17 @@ macro(find_dependency dep)
|
||||
if (NOT ${dep}_FOUND)
|
||||
set(cmake_fd_version)
|
||||
if (${ARGC} GREATER 1)
|
||||
if (${ARGV1} STREQUAL EXACT)
|
||||
if ("${ARGV1}" STREQUAL "")
|
||||
message(FATAL_ERROR "Invalid arguments to find_dependency. VERSION is empty")
|
||||
endif()
|
||||
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)
|
||||
if(${ARGC} GREATER 2)
|
||||
if (NOT ${ARGV2} STREQUAL EXACT)
|
||||
if (NOT "${ARGV2}" STREQUAL EXACT)
|
||||
message(FATAL_ERROR "Invalid arguments to find_dependency")
|
||||
endif()
|
||||
set(cmake_fd_exact_arg EXACT)
|
||||
|
@ -1,4 +1,4 @@
|
||||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:35 \(message\):
|
||||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\):
|
||||
Invalid arguments to find_dependency. EXACT may only be specified if a
|
||||
VERSION is specified
|
||||
Call Stack \(most recent call first\):
|
||||
|
@ -1,5 +1,7 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(EXACT-no-version)
|
||||
run_cmake(empty-version)
|
||||
run_cmake(empty-arg-3)
|
||||
run_cmake(invalid-arg-3)
|
||||
run_cmake(extra-args)
|
||||
|
1
Tests/RunCMake/find_dependency/empty-arg-3-result.txt
Normal file
1
Tests/RunCMake/find_dependency/empty-arg-3-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
5
Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt
Normal file
5
Tests/RunCMake/find_dependency/empty-arg-3-stderr.txt
Normal file
@ -0,0 +1,5 @@
|
||||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\):
|
||||
Invalid arguments to find_dependency
|
||||
Call Stack \(most recent call first\):
|
||||
empty-arg-3.cmake:4 \(find_dependency\)
|
||||
CMakeLists.txt:4 \(include\)
|
4
Tests/RunCMake/find_dependency/empty-arg-3.cmake
Normal file
4
Tests/RunCMake/find_dependency/empty-arg-3.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(Pack1 1.2 "")
|
1
Tests/RunCMake/find_dependency/empty-version-result.txt
Normal file
1
Tests/RunCMake/find_dependency/empty-version-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
5
Tests/RunCMake/find_dependency/empty-version-stderr.txt
Normal file
5
Tests/RunCMake/find_dependency/empty-version-stderr.txt
Normal file
@ -0,0 +1,5 @@
|
||||
CMake Error at .*/Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\):
|
||||
Invalid arguments to find_dependency. VERSION is empty
|
||||
Call Stack \(most recent call first\):
|
||||
empty-version.cmake:4 \(find_dependency\)
|
||||
CMakeLists.txt:4 \(include\)
|
4
Tests/RunCMake/find_dependency/empty-version.cmake
Normal file
4
Tests/RunCMake/find_dependency/empty-version.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(Pack1 "")
|
@ -1,4 +1,4 @@
|
||||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:47 \(message\):
|
||||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\):
|
||||
Invalid arguments to find_dependency
|
||||
Call Stack \(most recent call first\):
|
||||
extra-args.cmake:4 \(find_dependency\)
|
||||
|
@ -1,4 +1,4 @@
|
||||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:42 \(message\):
|
||||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:[0-9]+ \(message\):
|
||||
Invalid arguments to find_dependency
|
||||
Call Stack \(most recent call first\):
|
||||
invalid-arg-3.cmake:4 \(find_dependency\)
|
||||
|
Loading…
Reference in New Issue
Block a user