summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-02-07 19:50:45 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-02-07 19:50:45 (GMT)
commit5586c6f41bdc94691c12c7eadf818d90c147cf13 (patch)
treee55f53efe799c3fc42714f0c019f609607a499c7 /Modules
parent8b567083da868ede87ec675b641fc0fd43b4864a (diff)
downloadCMake-5586c6f41bdc94691c12c7eadf818d90c147cf13.zip
CMake-5586c6f41bdc94691c12c7eadf818d90c147cf13.tar.gz
CMake-5586c6f41bdc94691c12c7eadf818d90c147cf13.tar.bz2
ENH: now also the "ecosclean" target works with MS nmake
Alex
Diffstat (limited to 'Modules')
-rw-r--r--Modules/UseEcos.cmake9
-rw-r--r--Modules/ecos_clean.cmake12
2 files changed, 16 insertions, 5 deletions
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake
index c23b236..73d3f2a 100644
--- a/Modules/UseEcos.cmake
+++ b/Modules/UseEcos.cmake
@@ -151,6 +151,8 @@ MACRO(ECOS_ADD_TARGET_LIB)
ADD_CUSTOM_TARGET( ecos make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos/ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile )
ENDMACRO(ECOS_ADD_TARGET_LIB)
+# get the directory of the current file, used later on in the file
+GET_FILENAME_COMPONENT( ECOS_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
#macro for creating an executable ecos application
#the first parameter is the name of the executable,
@@ -204,13 +206,10 @@ MACRO(ECOS_ADD_EXECUTABLE _exe_NAME )
ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.bin;${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.srec;${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst;"
)
-#cd $1; ls -a | grep --invert-match -e "\(.*CVS\)\|\(.*ecos\.ecc\)" | xargs rm -rf; touch ecos.ecc
- ADD_CUSTOM_TARGET(ecosclean sh -c \"cd ${CMAKE_CURRENT_BINARY_DIR}/ecos\; ls | grep --invert-match -e \\\"\\\(.*CVS\\\)\\|\\\(.*ecos\\.ecc\\\)\\\" |xargs rm -rf\; touch ${ECOS_CONFIG_FILE} \")
- ADD_CUSTOM_TARGET(normalclean ${CMAKE_MAKE_PROGRAM} clean -C ${CMAKE_CURRENT_BINARY_DIR})
+ ADD_CUSTOM_TARGET(ecosclean ${CMAKE_COMMAND} -DECOS_DIR=${CMAKE_CURRENT_BINARY_DIR}/ecos/ -P ${ECOS_CMAKE_MODULE_DIR}/ecos_clean.cmake )
+ ADD_CUSTOM_TARGET(normalclean ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
ADD_DEPENDENCIES (ecosclean normalclean)
- ADD_DEPENDENCIES(ecosclean clean)
-
ADD_CUSTOM_TARGET( listing
COMMAND echo -e \"\\n--- Symbols sorted by address ---\\n\" > ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
diff --git a/Modules/ecos_clean.cmake b/Modules/ecos_clean.cmake
new file mode 100644
index 0000000..57af343
--- /dev/null
+++ b/Modules/ecos_clean.cmake
@@ -0,0 +1,12 @@
+file(GLOB _files ${ECOS_DIR}/*)
+
+# remove all directories, which consist of lower-case letters only
+# this skips e.g. CVS/ and .subversion/
+foreach(_entry ${_files})
+ if(IS_DIRECTORY ${_entry})
+ get_filename_component(dir ${_entry} NAME)
+ if(${dir} MATCHES "^[a-z]+$")
+ file(REMOVE_RECURSE ${_entry})
+ endif(${dir} MATCHES "^[a-z]+$")
+ endif(IS_DIRECTORY ${_entry})
+endforeach(_entry)