Skip to content

Commit 2dcb8c7

Browse files
fix: set CMP0207 for runtime dependency scan
1 parent ca5eb35 commit 2dcb8c7

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

tests/test_install_deps_policy.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from pathlib import Path
2+
3+
4+
def test_install_deps_sets_cmp0207_before_runtime_dependency_scan(
5+
top_level_dir: Path,
6+
):
7+
template = (
8+
top_level_dir
9+
/ "vtk_sdk_python_wheel_helper"
10+
/ "install-deps.cmake.in"
11+
).read_text(encoding="utf-8")
12+
13+
policy_position = template.index("cmake_policy(SET CMP0207 NEW)")
14+
runtime_deps_position = template.index("file(GET_RUNTIME_DEPENDENCIES")
15+
16+
assert "if(POLICY CMP0207)" in template
17+
assert policy_position < runtime_deps_position

vtk_sdk_python_wheel_helper/install-deps.cmake.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if(POLICY CMP0207)
2+
cmake_policy(SET CMP0207 NEW)
3+
endif()
4+
15
file(GET_RUNTIME_DEPENDENCIES
26
RESOLVED_DEPENDENCIES_VAR resolved_deps
37
UNRESOLVED_DEPENDENCIES_VAR unresolved_deps

0 commit comments

Comments
 (0)