2023-09-05 00:16:30 +00:00
|
|
|
# common packaging
|
|
|
|
|
|
|
|
# common cpack options
|
|
|
|
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
|
|
|
|
set(CPACK_PACKAGE_VENDOR "LizardByte")
|
2024-08-20 14:09:50 +00:00
|
|
|
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
2023-09-05 00:16:30 +00:00
|
|
|
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cpack_artifacts)
|
|
|
|
set(CPACK_PACKAGE_CONTACT "https://app.lizardbyte.dev")
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION})
|
|
|
|
set(CPACK_PACKAGE_HOMEPAGE_URL ${CMAKE_PROJECT_HOMEPAGE_URL})
|
|
|
|
set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE)
|
|
|
|
set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png)
|
|
|
|
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}")
|
|
|
|
set(CPACK_STRIP_FILES YES)
|
|
|
|
|
2024-03-31 15:52:25 +00:00
|
|
|
# install common assets
|
2023-12-28 00:25:49 +00:00
|
|
|
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/"
|
|
|
|
DESTINATION "${SUNSHINE_ASSETS_DIR}"
|
|
|
|
PATTERN "web" EXCLUDE)
|
2024-03-31 15:52:25 +00:00
|
|
|
# copy assets to build directory, for running without install
|
|
|
|
file(GLOB_RECURSE ALL_ASSETS
|
|
|
|
RELATIVE "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/*")
|
|
|
|
list(FILTER ALL_ASSETS EXCLUDE REGEX "^web/.*$") # Filter out the web directory
|
|
|
|
foreach(asset ${ALL_ASSETS}) # Copy assets to build directory, excluding the web directory
|
|
|
|
file(COPY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/${asset}"
|
|
|
|
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/assets")
|
|
|
|
endforeach()
|
2023-12-28 00:25:49 +00:00
|
|
|
|
|
|
|
# install built vite assets
|
|
|
|
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/assets/web"
|
|
|
|
DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
2023-09-05 00:16:30 +00:00
|
|
|
|
|
|
|
# platform specific packaging
|
|
|
|
if(WIN32)
|
|
|
|
include(${CMAKE_MODULE_PATH}/packaging/windows.cmake)
|
|
|
|
elseif(UNIX)
|
|
|
|
include(${CMAKE_MODULE_PATH}/packaging/unix.cmake)
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
include(${CMAKE_MODULE_PATH}/packaging/macos.cmake)
|
|
|
|
else()
|
|
|
|
include(${CMAKE_MODULE_PATH}/packaging/linux.cmake)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(CPack)
|