No need to test if CMAKE_GENERATOR matches Xcode since other generators will ignore the XCODE_SCHEME_... properties.
I’d also recommend not calling your executable target “test”, since this will conflict with a target that CMake will create when enable_testing() has been called.
Do you enable schema creation? To do that, you would need to either set the CMAKE_XCODE_GENERATE_SCHEME variable or else set XCODE_GENERATE_SCHEME on each target.
In your top level CMakeLists.txt file, you probably want something like this:
set(CMAKE_XCODE_GENERATE_SCHEME TRUE)
Try adding that to your project and see if that causes the arguments to then appear. Not sure if you will need to wipe your existing build directory or not (probably not, but something to try if it doesn’t seem to work initially).
That works! Thanks a lot for the speedy assistance, Craig.
I also found that by passing the arguments as separate strings, I was able to have the arguments populate as separate entries under Xcode. E.g., calling:
Hi! A follow-up question regarding the XCODE_SCHEME_ARGUMENTS: is there a possibility to provide an argument with the box unticked? (on the example above “blah” and “hello” are both with a tick).
In the XCode scheme file there is for each a field "isEnabled = “YES” but I haven’t found whether there is a way to set it to NO for some of them