[CMake] Adding install dependency to test-target?

Aaron Turner synfinatic at gmail.com
Thu Jan 29 16:32:44 EST 2009


On Thu, Jan 29, 2009 at 12:37 PM, Alexander Neundorf
<a.neundorf-work at gmx.net> wrote:

> Yes, that doesn't work. "clean", "all", "install" are a special kind of target
> in cmake, i.e. they are not really targets, they are only created when the
> project files/makefiles are written.
>
> You could add a second COMMAND to the clean_libopts target, which does a "make
> clean" for the current cmake project (yes, that's more a workaround).

Yeah I may end up having to do that...  really annoying.  Right now,
I'm trying to figure out how to use ADDITIONAL_MAKE_CLEAN_FILES.

If I do this:

    LIST(APPEND extra_libopts_clean_files
        ./libopts/.libs/libopts.o
        ./libopts/.libs/libopts.la
        ./libopts/.libs
        ./libopts/_libs
        ./libopts/libopts.la
        ./libopts/so_locations
        ./libopts/*.o
        ./libopts/*.lo
    )

    SET_DIRECTORY_PROPERTIES(PROPERTIES
        ADDITIONAL_MAKE_CLEAN_FILES ${extra_libopts_clean_files})

I get an error about too many args to SET_DIRECTORY_PROPERTIES.  And
If I specify each file individually, it appears that only the last
takes effect (basically subsequent calls overwrite the previous
value).  Surely there is a way to specify multiple files right?

Honestly, both of these solutions are just hacks.... it seems like
cmake really should have a way to add to the 'clean' and 'install'
pseudo-targets.

-- 



-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little
temporary Safety,
deserve neither Liberty nor Safety.
    -- Benjamin Franklin


More information about the CMake mailing list