Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GatherHeadersAndSources.h
Go to the documentation of this file.
16  # gather all possible C++ and Qt sources
17  if (${ARGC} EQUAL 1)
18  file(GLOB_RECURSE HEADERS *.h)
19  file(GLOB_RECURSE SRCS *.cpp *.c)
20  file(GLOB_RECURSE File_UI *.ui)
21  file(GLOB_RECURSE File_QRC *.qrc)
22  else()
23  # if an optional parameter is used, gather everything from BaseDirectory
24  file(GLOB_RECURSE HEADERS ${ARGV1}/*.h )
25  file(GLOB_RECURSE SRCS ${ARGV1}/*.cpp *.c)
26  file(GLOB_RECURSE File_UI ${ARGV1}/*.ui )
27  file(GLOB_RECURSE File_QRC ${ARGV1}/*.qrc )
28  endif()
29 
30  # manage Qt ui
31  qt4_wrap_ui (UI ${File_UI})
32 
33  # manage Qt resources
34  qt4_add_resources(QRC ${File_QRC})
35 
36  # find Q_OBJECT derived class
37  foreach(HEADER ${HEADERS})
38  file(READ ${HEADER} stream)
39  if(stream MATCHES "Q_OBJECT")
40  set(MOC_SOURCES ${MOC_SOURCES} ${HEADER})
41  endif(stream MATCHES "Q_OBJECT")
42  endforeach(HEADER)
43 
44  # manage Qt inherited sources
45  qt4_wrap_cpp(QT_SRCS ${MOC_SOURCES})
46 
47  # name all headers
48  set (${Name}_HEADERS
49  ${HEADERS}
50  ${UI}
51  ${QRC}
52  )
53 
54  # name all sources
55  set (${Name}_SOURCES
56  ${HEADERS}
57  ${UI}
58  ${QRC}
59  ${SRCS}
60  ${QT_SRCS}
61  )
62 end(){)
CamiTK CamiTKDir txt file(STRINGS"${FIND_CAMITK_USER_BASE_DIR}/CamiTK/CamiTKDir.txt"FIND_CAMITK_USER_DIR_LAST_INSTALL) endif() find_program(CAMITK_CONFIG_EXECUTABLE NAMES camitk-config-debug camitk-config PATH_SUFFIXES"bin"PATHS"$
Definition: FindCamiTK.cmake:80
gather_headers_and_sources()
macro gather_headers_and_sources find all headers, sources, including the qt ui, moc and resources an...
Definition: GatherHeadersAndSources.h:15