From e7addb470f4d4e0fd33b037196b1502603443c20 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 27 Feb 2026 09:17:13 +0100 Subject: [PATCH] macOS build: fuse two add_custom_command() CMake calls into a single one --- CMake/fl_create_example.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMake/fl_create_example.cmake b/CMake/fl_create_example.cmake index e1eebb906..a70fc87e1 100644 --- a/CMake/fl_create_example.cmake +++ b/CMake/fl_create_example.cmake @@ -102,9 +102,6 @@ function(fl_create_example NAME SOURCES LIBRARIES) if(MAC_BUNDLE) add_executable (${TARGET_NAME} MACOSX_BUNDLE ${srcs} ${ICON_PATH}) - # add ad-hoc signature - add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND - codesign -s - $) else() add_executable (${TARGET_NAME} WIN32 ${srcs}) endif(MAC_BUNDLE) @@ -145,6 +142,7 @@ function(fl_create_example NAME SOURCES LIBRARIES) ############################################################################## # Copy macOS "bundle wrapper" (shell script) to target directory. + # Add ad-hoc signature. # The "custom command" will be executed "POST_BUILD". ############################################################################## @@ -155,6 +153,7 @@ function(fl_create_example NAME SOURCES LIBRARIES) TARGET ${TARGET_NAME} POST_BUILD COMMAND cp ${FLTK_SOURCE_DIR}/CMake/macOS-bundle-wrapper.in ${WRAPPER} COMMAND chmod u+x,g+x,o+x ${WRAPPER} + COMMAND codesign -s - $ BYPRODUCTS ${WRAPPER} # COMMENT "Creating macOS bundle wrapper script ${WRAPPER}" VERBATIM