[CMake] Run clean before automatically re-running cmake?

Abe Bachrach abachrach at gmail.com
Sat Feb 22 12:08:14 EST 2014


Agreed that it is a bit heavyweight, but the stray files have resulted in
some pretty cryptic issues in the past (targets linking against an old
version of a library that got renamed etc...).

Your idea sounds good... I'll give it a try.

Thanks!
-=Abe

On Fri, Feb 14, 2014 at 8:55 AM, Bill Hoffman <bill.hoffman at kitware.com>wrote:

> On 2/14/2014 11:00 AM, Abe Bachrach wrote:
>
>> I'd only want to do a full build if one of the CMakeLists.txt has
>> changed (cmake needs to get re-run). Otherwise, I'd like to do a normal
>> build.
>>
> That seems a bit over kill to me.  I would rather have a few extra files
> than having a complete clean done each time a new file is added or a flag
> is changed in a CMake file.  Here is what you should do....
>
> 1. create a list of all the targets in your project
> 2. use configure file to save the list, but be tricky so that it saves the
> last version of the file as well.
> 3. add a custom command that all your targets depend on.  The custom
> command should depend on the file that is configured.  It will get run only
> when the file changes if you use copy on different.  When the custom
> command runs it should diff the two files and figure out what target went
> away, and then remove it.
>
> Basically, you should be able to do this all from the CMake language with
> custom commands and a CMake script.
>
> -Bill
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140222/bde7994b/attachment.html>


More information about the CMake mailing list