summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2025-04-28 18:36:09 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2025-04-28 18:36:09 +0200
commite0802889d467912251d9a7f60c033c3737c33aa7 (patch)
treefe2180cacd691cc3ed899e55e2ec8363e96782ed
parent9af8abc080e704d7f91a72dc3ac89bb42405bcf8 (diff)
macOS: disable automatic code signing when using Xcode
This is the default. Users can still override this if they have a valid certificate.
-rw-r--r--CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9571967ec..d1496fc16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -132,6 +132,23 @@ include(CMake/resources.cmake)
include(CMake/options.cmake)
#######################################################################
+# Disable automatic code signing on macOS when using Xcode.
+# This *MUST* be done after including CMake/options.cmake.
+# Users can still enable code signing if they have a valid certificate.
+# Details about code signing are beyond the scope of this document.
+#######################################################################
+# FIXME: some of the conditions below may be redundant, and the code
+# below should be improved in a later version.
+#######################################################################
+
+if(APPLE) # AND NOT FLTK_BACKEND_X11 AND CMAKE_GENERATOR STREQUAL "Xcode")
+ if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED)
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED OFF CACHE BOOL
+ "Allow Code Signing when using Xcode")
+ endif()
+endif()
+
+#######################################################################
# print (debug) several build variables and options
#######################################################################