Skip to content

Commit 6e1973b

Browse files
EricZhang456craftablescience
authored andcommitted
install: fix macos code signing
1 parent 552c3d9 commit 6e1973b

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ function(vpkedit_configure_target TARGET)
4444
endif()
4545
elseif(APPLE)
4646
option(VPKEDIT_MAC_BUNDLE_QT "Bundle Qt into the application bundle for macOS" ON)
47+
option(VPKEDIT_MAC_BUNDLE_ADHOC_SIGN "Ad-hoc sign the macOS application bundle" ON)
4748
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macOS")
4849
include(MakeICNS)
4950
set(MACOS_ICON "${CMAKE_CURRENT_BINARY_DIR}/logo.icns")

cmake/macos/SignBundle.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
execute_process(COMMAND codesign --deep -fs - ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/vpkedit.app)

install/_install.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ elseif(APPLE)
6464
DESTINATION .)
6565

6666
install(TARGETS ${PROJECT_NAME}_dmx_preview ${PROJECT_NAME}_mdl_preview
67-
DESTINATION "${PROJECT_NAME_PRETTY}.app/Contents/PlugIns/previews")
67+
DESTINATION "${PROJECT_NAME}.app/Contents/PlugIns/previews")
6868

6969
# Deploy Qt into the bundle
7070
if(VPKEDIT_MAC_BUNDLE_QT)
@@ -73,6 +73,10 @@ elseif(APPLE)
7373
OUTPUT_SCRIPT qt_deploy_script)
7474
install(SCRIPT ${qt_deploy_script})
7575
endif()
76+
77+
if(VPKEDIT_MAC_BUNDLE_ADHOC_SIGN)
78+
set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/SignBundle.cmake")
79+
endif()
7680
elseif(UNIX)
7781
install(TARGETS ${PROJECT_NAME}cli
7882
DESTINATION "${CMAKE_INSTALL_BINDIR}")

0 commit comments

Comments
 (0)