Author: akhaldi
Date: Mon May 23 10:52:37 2011
New Revision: 51857
URL:
http://svn.reactos.org/svn/reactos?rev=51857&view=rev
Log:
[CMAKE]
* Add module_clean targets.
Modified:
trunk/reactos/CMakeMacros.cmake
Modified: trunk/reactos/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/CMakeMacros.cmake?rev=5185…
==============================================================================
--- trunk/reactos/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/CMakeMacros.cmake [iso-8859-1] Mon May 23 10:52:37 2011
@@ -204,3 +204,26 @@
endif()
endif() #end bootcd
endfunction()
+
+# Create module_clean targets
+function(add_clean_target target)
+ if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR MATCHES
"MinGW Makefiles")
+ set(CLEAN_COMMAND make clean)
+ elseif(CMAKE_GENERATOR MATCHES "NMake Makefiles")
+ set(CLEAN_COMMAND nmake clean)
+ endif()
+ add_custom_target(${target}_clean
+ COMMAND ${CLEAN_COMMAND}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Cleaning ${target}")
+endfunction()
+
+function(add_library name)
+ _add_library(${name} ${ARGN})
+ add_clean_target(${name})
+endfunction()
+
+function(add_executable name)
+ _add_executable(${name} ${ARGN})
+ add_clean_target(${name})
+endfunction()