3 #
this functions gets a filelist as input and looks
4 #
for corresponding h-files to add them to the project.
6 # additionally files are grouped
in source-groups.
8 # No parameters explicitly declared here, because
9 # we want to allow
for variable argument lists, which
10 # are later accessed by the keyword
foreach(MYFILE ${ARGV})
12 # output: after calling the macro, files that were found
13 # correspondigly to the given files are stored
in the
15 # ${CORRESPONDING_H_FILES}
16 # ${CORRESPONDING_TXX_FILES}
17 # ${CORRESPONDING_UI_H_FILES}
19 # Globbed can be found in the variables
20 # ${GLOBBED_TXX_FILES} (CURRENTLY COMMENTED OUT)
21 # ${GLOBBED_DOX_FILES}
23 cmake_parse_arguments(_ORG
"" "" "HEADER;SOURCE;TXX;DOC;MOC;GEN_QRC;GEN_UI;META;UI;QRC" ${ARGN})
25 set(CORRESPONDING__H_FILES
"")
26 set(GLOBBED__H_FILES "")
29 foreach(_file ${_ORG_SOURCE})
30 string(REGEX REPLACE
"(.*)\\.(txx|cpp|c|cxx)$" "\\1.h" H_FILE ${_file})
31 if(EXISTS
"${CMAKE_CURRENT_SOURCE_DIR}/${H_FILE}")
32 list(APPEND CORRESPONDING__H_FILES "${H_FILE}
")
36 file(GLOB_RECURSE GLOBBED__H_FILES *.h)
39 set(CORRESPONDING__H_FILES ${CORRESPONDING__H_FILES} PARENT_SCOPE)
40 set(GLOBBED__H_FILES ${GLOBBED__H_FILES} PARENT_SCOPE)
42 if(_ORG_GEN_QRC OR _ORG_GEN_UI OR _ORG_MOC)
43 source_group("Generated\\Qt QRC Source Files
" FILES ${_ORG_GEN_QRC})
44 source_group("Generated\\Qt UI Header Files
" FILES ${_ORG_GEN_UI})
45 source_group("Generated\\Qt MOC Source Files
" FILES ${_ORG_MOC})
48 #_MACRO_APPEND_TO_LIST(_ORG_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/
")
49 source_group("== Source Files ==
" FILES ${_ORG_SOURCE})
51 #_MACRO_APPEND_TO_LIST(_ORG_TXX "${CMAKE_CURRENT_SOURCE_DIR}/
")
52 source_group("== Template Files ==
" FILES ${_ORG_TXX})
54 #_MACRO_APPEND_TO_LIST(_ORG_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/
")
55 source_group("== Header Files ==
" FILES ${_ORG_HEADER} ${CORRESPONDING__H_FILES} ${GLOBBED__H_FILES})
58 #_MACRO_APPEND_TO_LIST(_ORG_UI "${CMAKE_CURRENT_SOURCE_DIR}/
")
59 source_group("QT UI Files
" FILES ${_ORG_UI})
63 #_MACRO_APPEND_TO_LIST(_ORG_DOC "${CMAKE_CURRENT_SOURCE_DIR}/
")
64 source_group("Doxygen Files
" FILES ${_ORG_DOC})
68 #_MACRO_APPEND_TO_LIST(_ORG_QRC "${CMAKE_CURRENT_SOURCE_DIR}/
")
69 source_group("Qt Resource Files
" FILES ${_ORG_QRC})
73 source_group("Plugin META Files
" FILES ${_ORG_META})
78 macro(_MACRO_APPEND_TO_LIST _list _value)
79 set(_origlist ${${_list}})
81 foreach(_element ${_origlist})
82 list(APPEND ${_list} "${_value}${_element}
")
mitkFunctionOrganizeSources()
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)