Skip to content

Commit

Permalink
try differnt approach for bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmUpTill committed Aug 13, 2022
1 parent 3f7a5a3 commit 985c26b
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions cmake/AdvSSHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@ set(_PLUGIN_FOLDER "adv-ss-plugins")

# --- MACOS section ---
if(OS_MACOS)

set(ADVSS_BUNDLE_FRAMEWORKS_DIR
"${CMAKE_INSTALL_PREFIX}/$<TARGET_BUNDLE_DIR:advanced-scene-switcher>/Contents/Frameworks/"
)
function(install_advss_lib_helper target)
install(
TARGETS ${target}
RUNTIME
DESTINATION
"$<TARGET_FILE_BASE_NAME:${target}>.app/Contents/Frameworks/"
COMPONENT advss_frameworks
LIBRARY
DESTINATION
"$<TARGET_FILE_BASE_NAME:${target}>.app/Contents/Frameworks/"
COMPONENT advss_frameworks
FRAMEWORK
DESTINATION
"$<TARGET_FILE_BASE_NAME:${target}>.app/Contents/Frameworks/"
COMPONENT advss_frameworks)
RUNTIME DESTINATION "${ADVSS_BUNDLE_FRAMEWORKS_DIR}"
COMPONENT advss_frameworks
LIBRARY DESTINATION "${ADVSS_BUNDLE_FRAMEWORKS_DIR}"
COMPONENT advss_frameworks
FRAMEWORK DESTINATION "${ADVSS_BUNDLE_FRAMEWORKS_DIR}"
COMPONENT advss_frameworks)
endfunction()

function(install_advss_lib target)
Expand All @@ -31,19 +27,28 @@ if(OS_MACOS)
install_advss_lib_helper(${target})
endfunction()

function(install_advss_plugin_dependency_target target)
install_advss_lib_helper(${target})
function(install_advss_plugin_dependency_target target dep)
install(
IMPORTED_RUNTIME_ARTIFACTS
${dep}
RUNTIME
DESTINATION
"${ADVSS_BUNDLE_FRAMEWORKS_DIR}"
COMPONENT
${dep}_Runtime
LIBRARY
DESTINATION
"${ADVSS_BUNDLE_FRAMEWORKS_DIR}"
COMPONENT
${dep}_Runtime
NAMELINK_COMPONENT
${dep}_Development)
endfunction()

function(install_advss_plugin_dependency_file target)
get_filename_component(_FILENAME ${dep} NAME)
string(REGEX REPLACE "\\.[^.]*$" "" _FILENAMENOEXT ${_FILENAME})
set(_DEP_NAME "${target}-${_FILENAMENOEXT}")

install(
FILES "${dep}"
DESTINATION ".app/Contents/Frameworks/"
COMPONENT advss_frameworks)
function(install_advss_plugin_dependency_file ${target} dep)
target_sources(advanced-scene-switcher PRIVATE ${dep})
set_source_files_properties(
${dep} PROPERTIES MACOSX_PACKAGE_LOCATION ${ADVSS_BUNDLE_FRAMEWORKS_DIR})
endfunction()

# --- End of section ---
Expand Down

0 comments on commit 985c26b

Please sign in to comment.