3

CMake 3.14 has a very useful mechanizm to automatically generate schema files for Xcode. The problem is that it creates schemas for all targets while I need scheme only for few of them. I have hundreds of targets in my projects and scrolling down the list is annoying.

My code is:

if(${CMAKE_GENERATOR} MATCHES "Xcode")
    set(CMAKE_XCODE_GENERATE_SCHEME YES)
endif()

All I want is to create only one scheme for ALL_BUILD target not for all targets.

1 Answers1

0

Finally I've found some workaround to may problem. First I enable scheme generation for all targets as before:

set(CMAKE_XCODE_GENERATE_SCHEME YES)

then disable schemes generation for all targets in subfolder:

get_all_targets_recursive(all_subfolder_targets "subfolder")
foreach(subfolder_target ${all_subfolder_targets})
    set_target_properties(${subfolder_target} PROPERTIES XCODE_GENERATE_SCHEME NO)
endforeach()

you can find get_all_targets_recursive implementation here https://stackoverflow.com/a/62311397/5472544