3 set(libraryname ${ARGV0})
5 set(reallycreatelibrary TRUE)
7 if(${ARGC} EQUAL 2) #
this won
't work without the ${}, don't understand the cmake documentation
8 set(reallycreatelibrary FALSE)
11 #
if used inside MITK core, we fill variables
in files.cmake
12 include(tools.cmake OPTIONAL)
19 foreach( TOOL_FILE ${TOOL_FILES} )
21 # construct tool name from file name
22 string(REGEX REPLACE
".*(^|[/\\])mitk(.+)\\.c(pp|xx)$" "\\2" TOOL_NAME ${TOOL_FILE})
23 message(STATUS
"Adding segmentation tool: ${TOOL_NAME}")
25 # source file names for this tool
26 set( TOOL_CPPS ${TOOL_FILE} ${TOOL_CPPS} )
28 # remember factory name
for a central
register call
29 endforeach( TOOL_FILE ${TOOL_FILES} )
38 foreach( TOOL_GUI_FILE ${TOOL_QTGUI_FILES})
40 # construct tool name from file name
41 string(REGEX REPLACE
"^Qmitk(.+)GUI\\.c(pp|xx)$" "\\1" TOOL_NAME ${TOOL_GUI_FILE})
42 string(REGEX REPLACE
"\\.c(pp|xx)$" ".h" TOOL_GUI_HEADER ${TOOL_GUI_FILE})
43 message(STATUS
"Adding GUI for segmentation tool: ${TOOL_NAME}")
45 # source file names for this tool
46 set( TOOL_GUI_CPPS ${TOOL_GUI_FILE} ${TOOL_GUI_CPPS} )
47 set( TOOL_GUI_MOC_H ${TOOL_GUI_HEADER} ${TOOL_GUI_MOC_H} )
48 endforeach( TOOL_GUI_FILE ${TOOL_QTGUI_FILES})
50 qt_wrap_cpp(${libraryname} TOOL_GUI_CPPS ${TOOL_GUI_MOC_H})
55 # care for additional files (should be used only with MITK external extensions)
56 if(TOOL_ADDITIONAL_CPPS)
57 set( TOOL_CPPS ${TOOL_ADDITIONAL_CPPS} ${TOOL_CPPS} )
58 endif(TOOL_ADDITIONAL_CPPS)
60 if(TOOL_ADDITIONAL_MOC_H)
61 qt_wrap_cpp(${libraryname} TOOL_GUI_CPPS ${TOOL_ADDITIONAL_MOC_H})
62 endif(TOOL_ADDITIONAL_MOC_H)
64 # in any case (GUI or non-GUI), create a shared library
65 if(TOOL_FILES OR TOOL_QTGUI_FILES)
66 if(libraryname AND reallycreatelibrary)
67 # configure one file with the itkLoad method
68 configure_file( ${MITK_DIR}/ToolExtensionITKFactoryLoader.cpp.in
69 ${PROJECT_BINARY_DIR}/mitkToolExtensionITKFactoryLoader.cpp
71 # also mark
this file
for compilation
72 set( TOOL_CPPS ${PROJECT_BINARY_DIR}/mitkToolExtensionITKFactoryLoader.cpp ${TOOL_CPPS} )
73 message(STATUS
"Creating itkLoad for external library " ${libraryname})
75 message(STATUS
"Adding library " ${libraryname})
77 # a library to wrap up everything
78 # configure a file that contains an itkObjectFactory
for this tool
79 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
81 add_library(${libraryname} SHARED ${TOOL_CPPS} ${TOOL_GUI_CPPS})
88 endif(libraryname AND reallycreatelibrary)
89 endif(TOOL_FILES OR TOOL_QTGUI_FILES)
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
MITK_GENERATE_TOOLS_LIBRARY()