Skip to content

Truly independent web browser

Meta: Configure CPack once for the whole project

Jelle Raaijmakers3a8d8509f548
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a164bfa5f90..963894a5e1d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -150,6 +150,8 @@ if (ENABLE_GUI_TARGETS)
endif()
endif()
+include(packaging)
+
add_custom_target(lint-shell-scripts
COMMAND "${ladybird_SOURCE_DIR}/Meta/Linters/lint_shell_scripts.sh"
USES_TERMINAL
diff --git a/Meta/CMake/packaging.cmake b/Meta/CMake/packaging.cmake
new file mode 100644
index 00000000000..93b1cfd3a53
--- /dev/null
+++ b/Meta/CMake/packaging.cmake
@@ -0,0 +1,18 @@
+set(CPACK_GENERATOR "TGZ")
+set(CPACK_STRIP_FILES TRUE)
+set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
+set(CPACK_COMPONENTS_ALL js wasm)
+if (APPLE)
+ if("arm64" IN_LIST CMAKE_OSX_ARCHITECTURES AND "x86_64" IN_LIST CMAKE_OSX_ARCHITECTURES)
+ set(CPACK_SYSTEM_NAME "macOS-universal2")
+ else()
+ set(CPACK_SYSTEM_NAME "macOS-${CMAKE_SYSTEM_PROCESSOR}")
+ endif()
+else()
+ set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
+endif()
+
+set(CPACK_ARCHIVE_JS_FILE_NAME "ladybird-js-${CPACK_SYSTEM_NAME}")
+set(CPACK_ARCHIVE_WASM_FILE_NAME "ladybird-wasm-${CPACK_SYSTEM_NAME}")
+
+include(CPack)
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index 8fcce1e2a4e..d0a8d0d1fd6 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -60,24 +60,4 @@ if (NOT CMAKE_SKIP_INSTALL_RULES)
install(TARGETS wasm COMPONENT wasm)
install(FILES "${GIT_COMMIT_FILE}" COMPONENT wasm DESTINATION .)
-
- set(CPACK_GENERATOR "TGZ")
- set(CPACK_STRIP_FILES TRUE)
- set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
- set(CPACK_COMPONENTS_ALL js wasm)
- set(CPACK_COMPONENTS_GROUPING ONE_PER_GROUP)
- if (APPLE)
- if("arm64" IN_LIST CMAKE_OSX_ARCHITECTURES AND "x86_64" IN_LIST CMAKE_OSX_ARCHITECTURES)
- set(CPACK_SYSTEM_NAME "macOS-universal2")
- else()
- set(CPACK_SYSTEM_NAME "macOS-${CMAKE_SYSTEM_PROCESSOR}")
- endif()
- else()
- set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
- endif()
-
- set(CPACK_ARCHIVE_JS_FILE_NAME "ladybird-js-${CPACK_SYSTEM_NAME}")
- set(CPACK_ARCHIVE_WASM_FILE_NAME "ladybird-wasm-${CPACK_SYSTEM_NAME}")
-
- include(CPack)
endif()