Merge topic 'fix-find_package-version-file-error-stack'
62126b67
Merge branch 'test-cmake_policy-unmatched' into fix-find_package-version-file-error-stack2e28c619
cmState: Skip variable scope snapshots to avoid call stack duplicatesb219ff94
Tests: Add case for package version file unmatched policy scope
This commit is contained in:
commit
99533c8e34
|
@ -1156,7 +1156,8 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const
|
|||
|
||||
Snapshot snapshot;
|
||||
PositionType parentPos = this->Position;
|
||||
while(parentPos->SnapshotType == cmState::PolicyScopeType)
|
||||
while (parentPos->SnapshotType == cmState::PolicyScopeType ||
|
||||
parentPos->SnapshotType == cmState::VariableScopeType)
|
||||
{
|
||||
++parentPos;
|
||||
}
|
||||
|
@ -1167,7 +1168,8 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const
|
|||
}
|
||||
|
||||
++parentPos;
|
||||
while(parentPos->SnapshotType == cmState::PolicyScopeType)
|
||||
while (parentPos->SnapshotType == cmState::PolicyScopeType ||
|
||||
parentPos->SnapshotType == cmState::VariableScopeType)
|
||||
{
|
||||
++parentPos;
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1,5 @@
|
|||
^CMake Error at PolicyPop/PolicyPopConfigVersion.cmake:3 \(cmake_policy\):
|
||||
cmake_policy POP without matching PUSH
|
||||
Call Stack \(most recent call first\):
|
||||
PolicyPop.cmake:1 \(find_package\)
|
||||
CMakeLists.txt:3 \(include\)$
|
|
@ -0,0 +1 @@
|
|||
find_package(PolicyPop 1 CONFIG PATHS ${CMAKE_CURRENT_SOURCE_DIR}/PolicyPop NO_DEFAULT_PATH)
|
|
@ -0,0 +1,3 @@
|
|||
set(PACKAGE_VERSION 1)
|
||||
set(PACKAGE_VERSION_COMPATIBLE 1)
|
||||
cmake_policy(POP)
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1,5 @@
|
|||
^CMake Error at PolicyPush/PolicyPushConfigVersion.cmake:1 \(find_package\):
|
||||
cmake_policy PUSH without matching POP
|
||||
Call Stack \(most recent call first\):
|
||||
PolicyPush.cmake:1 \(find_package\)
|
||||
CMakeLists.txt:3 \(include\)$
|
|
@ -0,0 +1 @@
|
|||
find_package(PolicyPush 1 CONFIG PATHS ${CMAKE_CURRENT_SOURCE_DIR}/PolicyPush NO_DEFAULT_PATH)
|
|
@ -0,0 +1,3 @@
|
|||
set(PACKAGE_VERSION 1)
|
||||
set(PACKAGE_VERSION_COMPATIBLE 1)
|
||||
cmake_policy(PUSH)
|
|
@ -13,4 +13,6 @@ run_cmake(MissingConfigOneName)
|
|||
run_cmake(MissingConfigRequired)
|
||||
run_cmake(MissingConfigVersion)
|
||||
run_cmake(MixedModeOptions)
|
||||
run_cmake(PolicyPush)
|
||||
run_cmake(PolicyPop)
|
||||
run_cmake(SetFoundFALSE)
|
||||
|
|
Loading…
Reference in New Issue