Skip to content

Commit

Permalink
added distclean target to cmake
Browse files Browse the repository at this point in the history
for better cleanup when making releases
also added cmake build files in .gitignore
  • Loading branch information
jaromil committed Sep 13, 2010
1 parent 1b751bd commit 5d825c4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tags
*.so
*.la
*.lo
*.cmake
cmake_install.cmake
CMakeFiles
CMakeCache.txt
*~
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ set (LIBDIR lib/frei0r-1)
set (FREI0R_DEF ${CMAKE_SOURCE_DIR}/msvc/frei0r_1_0.def)
set (FREI0R_1_1_DEF ${CMAKE_SOURCE_DIR}/msvc/frei0r_1_1.def)

# --- custom targets: ---
INCLUDE( cmake/modules/TargetDistclean.cmake OPTIONAL)

add_subdirectory (src)
28 changes: 28 additions & 0 deletions cmake/modules/TargetDistclean.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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)

0 comments on commit 5d825c4

Please sign in to comment.