aboutsummaryrefslogtreecommitdiff
path: root/cmake/WindowsPackages.cmake
blob: 2bd885b3493103e804f9a556d106770839624fc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

function(cpsc_prepare_windows_packages)
    # Keep the MSYS2 prefix layout so relative CMake imports and DLL paths work.
    file(GLOB_RECURSE configs "${CPSC_DEPS_ROOT}/*.cmake")
    foreach(config IN LISTS configs)
        file(READ "${config}" contents)
        foreach(prefix mingw64 ucrt64 clang64)
            string(REPLACE "C:/msys64/${prefix}/" "${CPSC_DEPS_ROOT}/${prefix}/"
                contents "${contents}")
            string(REPLACE "\"/${prefix}/" "\"${CPSC_DEPS_ROOT}/${prefix}/"
                contents "${contents}")
        endforeach()
        file(WRITE "${config}" "${contents}")
    endforeach()
endfunction()