The way to do this is to add a false target consisting of all the sources for each of the library goals in CMake. An example of CMakeLists.txt might be ...
set(ONE_SRC one/a.c one/b.c)
set(TWO_SRC two/a.c two/b.c)
add_library(all ${ONE_SRC} ${TWO_SRC})
add_library(one ${ONE_SRC})
add_library(two ${TWO_SRC})
add_dependencies(one all)
add_dependencies(two one)
Liball.so goal is to compile all the sources needed for all other libraries, and it should break the false relationship between source files and libone.so libtwo.so at startup make, ninjaregardless of whether ... it will be possible to compile the parallelism of purpose.
CMake ${ONE_SRC} ${TWO_SRC} . ccache, . .
ccache ccache $PATH.
jason@io ~ $ ll ~/bin/ccache
total 0
lrwxrwxrwx 1 jason jason 15 May 12 2013 c++ -> /usr/bin/ccache*
lrwxrwxrwx 1 jason jason 15 May 12 2013 cc -> /usr/bin/ccache*
lrwxrwxrwx 1 jason jason 15 Apr 27 21:38 clang -> /usr/bin/ccache*
lrwxrwxrwx 1 jason jason 15 Apr 27 21:38 clang++ -> /usr/bin/ccache*
lrwxrwxrwx 1 jason jason 15 May 12 2013 g++ -> /usr/bin/ccache*
lrwxrwxrwx 1 jason jason 15 Oct 6 2013 gcc -> /usr/bin/ccache*
lrwxrwxrwx 1 jason jason 15 May 12 2013 x86_64-pc-linux-gnu-c++ -> /usr/bin/ccache*
lrwxrwxrwx 1 jason jason 15 May 12 2013 x86_64-pc-linux-gnu-g++ -> /usr/bin/ccache*
lrwxrwxrwx 1 jason jason 15 May 12 2013 x86_64-pc-linux-gnu-gcc -> /usr/bin/ccache*
ccache .
export CCACHE_DIR="/var/ccache/${USER}"
export CCACHE_SIZE="4G"
export CCACHE_COMPRESS="1"