I am trying to compile a fat binary with ExternalProject_Add. In order to do so, I need to pass x86_64;arm64 in the CMAKE_OSX_ARCHITECTURES variable to ExternalProject_Add. However, my attempts at it do not work:
I would assume this has to do with the semi-colon inside CMAKE_OSX_ARCHITECTURES, which needs escaping so that it makes its way into the invocation of ExternalProject_Add, instead of being used to separate its arguments. So I’d write it like this:
ExternalProject_Add(
# ... as before, but:
"-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}"
)
Oh, that is indeed better. I’ll note that in the ExternalProject-using project, the command is extracted and written to a CMake script so that we can also apply environment settings to it, so the smuggling is still required there.