Xcode: Misleading error from internally generated TARGET_OBJECTS genex
When configuring a qt project with big resource files, I get the error:
CMake Error at /Users/fieres/vgProjects/2.3/precompiled-2.3/osx.x64.clang-c++14/lib.qt5-5.14.1/5.14.1/lib/cmake/Qt5Core/Qt5CoreMacros.cmake:334 (add_custom_command):
Error evaluating generator expression:
$<TARGET_OBJECTS:rcc_object_testapplication>
The evaluation of the TARGET_OBJECTS generator expression is only suitable
for consumption by CMake (limited under Xcode with multiple architectures).
It is not suitable for writing out elsewhere.
Call Stack (most recent call first):
CMakeLists.txt:95 (qt5_add_big_resources)
The problem goes away when I define the variable CMAKE_OSX_ARCHITECTURES to be "x86_64". The default is "$(ARCHS_STANDARD)" which is evaluated by XCode. However, cmake seems to think it is a generator expression and fails. Is the test for the dollar sign in the following code snippet really correct, or can we do a more specific check?
[cmGlobalXCodeGenerator.cxx:3688]
bool cmGlobalXCodeGenerator::HasKnownObjectFileLocation(
std::string* reason) const
{
if (this->ObjectDirArch.find('$') != std::string::npos) {
if (reason != nullptr) {
*reason = " under Xcode with multiple architectures";
}
return false;
}
return true;
}