[CMake] Improving the Xcode generator

Matthew Bentham mjb67 at artvps.com
Sat Feb 5 07:51:27 EST 2011


Hi all,

Having used the Xcode generator for a while I was thinking about contributing some improvements.  If anyone thinks these ideas sound insane (or has tried before and failed) I won't go ahead with a feasibility investigation.

The generator causes Xcode to run 'make' a couple of times for every target on every build.  These can take a while to execute if the caches aren't warm.

I wondered if it would be cleaner/faster to implement more stuff in Xcode rather than calling out to make.

Idea 1) The 'CMake ReRun' custom script depends on all included CMake modules and CMakeLists.txt and regenerates CMakeFiles/cmake.check_cache.  This could be implemented as an Xcode target on which all other targets depend, rather than a makefile run on every build in every target.

Idea 2) Link libraries are passed directly in the xcode linker flags option.  If they were passed as sources of a 'link binary with libraries' build phase, the 'XCODE_DEPEND_HELPER.make' rule could be omitted from the 'CMake PostBuild Rules' custom script phase.  For many simple library targets, that would mean that the CMake PostBuild Rules phase would be empty and could be omitted.

Sound plausible?

All the best,

Matthew Bentham
ArtVPS


More information about the CMake mailing list