[CMake] Redefine target in nested project

Marcel Loose loose at astron.nl
Mon Apr 27 09:33:39 EDT 2009


Hi all,

I was wondering whether it's possible to somehow redefine an existing
target within a nested project. Let me give an example.

Suppose my CMake project has the following structure

bigproject
  subproject_1
  subproject_2

where bigproject, subproject_1 and subproject_2 are all CMake projects
(i.e., their CMakeLists.txt files all contain a project() command).

Now, suppose there's some generic target (e.g. 'check') that I would
like to be defined for each of these projects, such that I can do

  $ cd /path/to/build/directory/bigproject && make check

but also

  $ cd /path/to/build/directory/bigproject/subproject_1 && make check

Is this possible at all?

Best regards,
Marcel Loose.





More information about the CMake mailing list