[CMake] Custom target

Ian Liu Rodrigues ian.liu88 at gmail.com
Wed Jun 5 13:06:25 EDT 2013


Dear all,

Is it possible to create a target for all sub-directories with the
same name? For instance, I want to create a "benchmark" target so that
every subdir implements a way of bench-marking its own program.

I tried adding a "add_custom_target(benchmark ...)" in the
CMakeLists.txt of each subdir, but cmake complains about duplicate
target names.

Thanks in advance,
Ian L. Rodrigues


More information about the CMake mailing list