Computer Assited Medical Intervention Tool Kit  version 3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GetSubdirectories.h
Go to the documentation of this file.
1 get_subdirectories(){ Name)
20  set(Name)
21  file(GLOB LS *)
22 
23  # continue process only if there is some file to process
24  if (LS)
25  foreach(FILENAME ${LS})
26  if(IS_DIRECTORY ${FILENAME} AND EXISTS ${FILENAME}/CMakeLists.txt)
27  get_directory_name(${FILENAME} DIRNAME)
28  # ignore .svn
29  if (NOT ${DIRNAME} STREQUAL ".svn")
30  set(${Name} ${${Name}} ${DIRNAME})
31  endif()
32  endif()
33  endforeach()
34 
35  # create the copy of Name list
36  set(NameSorted)
37  foreach(filename ${Name})
38  string(TOLOWER "${filename}" filenameLower)
39  # build a new variable (map) to associate the key filenameLower to the real filename
40  set("map_${filenameLower}" "${filename}")
41  # add the key to a specific list
42  set(NameSorted ${NameSorted} "${filenameLower}")
43  endforeach()
44 
45  # sort the key list (all lowercase)
46  list(SORT NameSorted)
47 
48  foreach(filenameLower ${NameSorted})
49  # get the filename from the lower case name
50  set(Name ${map_${filenameLower}})
51  endforeach()
52  endif()
53 
54 end(){)
string name
Definition: select.cpp:111
get_directory_name()
macro get_directory_name set the variable VariableName to the name of the last directory of FullPathD...
Definition: GetDirectoryName.h:14
set(CAMITK_TEST_COMMAND_FILE ${CAMITK_TEST_OUTPUT_DIR}/command) set(CAMITK_TEST_COMMAND_RESULT_FILE $
This CMake file run a command and put the output in a given file.
Definition: CamiTKTestPassFile.h:11
string filename
Definition: pml2csv.cpp:109
get_subdirectories()
macro get_subdirectories get the names of all the subdirectories that contains a CMakeLists.txt in case insensitive alphabetical order
Definition: GetSubdirectories.h:19