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