[Cmake] Removing cmake generated files

Jan Woetzel jw at mip . informatik . uni-kiel . de
Thu, 19 Jun 2003 13:12:44 +0200


This is a multi-part message in MIME format.
--------------040502090206090306030205
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Cody Batt wrote:

> I want to be able to tell cmake to remove all of the generated 
> makefiles/projects, *.cmake, cmake.* and CMakeTmp etc.  ...

As a quick workaround I added a target "distclean" (under Linux).

The attached file "TargetDistclean.cmake" is adding a manually cleaning
target.
To keep teh projects CMakeLists.txt clean it is placed in cmakes Modules
directory and included with

# --- custom targets: ---
INCLUDE( ${CMAKE_ROOT}/Modules/TargetDistclean.cmake OPTIONAL)


Best regards,
Jan.

-- 

   Dipl.-Ing. Jan Woetzel
--------------------------------------------------
   University of Kiel
   Institute of Computer Science and Applied Mathematics
   Hermann-Rodewald-Str. 3 [room 401]
   24098 Kiel/Germany
--------------------------------------------------
   Url   www.mip.informatik.uni-kiel.de/~jw
   Email jw at mip . informatik . uni-kiel . de



--------------040502090206090306030205
Content-Type: text/plain;
 name="TargetDistclean.cmake"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="TargetDistclean.cmake"

# add custom target distclean
# cleans and removes cmake generated files etc.
# Jan Woetzel 04/2003
#

IF (UNIX)
  ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
  SET(DISTCLEANED
   cmake.depends
   cmake.check_depends
   CMakeCache.txt
   cmake.check_cache
   *.cmake
   Makefile
   core core.*
   gmon.out
   *~
  )
  
  ADD_CUSTOM_COMMAND(
    DEPENDS clean
    COMMENT "distribution clean"
    COMMAND rm
    ARGS    -Rf CMakeTmp ${DISTCLEANED}
    TARGET  distclean
  )
ENDIF(UNIX)




--------------040502090206090306030205--