How clean generated build system files

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How clean generated build system files

lzprgmr
Hi, All,

Is there any way to clean the generated build system files, like vs project files, make files, it might be ok if generate out-of-place, but for in-place files, it is really a pain if you want to remove those files, especially there are a lot of projects and directories. Ideally, I would expect there is a command like:

    cmake -clean

(I used to use premake, which has a nice action called "clean", so you can: premake4 clean to remove generated files)

Thanks.




--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How clean generated build system files

Andreas Pakulat-2
Hi,

On Sat, Nov 3, 2012 at 12:40 PM, lzprgmr <[hidden email]> wrote:
> Is there any way to clean the generated build system files, like vs project
> files, make files, it might be ok if generate out-of-place, but for in-place

Thats why cmake advertises out of source builds to be used all the time.

> files, it is really a pain if you want to remove those files, especially
> there are a lot of projects and directories. Ideally, I would expect there
> is a command like:
>
>     cmake -clean

That would require cmake to know about all source files which may or
may not be the case depending on your cmake rules. So no there is no
such thing at the moment.

Andreas
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How clean generated build system files

Bogdan Cristea
In reply to this post by lzprgmr
rm CMakeCache.txt
 
Sent from my Windows 8 PC
 
From: lzprgmr <[hidden email]>
Sent: Saturday, November 3, 2012 12:41:35 PM
To: [hidden email]
Subject: [CMake] How clean generated build system files
 
Hi, All,

Is there any way to clean the generated build system files, like vs project files, make files, it might be ok if generate out-of-place, but for in-place files, it is really a pain if you want to remove those files, especially there are a lot of projects and directories. Ideally, I would expect there is a command like:

    cmake -clean

(I used to use premake, which has a nice action called "clean", so you can: premake4 clean to remove generated files)

Thanks.




--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How clean generated build system files

lzprgmr
In reply to this post by Andreas Pakulat-2
Thanks guys, so it is not supported currently in cmake for whatever reasons.

>>That would require cmake to know about all source files which may or may not be the case depending on your cmake rules
I am not quite familiar with how cmake works, but in premake, user who write new rules is responsible for removing the file he generated, ex:
if _ACTION == 'clean'
    -- remove the files you generated
end

Anyway, I've already got my answer, and out-of-place approach is actually enough for me.


On Sun, Nov 4, 2012 at 12:43 AM, Andreas Pakulat <[hidden email]> wrote:
Hi,

On Sat, Nov 3, 2012 at 12:40 PM, lzprgmr <[hidden email]> wrote:
> Is there any way to clean the generated build system files, like vs project
> files, make files, it might be ok if generate out-of-place, but for in-place

Thats why cmake advertises out of source builds to be used all the time.

> files, it is really a pain if you want to remove those files, especially
> there are a lot of projects and directories. Ideally, I would expect there
> is a command like:
>
>     cmake -clean

That would require cmake to know about all source files which may or
may not be the case depending on your cmake rules. So no there is no
such thing at the moment.

Andreas


--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How clean generated build system files

Bogdan Cristea
In reply to this post by Bogdan Cristea


Thanks Cristea, but how about the project files or make files?

Not sure, but I think they are regenerated. If this is all that you want it might be the best way.




--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: How clean generated build system files

Clifford Yapp
In reply to this post by lzprgmr

On Sun, Nov 4, 2012 at 4:45 AM, lzprgmr <[hidden email]> wrote:
Thanks guys, so it is not supported currently in cmake for whatever reasons.

It's not supported as a direct feature, to the best of my knowledge. 

That said, it is technically possible to do - it just requires you to create your own system on top of CMake.  The BRL-CAD project implements such a system. To see how, check out how we implement our "distclean" target - that command restores the source directory to pristine condition.  Be warned - it's one of the more complex aspects of our build system and depends on a number of other customizations.  If an out-of-source-dir solution is sufficient, I wouldn't advise complicating your build logic - we had most of the pieces in place for other reasons, so for us distclean was a fairly minimal step on top of them.

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake