Test error cases in find_dependency.
This commit is contained in:
parent
b801205dad
commit
f74a8405b6
|
@ -49,6 +49,7 @@ add_RunCMake_test(GeneratorToolset)
|
|||
add_RunCMake_test(TargetPropertyGeneratorExpressions)
|
||||
add_RunCMake_test(Languages)
|
||||
add_RunCMake_test(ObjectLibrary)
|
||||
add_RunCMake_test(find_dependency)
|
||||
if(NOT WIN32)
|
||||
add_RunCMake_test(PositionIndependentCode)
|
||||
set(SKIP_VISIBILITY 0)
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.8.4)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
include(${RunCMake_TEST}.cmake)
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1,6 @@
|
|||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:35 \(message\):
|
||||
Invalid arguments to find_dependency. EXACT may only be specified if a
|
||||
VERSION is specified
|
||||
Call Stack \(most recent call first\):
|
||||
EXACT-no-version.cmake:4 \(find_dependency\)
|
||||
CMakeLists.txt:4 \(include\)
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(Pack1 EXACT)
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
add_library(Pack1::Lib INTERFACE IMPORTED)
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
set(PACKAGE_VERSION "1.3")
|
||||
|
||||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
|
@ -0,0 +1,5 @@
|
|||
include(RunCMake)
|
||||
|
||||
run_cmake(EXACT-no-version)
|
||||
run_cmake(invalid-arg-3)
|
||||
run_cmake(extra-args)
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1,5 @@
|
|||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:47 \(message\):
|
||||
Invalid arguments to find_dependency
|
||||
Call Stack \(most recent call first\):
|
||||
extra-args.cmake:4 \(find_dependency\)
|
||||
CMakeLists.txt:4 \(include\)
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(Pack1 1.2 EXACT PATHS "${CMAKE_BINARY_DIR}")
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1,5 @@
|
|||
CMake Error at .*Modules/CMakeFindDependencyMacro.cmake:42 \(message\):
|
||||
Invalid arguments to find_dependency
|
||||
Call Stack \(most recent call first\):
|
||||
invalid-arg-3.cmake:4 \(find_dependency\)
|
||||
CMakeLists.txt:4 \(include\)
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(Pack1 1.2 EXACTYPO)
|
Loading…
Reference in New Issue