Skip to content

Commit

Permalink
Strip out unnecessary packaging logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaymar committed Oct 4, 2023
1 parent 9a8be4d commit 0efbaa6
Showing 1 changed file with 28 additions and 99 deletions.
127 changes: 28 additions & 99 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ endif()

# Installation / Packaging
if(STANDALONE)
set(STRUCTURE_UNIFIED CACHE BOOL "Install for use in a Plugin Manager")
if(D_PLATFORM_LINUX)
set(STRUCTURE_PACKAGEMANAGER CACHE BOOL "Install for use in a Package Manager (system-wide installation)")
endif()
Expand Down Expand Up @@ -1533,56 +1532,7 @@ endforeach()
################################################################################

if(STANDALONE)
if(STRUCTURE_UNIFIED)
install(
DIRECTORY "data/"
DESTINATION "data/"
FILE_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE
DIRECTORY_PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE
)

if(D_PLATFORM_WINDOWS)
install(
TARGETS StreamFX
RUNTIME DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX
LIBRARY DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX
PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE
)
if(MSVC)
install(
FILES $<TARGET_PDB_FILE:StreamFX>
DESTINATION "bin/windows-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/"
COMPONENT StreamFX
OPTIONAL
)
endif()
elseif(D_PLATFORM_LINUX)
install(
TARGETS StreamFX
RUNTIME DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX
LIBRARY DESTINATION "bin/linux-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX
PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE
)
elseif(D_PLATFORM_MAC)
install(
TARGETS StreamFX
RUNTIME DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX
LIBRARY DESTINATION "bin/mac-${D_PLATFORM_INSTR}-${D_PLATFORM_BITS}/" COMPONENT StreamFX
PERMISSIONS WORLD_EXECUTE;WORLD_READ;OWNER_EXECUTE;OWNER_READ;OWNER_WRITE;GROUP_EXECUTE;GROUP_READ;GROUP_WRITE
)
endif()

install(
FILES LICENSE
DESTINATION "LICENSE"
COMPONENT StreamFX
)
install(
FILES icon.png
DESTINATION "icon.png"
COMPONENT StreamFX
)
elseif(D_PLATFORM_WINDOWS)
if(D_PLATFORM_WINDOWS)
install(
TARGETS StreamFX
RUNTIME DESTINATION "obs-plugins/${D_PLATFORM_BITS}bit/" COMPONENT StreamFX
Expand Down Expand Up @@ -1692,59 +1642,38 @@ if(STANDALONE)
endif()
set(_PACKAGE_FULL_NAME "${PACKAGE_PREFIX}/${PACKAGE_NAME}-${_PACKAGE_SUFFIX_OVERRIDE}")

if(STRUCTURE_UNIFIED)
add_custom_target(
PACKAGE_ZIP
${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.obs" --format=zip --
"."
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
if(D_PLATFORM_WINDOWS)
## Installer (InnoSetup)
get_filename_component(ISS_FILES_DIR "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR)

get_filename_component(ISS_PACKAGE_DIR "${PACKAGE_PREFIX}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR)

get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR)

get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH)

configure_file(
"templates/windows/installer.iss.in"
"installer.iss"
)
else()
add_custom_target(
PACKAGE_7Z
${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.7z" --format=7zip --
"."
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
elseif(D_PLATFORM_MAC)
# .pkg Installer
set(PACKAGES_PATH_NAME "StreamFX")
set(PACKAGES_PATH_NAME "${PACKAGES_PATH_NAME}.plugin")
configure_file(
"templates/macos/installer.pkgproj.in"
"installer.pkgproj"
)
elseif(D_PLATFORM_LINUX)
add_custom_target(
PACKAGE_ZIP
${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.zip" --format=zip --
PACKAGE
${CMAKE_COMMAND} -E tar cfv "${_PACKAGE_FULL_NAME}.7z" --format=7zip --
"."
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
)

# Windows
if(D_PLATFORM_WINDOWS)
## Installer (InnoSetup)
get_filename_component(ISS_FILES_DIR "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR)

get_filename_component(ISS_PACKAGE_DIR "${PACKAGE_PREFIX}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR)

get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR)

get_filename_component(ISS_MSVCHELPER_PATH "${msvc-redist-helper_BUILD_DIR}" ABSOLUTE)
file(TO_NATIVE_PATH "${ISS_MSVCHELPER_PATH}" ISS_MSVCHELPER_PATH)

configure_file(
"templates/windows/installer.iss.in"
"installer.iss"
)
endif()

# Apple MacOS
if(D_PLATFORM_MAC)
# .pkg Installer
set(PACKAGES_PATH_NAME "StreamFX")
if(STRUCTURE_BUNDLE)
set(PACKAGES_PATH_NAME "${PACKAGES_PATH_NAME}.plugin")
endif()
configure_file(
"templates/macos/installer.pkgproj.in"
"installer.pkgproj"
)
endif()
endif()
endif()

0 comments on commit 0efbaa6

Please sign in to comment.