mirror of
https://github.com/reactos/reactos.git
synced 2025-04-28 01:11:35 +00:00
[CMAKE]
* Add module_clean targets. svn path=/trunk/; revision=51857
This commit is contained in:
parent
0c077106ad
commit
f1cd9d77bb
1 changed files with 23 additions and 0 deletions
|
@ -204,3 +204,26 @@ function(add_cd_file)
|
|||
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()
|
||||
|
|
Loading…
Reference in a new issue