Skip to content

Commit 2c79a27

Browse files
committed
fix cpack windows
1 parent 17aed38 commit 2c79a27

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,13 @@ set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION_STRING})
259259
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
260260
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
261261
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
262-
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
262+
if(WIN32)
263+
# Prevent drive letters from bleeding into the staging path when CPack creates
264+
# the temporary install tree on Windows.
265+
set(CPACK_PACKAGING_INSTALL_PREFIX "/")
266+
else()
267+
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
268+
endif()
263269
set(CPACK_MONOLITHIC_INSTALL ON)
264270
set(CPACK_VERBATIM_VARIABLES ON)
265271

0 commit comments

Comments
 (0)