summaryrefslogtreecommitdiff
path: root/cmake/configure-packaging.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/configure-packaging.cmake')
-rw-r--r--cmake/configure-packaging.cmake29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/configure-packaging.cmake b/cmake/configure-packaging.cmake
new file mode 100644
index 000000000..f3d2c115a
--- /dev/null
+++ b/cmake/configure-packaging.cmake
@@ -0,0 +1,29 @@
+set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
+set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0)
+set(CPACK_COMPONENTS_ALL "Starship")
+
+if (CPACK_GENERATOR STREQUAL "External")
+ list(APPEND CPACK_COMPONENTS_ALL "extractor" "appimage")
+endif()
+
+if (CPACK_GENERATOR MATCHES "DEB|RPM")
+# https://unix.stackexchange.com/a/11552/254512
+set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/ship/bin")#/${CMAKE_PROJECT_VERSION}")
+set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0)
+elseif (CPACK_GENERATOR MATCHES "ZIP")
+set(CPACK_PACKAGING_INSTALL_PREFIX "")
+endif()
+
+if (CPACK_GENERATOR MATCHES "External")
+set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
+SET(CPACK_MONOLITHIC_INSTALL 1)
+set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/bin")
+endif()
+
+if (CPACK_GENERATOR MATCHES "Bundle")
+ set(CPACK_BUNDLE_NAME "Starship")
+ set(CPACK_BUNDLE_PLIST "macosx/Info.plist")
+ set(CPACK_BUNDLE_ICON "macosx/Starship.icns")
+ # set(CPACK_BUNDLE_STARTUP_COMMAND "macosx/Starship-macos.sh")
+ set(CPACK_BUNDLE_APPLE_CERT_APP "-")
+endif() \ No newline at end of file