| 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) |
| 29 | def 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 |
| 44 | if sys.platform.startswith("win"): |