Author: akhaldi
Date: Sun Apr 1 11:43:24 2012
New Revision: 56299
URL:
http://svn.reactos.org/svn/reactos?rev=56299&view=rev
Log:
[CMAKE]
* Implement the _clean targets for the ninja generator.
Modified:
trunk/reactos/cmake/CMakeMacros.cmake
Modified: trunk/reactos/cmake/CMakeMacros.cmake
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?re…
==============================================================================
--- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original)
+++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Sun Apr 1 11:43:24 2012
@@ -222,16 +222,20 @@
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 /nologo clean)
- endif()
- add_custom_target(${target}_clean
- COMMAND ${CLEAN_COMMAND}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMENT "Cleaning ${target}")
+function(add_clean_target _target)
+ set(_clean_working_directory ${CMAKE_CURRENT_BINARY_DIR})
+ if(CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL
"MinGW Makefiles")
+ set(_clean_command make clean)
+ elseif(CMAKE_GENERATOR STREQUAL "NMake Makefiles")
+ set(_clean_command nmake /nologo clean)
+ elseif(CMAKE_GENERATOR STREQUAL "Ninja")
+ set(_clean_command ninja -t clean ${_target})
+ set(_clean_working_directory ${REACTOS_BINARY_DIR})
+ endif()
+ add_custom_target(${_target}_clean
+ COMMAND ${_clean_command}
+ WORKING_DIRECTORY ${_clean_working_directory}
+ COMMENT "Cleaning ${_target}")
endfunction()
if(NOT MSVC_IDE)