Last active
August 17, 2026 03:14
-
-
Save scivision/4230fac074bbe895c3ad684fb30ca21b to your computer and use it in GitHub Desktop.
CPack template for tar.bz2 and WiX MSI installer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # do this after all install(...) commands so that all targets are finalized. | |
| # Essentially, the last thing included at the end of the top-level CMakeLists.txt | |
| set(CPACK_GENERATOR "TBZ2") | |
| set(CPACK_SOURCE_GENERATOR "TBZ2") | |
| set(CPACK_PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package) | |
| set(CPACK_SOURCE_IGNORE_FILES .git/ .github/ .vscode/ .mypy_cache/ _CPack_Packages/ | |
| ${CMAKE_BINARY_DIR}/ ${PROJECT_BINARY_DIR}/ | |
| ) | |
| include(CPack) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # UpgradeCode must stay fixed forever so each new MSI cleanly replaces the previous install | |
| set(CPACK_WIX_UPGRADE_GUID "<your UUID here>") | |
| set(CPACK_WIX_VERSION 4) | |
| set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/my.ico") | |
| set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") | |
| set(CPACK_PACKAGE_EXECUTABLES "my-main-program") | |
| set(CPACK_CREATE_DESKTOP_LINKS "my-program") | |
| set(CPACK_GENERATOR "WIX") | |
| set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) | |
| set(CPACK_PACKAGE_VENDOR "MyCompany") | |
| set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME}) | |
| set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | |
| set(CPACK_PACKAGE_VERSION_MINOR ${{PROJECT_VERSION_MINOR}) | |
| set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) | |
| set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}) | |
| include(CPack) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment