Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/test_install_deps_policy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pathlib import Path


def test_install_deps_sets_cmp0207_before_runtime_dependency_scan(
top_level_dir: Path,
):
template = (
top_level_dir
/ "vtk_sdk_python_wheel_helper"
/ "install-deps.cmake.in"
).read_text(encoding="utf-8")

policy_position = template.index("cmake_policy(SET CMP0207 NEW)")
runtime_deps_position = template.index("file(GET_RUNTIME_DEPENDENCIES")

assert "if(POLICY CMP0207)" in template
assert policy_position < runtime_deps_position
4 changes: 4 additions & 0 deletions vtk_sdk_python_wheel_helper/install-deps.cmake.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if(POLICY CMP0207)
cmake_policy(SET CMP0207 NEW)
endif()

file(GET_RUNTIME_DEPENDENCIES
RESOLVED_DEPENDENCIES_VAR resolved_deps
UNRESOLVED_DEPENDENCIES_VAR unresolved_deps
Expand Down