1 Aug 2008 01:08
Re: Recursive custom target
On 2008-07-31 19:07-0000 Piotr JaroszyĆ~Dski wrote: >>> is it possible to add a custom target so that it would be visible in >>> all the subdirectories? >> >> My experience is that targets are actually available in all directories. > > $ mkdir /tmp/test > $ cd /tmp/test > $ echo "add_custom_target(bar)" > CMakeLists.txt > $ echo "add_subdirectory(foo)" >> CMakeLists.txt > $ mkdir foo > $ cmake . > > $ make bar > Built target bar > $ cd foo && make bar > make: *** No rule to make target `bar'. Stop. > > $ cmake --version > cmake version 2.4-patch 8 I misunderstood your original request to mean "how to gain access to targets within cmake", and my reply answers that question. AFAIK, targets are available to _make_ (as opposed to cmake) in the directory where they are defined by cmake and also in the top-level directory. However, the targets are not available in any other directory than those two as confirmed by your example and also by some private experiments I just did.(Continue reading)
RSS Feed