Computer Assisted Medical Intervention Tool Kit  version 5.2
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  list(APPEND 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(){)
cmake modules macros camitk test endif() add_custom_target(camitk-ce-iwyu COMMAND $
Definition: CamiTKIncludeWhatYouUse.h:37
iwyu out CACHE PATH Output filename for include what you use set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXECUTABLE}) if(NOT EXISTS $
Definition: CamiTKIncludeWhatYouUse.h:22
get_subdirectories()
macro get_subdirectories get the names of all the subdirectories that contains a CMakeLists....
Definition: GetSubdirectories.h:19
get_directory_name()
macro get_directory_name set the variable VariableName to the name of the last directory of FullPathD...
Definition: GetDirectoryName.h:14