I am using Cmake with Xcode to generate a c++/c "project" (my_project) and some c++/c "targets" (one is a binary, the rest are libraries)
My CMakeLists.txt looks something like this:
project(my_project)
add_subdirectory(library_projectA)
add_subdirectory(library_projectB)
add_subdirectory(binary_project)
Each Subdirectory has a CMakeLists.txt with either:
add_library(library_projectA)
Or
add_executable(binary_project)
Which produces a top level my_project.xcodeproj, which references the subprojects.
Xcode has this Hierarchical property inheritance (left fields take precedence over right fields):
Target, Project, Default
I would like to change the "Project" fields, i.e. for my_project. This should affect ALL Targets.
I have tried this:
add_custom_target(my_project)
add_target_properties(my_project PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")
But this doesn't work.
Note that if I put this in one of the "Targets":
add_target_properties(binary_project PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")
Then this works, but only for that "Target"
If this isn't clear, I'd be happy to provide a working example, but this will take a bit of time...
On the off-chance anyone knows of a quicker fix to the whole problem, I'd like a clean install of Xcode not not come up with this (or any other) warning:
Project 'my_project' overrides the Architectures setting. This will remove the setting and allow Xcode to automatically select Architectures based on hardware available for the active platform and deployment target.