Skip to content

Commit

Permalink
cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmUpTill committed Feb 14, 2024
1 parent 69a9302 commit 99f4a34
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions cmake/common/advss_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(OS_MACOS)
set(ADVSS_BUNDLE_MODULE_DIR "${ADVSS_BUNDLE_DIR}/Contents/MacOS")
set(ADVSS_BUNDLE_PLUGIN_DIR ${ADVSS_BUNDLE_MODULE_DIR}/${_PLUGIN_FOLDER})

function(resign_advss target)
function(resign_advss)
set(_COMMAND
"codesign --force --deep --sign - \\\"${CMAKE_INSTALL_PREFIX}/${ADVSS_BUNDLE_DIR}\\\""
)
Expand All @@ -30,7 +30,7 @@ if(OS_MACOS)
RUNTIME DESTINATION "${where}" COMPONENT advss_plugins
LIBRARY DESTINATION "${where}" COMPONENT advss_plugins
FRAMEWORK DESTINATION "${where}" COMPONENT advss_plugins)
resign_advss(${target})
resign_advss()
endfunction()

function(install_advss_lib target)
Expand All @@ -44,6 +44,7 @@ if(OS_MACOS)
${CMAKE_INSTALL_NAME_TOOL} -change @rpath/$<TARGET_FILE_NAME:${target}>
@loader_path/$<TARGET_FILE_NAME:${target}>
$<TARGET_FILE:${PROJECT_NAME}>)
resign_advss()
endfunction()

function(install_advss_plugin target)
Expand All @@ -66,14 +67,14 @@ if(OS_MACOS)
${dep}_Runtime
NAMELINK_COMPONENT
${dep}_Development)
resign_advss(${target})
resign_advss()
endfunction()

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_PLUGIN_DIR})
resign_advss(${target})
resign_advss()
endfunction()

# --- End of section ---
Expand Down Expand Up @@ -288,9 +289,11 @@ function(setup_advss_plugin target)
get_target_property(ADVSS_BINARY_DIR advanced-scene-switcher-lib BINARY_DIR)

if(OS_MACOS)
set(_INSTALL_RPATH "@loader_path" "@loader_path/..")
set_target_properties(${target} PROPERTIES INSTALL_RPATH
"${_INSTALL_RPATH}")
set(_COMMAND
"${CMAKE_INSTALL_NAME_TOOL} -add_rpath @loader_path \\\"$<TARGET_FILE:${target}>\\\""
)
install(CODE "execute_process(COMMAND /bin/sh -c \"${_COMMAND}\")")
resign_advss()
endif()

# Set up include directories for headers generated by Qt
Expand Down

0 comments on commit 99f4a34

Please sign in to comment.