Hi Thomas,
I created a SuperBuild that builds ITK, VTK and CTK separately, and then MITK.
When I build MITK, I set the variables ITK_DIR, VTK_DIR, CTK_DIR etc:
ExternalProject_Add(${proj}
GIT_REPOSITORY ${GIT_PROTOCOL}://git.mitk.org/MITK.git/
BINARY_DIR ${proj}-build
UPDATE_COMMAND ""
INSTALL_COMMAND ""
CMAKE_GENERATOR ${GEN}
CMAKE_CACHE_ARGS
${EP_COMMON_ARGS}
-DDESIRED_QT_VERSION:STRING=4
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-DMITK_BUILD_TUTORIAL:BOOL=OFF
-DMITK_USE_BLUEBERRY:BOOL=ON
-DADDITIONAL_C_FLAGS:STRING=${UCLTK_ADDITIONAL_C_FLAGS}
-DADDITIONAL_CXX_FLAGS:STRING=${UCLTK_ADDITIONAL_CXX_FLAGS}
-DGDCM_DIR:PATH=${GDCM_DIR} # FindGDCM
expects GDCM_DIR
-DVTK_DIR:PATH=${VTK_DIR} # FindVTK
expects VTK_DIR
-DITK_DIR:PATH=${ITK_DIR} # FindITK
expects ITK_DIR
-DCTK_DIR:PATH=${CTK_DIR} # FindCTK
expects CTK_DIR
-DMITK_INITIAL_CACHE_FILE:FILEPATH=${MITK_INITIAL_CACHE_FILE}
DEPENDS ${proj_DEPENDENCIES}
)
SET(MITK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/${proj}-build)
MESSAGE("SuperBuild loading MITK from ${MITK_DIR}")
Then, once all the dependencies are built, I use:
SET(MITK_USE_BLUEBERRY 1)
SET(MITK_USE_EXT 1)
FIND_PACKAGE(MITK)
IF(MITK_FOUND)
MESSAGE("Found MITK")
# Add in the MITK CMake macros.
SET(CMAKE_MODULE_PATH
${MITK_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH}
)
LINK_DIRECTORIES(${MITK_LINK_DIRECTORIES})
ELSE(MITK_FOUND)
MESSAGE("Didn't find MITK")
ENDIF(MITK_FOUND)
To pick up MITK. I don't do anything to pick up CTK.
I have a directory structure like this:
Gui/MITK/Apps
Gui/MITK/Modules
Gui/MITK/Plugins
within GUI/MITK I have a CMakeLists.txt .... which contains stuff like:
IF(UCLTK_GENERATE_DOXYGEN_HELP)
SET(BLUEBERRY_USE_QT_HELP ON)
ENDIF(UCLTK_GENERATE_DOXYGEN_HELP)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/${MODULES_CONF_DIRNAME})
MARK_AS_ADVANCED(${MY_PROJECT_NAME}_INSTALL_RPATH_RELATIVE
${MY_PROJECT_NAME}_BUILD_ALL_PLUGINS
)
IF(MITK_USE_QT)
SET(QT_QMAKE_EXECUTABLE ${MITK_QMAKE_EXECUTABLE})
ADD_DEFINITIONS(-DQWT_DLL)
ENDIF()
####################################################################################
# On Mac OSX all CTK plugins get copied into every application bundle.
####################################################################################
SET(MACOSX_BUNDLE_NAMES)
IF(APPLE)
LIST(APPEND MACOSX_BUNDLE_NAMES ${UCLTK_MITK_GUI_APPLICATION_NAMES} )
ENDIF(APPLE)
####################################################################################
# Add 'Modules', i.e. shared libs
####################################################################################
# This project's directory holding module config files
set(${MY_PROJECT_NAME}_MODULES_CONF_DIR
"${PROJECT_BINARY_DIR}/${MODULES_CONF_DIRNAME}")
# Append this projects's module config directory to the global list
# (This is used to get include directories for the <module_name>Exports.h files
right)
list(APPEND MODULES_CONF_DIRS ${${MY_PROJECT_NAME}_MODULES_CONF_DIR})
# Clean the modulesConf directory. This ensures that modules are sorted
# according to their dependencies in the Modules/CMakeLists.txt file
file(GLOB _modules_conf_files ${${MY_PROJECT_NAME}_MODULES_CONF_DIR}/*.cmake)
if(_modules_conf_files)
file(REMOVE ${_modules_conf_files})
endif()
ADD_SUBDIRECTORY(Modules)
####################################################################################
# Create all CTK plugins.
####################################################################################
macro(GetMyTargetLibraries all_target_libraries varname)
set(re_ctkplugin "^uk_ac_ucl_[a-zA-Z0-9_]+$")
set(_tmp_list)
list(APPEND _tmp_list ${all_target_libraries})
ctkMacroListFilter(_tmp_list re_ctkplugin OUTPUT_VARIABLE ${varname})
endmacro()
include(${CMAKE_CURRENT_SOURCE_DIR}/Plugins/Plugins.cmake)
ctkMacroSetupExternalPlugins(${PROJECT_PLUGINS}
BUILD_OPTION_PREFIX ${MY_PROJECT_NAME}_
BUILD_ALL ${${MY_PROJECT_NAME}_BUILD_ALL_PLUGINS})
####################################################################################
# Add subdirectories, one for each application listed above.
####################################################################################
FOREACH(app ${UCLTK_MITK_GUI_APPLICATION_NAMES})
ADD_SUBDIRECTORY(Apps/${app})
ENDFOREACH()
I hope this helps.
Matt
On 13 Oct 2011, at 16:39, Thomas Wolf wrote:
On 13.10.2011 17:08, Clarkson, Matt wrote:
Ah.. sorry, yes, thats what I meant.
All my plugins have always been CTK ones, so I'm not sure I can help further. I
have an external project that is similar, but not exactly like the
MITK-Template, is that the same as you?
Matt
mhm, well, as we have some trouble getting the new CTK stuff to work, i
decided to remodel our ExtApp style executable project as similar as the
project template...
in our project, CTK will be previously build and found via finmd
package, whereas in our main build MITK was included with
add_subdirectory. This has the advantage that you can see the full
sorucecode in visual studio.. at the end some copying takes place so we
need no batch files to start the app in debug/release, but otherwise it
sticks to the MITK build definitions.
How did you do it?
Anyway, is still wonder how my extapp can find the MITK plugins, which
are built in the same makefile run (and definitly exist) just before our
Extapp. Is it maybe some file that has to be included?
Regards,
Thomas
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users