@@ -14,7 +14,11 @@ set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
14
14
# This should always be set, just isn’t by default for awkward backward compatibility reasons
15
15
set (CPACK_VERBATIM_VARIABLES YES )
16
16
17
- set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR} /LICENSE" )
17
+ # The WiX package generator expects licenses to end in .txt or .rtf...
18
+ file (COPY "${CMAKE_CURRENT_SOURCE_DIR} /LICENSE" DESTINATION "${CMAKE_CURRENT_BINARY_DIR} " )
19
+ file (RENAME "${CMAKE_CURRENT_BINARY_DIR} /LICENSE" "${CMAKE_CURRENT_BINARY_DIR} /LICENSE.txt" )
20
+
21
+ set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR} /LICENSE.txt" )
18
22
set (CPACK_PACKAGE_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR} /README.md" )
19
23
20
24
# Automatically find dependencies for shared libraries
@@ -23,9 +27,41 @@ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS YES)
23
27
# In addition, we depend on gcc for preprocessing
24
28
set (CPACK_DEBIAN_PACKAGE_DEPENDS gcc )
25
29
30
+ # For windows we need to set up product and update GUID
31
+ # See: https://docs.microsoft.com/en-us/windows/win32/msi/productcode
32
+ # and https://docs.microsoft.com/en-us/windows/win32/msi/upgradecode
33
+ # confusingly, the "product" GUID here is the one that changes between releases,
34
+ # the upgrade one is the one that stays the same. CMake takes care of setting these,
35
+ # but we want to fix the upgrade GUID to a specific value so new installs override
36
+ # old ones.
37
+ set (NIL_UUID "00000000-0000-0000-0000-000000000000" )
38
+ string (UUID CPACK_WIX_UPGRADE_GUID
39
+ NAMESPACE ${NIL_UUID}
40
+ NAME "cprover-cbmc"
41
+ TYPE SHA1
42
+ UPPER )
43
+
44
+
45
+ # This is AFAICT only used for windows installers.
46
+ # Basically the package-specific part of the install directory,
47
+ # e.g. C:\Program Files\${CPACK_PACKAGE_INSTALL_DIRECTORY}.
48
+ # The default here includes the version number which we don't want,
49
+ # because upgrades will overwrite the files here so we could be in the
50
+ # odd situation where C:\Program Files\cbmc-5.12.6\bin\cbmc --version
51
+ # gives you back "5.16.1" because 5.12.6 just happened to be the first
52
+ # installed version.
53
+ set (CPACK_PACKAGE_INSTALL_DIRECTORY "cbmc" )
54
+
55
+
26
56
# TODO packages for other platforms
27
57
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
28
58
set (CPACK_GENERATOR TGZ DEB )
59
+ elseif (WIN32 )
60
+
61
+ # On windows we need to make sure to ship the
62
+ # MSVC redistributable
63
+ include (InstallRequiredSystemLibraries )
64
+ set (CPACK_GENERATOR ZIP WIX )
29
65
endif ()
30
66
31
67
# Yes, this has to go at the bottom,
0 commit comments