Skip to content

Commit 9b603f8

Browse files
authored
Fix macos bundle (#1340)
1 parent 5c5f66a commit 9b603f8

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

cmake/installers.cmake

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,14 @@ macro(DeployApple TARGET)
9494
UNRESOLVED_DEPENDENCIES_VAR _u_deps
9595
)
9696

97-
foreach(_file ${_r_deps})
98-
string(FIND ${_file} "dylib" _index)
99-
if (${_index} GREATER -1)
100-
file(INSTALL
101-
DESTINATION "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/Frameworks"
102-
TYPE SHARED_LIBRARY
103-
FILES "${_file}"
104-
)
105-
else()
106-
file(INSTALL
107-
DESTINATION "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib"
108-
TYPE SHARED_LIBRARY
109-
FILES "${_file}"
110-
)
111-
endif()
112-
endforeach()
97+
foreach(_libfile ${_r_deps})
98+
if(_libfile MATCHES "\\.dylib$")
99+
set(_dest "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/Frameworks")
100+
else()
101+
set(_dest "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib")
102+
endif()
103+
file(COPY "${_libfile}" DESTINATION "${_dest}" FOLLOW_SYMLINK_CHAIN)
104+
endforeach()
113105

114106
list(LENGTH _u_deps _u_length)
115107
if("${_u_length}" GREATER 0)
@@ -147,8 +139,8 @@ macro(DeployApple TARGET)
147139
endif()
148140
endforeach()
149141

150-
include(BundleUtilities)
151-
fixup_bundle("${CMAKE_INSTALL_PREFIX}/hyperhdr.app" "${MYQT_PLUGINS}" "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib")
142+
include(BundleUtilities)
143+
fixup_bundle("${CMAKE_INSTALL_PREFIX}/hyperhdr.app" "${MYQT_PLUGINS}" "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib;${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/Frameworks")
152144
fixup_bundle("${CMAKE_INSTALL_PREFIX}/hyperhdr.app" "" "")
153145

154146
file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib")

0 commit comments

Comments
 (0)