[xcode] target ordering
with most cmake frontends and with visual studio, the generated cmake targets are sorted lexicographically. however the target ordering with the xcode generator is working a little differently:
CMakeLists.txt:
add_library(foo tst.cpp)
add_library(bar tst.cpp)
add_library(baz tst.cpp)
add_subdirectory(sub)
sub/CMakeLists.txt:
add_library(sub_foo ../tst.cpp)
add_library(sub_bar ../tst.cpp)
add_library(sub_baz ../tst.cpp)
compare:
afaict the target order is currently:
- targets of each
CMakeLists.txt
file are added one after the other - targets inside a
CMakeLists.txt
file are added in reverse order of their appearance -
ALL_BUILD
is added to the end of the targets in the rootCMakeLists.txt
(but before the targets added by otherCMakeLists.txt
files). -
Products
andFrameworks
are added at the end - additional observation: if i'm setting
CMAKE_FOLDER
in the rootCMakeLists.txt
file, theALL_BUILD
target ends up in this folder, too, whileProducts
andFrameworks
are still in the root folder
i'm working on a cmake project with hundreds of targets (dozens in the same FOLDER
). having each folder sorted lexicographically would be the preferred solution as it brings the UX in line with other IDEs.