Skip to content

Commit

Permalink
Set Xcode attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
bernedom committed Jul 7, 2024
1 parent 8662eeb commit d758a5a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions chapter16/hello_world_apple/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"

)

0 comments on commit d758a5a

Please sign in to comment.