MCPcopy Create free account
hub / github.com/RenderKit/embree / fix_cmake_paths

Function fix_cmake_paths

scripts/test.py:29–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27# change some CMake paths in the CMakeCache.txt file for execution of tests
28# on potentially different machine (e.g, copied build dir in CI)
29def fix_cmake_paths():
30 with open('build/CMakeCache.txt', 'r') as file:
31 file_content = file.read()
32
33 file_content = re.sub(r"(For build in directory: ).*", os.path.join(r"\1"+cwd, "build"), file_content)
34 file_content = re.sub(r"(embree[0-9]+_BINARY_DIR:STATIC=).*", os.path.join(r"\1"+cwd, "build"), file_content)
35 file_content = re.sub(r"(CMAKE_CACHEFILE_DIR:INTERNAL=).*", os.path.join(r"\1"+cwd, "build"), file_content)
36
37 file_content = re.sub(r"(embree[0-9]+_SOURCE_DIR:STATIC=).*", r"\1"+cwd, file_content)
38 file_content = re.sub(r"(CMAKE_HOME_DIRECTORY:INTERNAL=).*", r"\1"+cwd, file_content)
39
40 with open('build/CMakeCache.txt', 'w') as file:
41 file.write(file_content)
42
43# detect platform
44if sys.platform.startswith("win"):

Callers 1

runFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected