fix(cpn): bundle MSVC++ redist with win64 installer (#6603)

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
Neil Horne
2025-10-17 11:02:29 +10:00
committed by GitHub
co-authored by Peter Feerick
parent e6ac5f088a
commit 44fcd35591
5 changed files with 5734 additions and 5 deletions
+27
View File
@@ -0,0 +1,27 @@
if(WIN32)
include(InstallRequiredSystemLibraries)
# Determine architecture
# if(CMAKE_CL_64)
set(MSVC_ARCH x64)
# else()
# set(MSVC_ARCH x86)
# endif()
# Attempt to find the vcredist executable
find_program(MSVC_REDIST_EXE
NAMES vc_redist.${MSVC_ARCH}.exe
PATHS
"${MSVC_REDIST_DIR}" # If set by InstallRequiredSystemLibraries
"$ENV{VCINSTALLDIR}Redist/MSVC/v143/" # For VS 2022
"C:/Program Files (x86)/Microsoft Visual Studio/*/VC/Redist/MSVC/*/"
"C:/Program Files/Microsoft Visual Studio/*/*/VC/Redist/MSVC/*/"
NO_DEFAULT_PATH
)
if(MSVC_REDIST_EXE)
message(STATUS "Found VC Redistributable: ${MSVC_REDIST_EXE}")
else()
message(WARNING "VC Redistributable not found.")
endif()
endif()