From d758a5a0f8785f99e55b203024e875b822c1ba3f Mon Sep 17 00:00:00 2001 From: Dominik Berner Date: Sun, 7 Jul 2024 08:18:29 +0000 Subject: [PATCH] Set Xcode attributes --- chapter16/hello_world_apple/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chapter16/hello_world_apple/CMakeLists.txt b/chapter16/hello_world_apple/CMakeLists.txt index 97cf066..11ab092 100644 --- a/chapter16/hello_world_apple/CMakeLists.txt +++ b/chapter16/hello_world_apple/CMakeLists.txt @@ -9,8 +9,20 @@ project( LANGUAGES CXX ) +# set some global XCode properties +set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Development") +set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "CMake Best Practice Authors") + # Add the executable add_executable(ch16_hello_world_apple src/main.mm) # Link the Cocoa framework target_link_libraries(ch16_hello_world_apple "-framework Cocoa") +target_compile_features(ch16_hello_world_apple PRIVATE cxx_std_17) + +#set target properties for macOS +set_target_properties(ch16_hello_world_apple PROPERTIES + XCODE_ATTRIBUTE_CXX_LANGUAGE_STANDARD "c++17" + XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME[variant=Release] "YES" + +) \ No newline at end of file