I currently use CMake to create my iOS xcode project, for both my static libs and application target. Now would like to create the unit test target from CMake as well, but haven't found any resources on whether CMake supports this or how to create the octest target.
Can I create this from CMake? If so, could you explain how?
No, CMake doesn't support unit tests on iOS. Also you can not run separate executables on iOS.
One of the solutions could be compiling your unit tests into a static library instead of executable and then link them to your XCTests or OCTests. You can do some magic with linker by creating alias for the
main
function and hiding all the other symbols.All the test properties you would have to implement yourself.