mirror of
https://github.com/fltk/fltk.git
synced 2026-06-02 07:26:57 +08:00
macOS build: fuse two add_custom_command() CMake calls into a single one
This commit is contained in:
@@ -102,9 +102,6 @@ function(fl_create_example NAME SOURCES LIBRARIES)
|
|||||||
|
|
||||||
if(MAC_BUNDLE)
|
if(MAC_BUNDLE)
|
||||||
add_executable (${TARGET_NAME} MACOSX_BUNDLE ${srcs} ${ICON_PATH})
|
add_executable (${TARGET_NAME} MACOSX_BUNDLE ${srcs} ${ICON_PATH})
|
||||||
# add ad-hoc signature
|
|
||||||
add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND
|
|
||||||
codesign -s - $<TARGET_BUNDLE_DIR:${TARGET_NAME}>)
|
|
||||||
else()
|
else()
|
||||||
add_executable (${TARGET_NAME} WIN32 ${srcs})
|
add_executable (${TARGET_NAME} WIN32 ${srcs})
|
||||||
endif(MAC_BUNDLE)
|
endif(MAC_BUNDLE)
|
||||||
@@ -145,6 +142,7 @@ function(fl_create_example NAME SOURCES LIBRARIES)
|
|||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Copy macOS "bundle wrapper" (shell script) to target directory.
|
# Copy macOS "bundle wrapper" (shell script) to target directory.
|
||||||
|
# Add ad-hoc signature.
|
||||||
# The "custom command" will be executed "POST_BUILD".
|
# The "custom command" will be executed "POST_BUILD".
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
@@ -155,6 +153,7 @@ function(fl_create_example NAME SOURCES LIBRARIES)
|
|||||||
TARGET ${TARGET_NAME} POST_BUILD
|
TARGET ${TARGET_NAME} POST_BUILD
|
||||||
COMMAND cp ${FLTK_SOURCE_DIR}/CMake/macOS-bundle-wrapper.in ${WRAPPER}
|
COMMAND cp ${FLTK_SOURCE_DIR}/CMake/macOS-bundle-wrapper.in ${WRAPPER}
|
||||||
COMMAND chmod u+x,g+x,o+x ${WRAPPER}
|
COMMAND chmod u+x,g+x,o+x ${WRAPPER}
|
||||||
|
COMMAND codesign -s - $<TARGET_BUNDLE_DIR:${TARGET_NAME}>
|
||||||
BYPRODUCTS ${WRAPPER}
|
BYPRODUCTS ${WRAPPER}
|
||||||
# COMMENT "Creating macOS bundle wrapper script ${WRAPPER}"
|
# COMMENT "Creating macOS bundle wrapper script ${WRAPPER}"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
|
|||||||
Reference in New Issue
Block a user