[CMake] A CMake project called Help?

Bill Hoffman bill.hoffman at kitware.com
Fri Jun 10 11:29:35 EDT 2011


On 6/10/2011 10:50 AM, Alan Garny wrote:
> Hi,
>
> I have a CMake project with several sub-projects (plugins for my
> application), one of which is called “Help”. Now, everything works fine
> in that it compiles and builds as expected. However, I do get a couple
> of warnings:
>
> makefile:1227: warning: overriding commands for target `Help'
>
> makefile:257: warning: ignoring old commands for target `Help'
>
> After checking the generated makefile, the issue is (obviously) that
> there are two targets called “Help”. One for my plugin and another so
> that one can call “make help”.
>
> Now, is there a way to avoid this conflict, keeping in mind that I want
> my plugin to keep being called Help…? I was hoping for some kind of a
> CMake setting that would pre/ap-pend some text to a target name and thus
> avoid the conflict, but I couldn’t find anything like that…?
>

I would change the name of your target to help_something, then use 
OUTPUT_NAME to change it back to help.

set_target_properties(MyHelp  PROPERTIES OUTPUT_NAME Help)


-Bill


More information about the CMake mailing list