diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index 9c13ae95af..975cb0431f 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -1,62 +1,63 @@ set(MITK_DEFAULT_SUBPROJECTS MITK-Examples) #----------------------------------------------------------------------------- # Set-up example plugins #----------------------------------------------------------------------------- if(MITK_USE_BLUEBERRY) # Specify which plug-ins belong to this project macro(GetMyTargetLibraries all_target_libraries varname) set(re_ctkplugin_mitk "^org_mitk_example_[a-zA-Z0-9_]+$") set(_tmp_list) list(APPEND _tmp_list ${all_target_libraries}) ctkMacroListFilter(_tmp_list re_ctkplugin_mitk OUTPUT_VARIABLE ${varname}) endmacro() set(MITK_EXAMPLE_PLUGIN_TARGETS ) foreach(mitk_example_plugin ${MITK_EXAMPLE_PLUGINS}) ctkFunctionExtractOptionNameAndValue(${mitk_example_plugin} plugin_name plugin_value) string(REPLACE "." "_" _plugin_target ${plugin_name}) list(APPEND MITK_EXAMPLE_PLUGIN_TARGETS ${_plugin_target}) mark_as_advanced(${${_plugin_target}_option_name}) endforeach() endif() #----------------------------------------------------------------------------- # Add example executables #----------------------------------------------------------------------------- set(MITK_DIR ${PROJECT_BINARY_DIR}) set(MITK_EXPORTS_FILE_INCLUDED 1) set(_example_dirs MbiLog QtFreeRender Tutorial # Overlays# depends on QmitkExt.. ) # some examples depend on Qt 5 if (MITK_USE_Qt5) list(APPEND _example_dirs QuickRender ) elseif (MITK_USE_Qt4) list(APPEND _example_dirs QtAppExample mitkdump + mitkdumpdir ) endif() if(MITK_USE_BLUEBERRY) list(APPEND _example_dirs BlueBerryExampleLauncher ) endif() foreach(_example_dir ${_example_dirs}) add_subdirectory(${_example_dir}) endforeach() diff --git a/Examples/mitkdump/CMakeLists.txt b/Examples/mitkdump/CMakeLists.txt index 3fb634d68a..f28419c500 100644 --- a/Examples/mitkdump/CMakeLists.txt +++ b/Examples/mitkdump/CMakeLists.txt @@ -1,29 +1,9 @@ project(mitkdump) -find_package(MITK) +find_package(MITK REQUIRED) -mitk_check_module_dependencies(MODULES Qmitk DICOMReader MISSING_DEPENDENCIES_VAR _missing_deps) +mitk_check_module_dependencies(MODULES DICOMReader MISSING_DEPENDENCIES_VAR _missing_deps) if(_missing_deps) message(STATUS "mitkdump application won't be built. Missing: ${_missing_deps}") else(_missing_deps) - - # couldn't find a differnt solution - # adding "PACKAGES GDCM" to mitk_use_modules will not fix the problem - # ld seems not to get GDCM_LIBRARY_DIRS into its search path - # a (too?) simple addition to mitkFunctionUseModules does also not work - find_package(GDCM PATHS ${GDCM_DIR} REQUIRED) - link_directories(${GDCM_LIBRARY_DIRS}) - - add_executable(mitkdump mitkdump.cpp) - mitk_use_modules(TARGET mitkdump MODULES DICOMReader Qmitk) - set_property(TARGET mitkdump PROPERTY LABELS ${MITK_DEFAULT_SUBPROJECTS}) - - add_executable(mitkdumpdir mitkdumpdir.cpp) - mitk_use_modules(TARGET mitkdumpdir MODULES DICOMReader Qmitk) - set_property(TARGET mitkdumpdir PROPERTY LABELS ${MITK_DEFAULT_SUBPROJECTS}) - - foreach(subproject ${MITK_DEFAULT_SUBPROJECTS}) - add_dependencies(${subproject} mitkdump) - add_dependencies(${subproject} mitkdumpdir) - endforeach() - + mitk_create_executable(mitkdump DEPENDS DICOMReader WARNINGS_AS_ERRORS) endif() diff --git a/Examples/mitkdump/files.cmake b/Examples/mitkdump/files.cmake new file mode 100644 index 0000000000..7ac737bee1 --- /dev/null +++ b/Examples/mitkdump/files.cmake @@ -0,0 +1 @@ +set(CPP_FILES mitkdump.cpp) diff --git a/Examples/mitkdumpdir/CMakeLists.txt b/Examples/mitkdumpdir/CMakeLists.txt new file mode 100644 index 0000000000..9cf86752b5 --- /dev/null +++ b/Examples/mitkdumpdir/CMakeLists.txt @@ -0,0 +1,11 @@ +project(mitkdumpdir) +find_package(MITK REQUIRED) + +mitk_check_module_dependencies(MODULES Qmitk MISSING_DEPENDENCIES_VAR _missing_deps) +if(_missing_deps) + message(STATUS "mitkdumpdir application won't be built. Missing: ${_missing_deps}") +else(_missing_deps) + + mitk_create_executable(mitkdumpdir DEPENDS Qmitk WARNINGS_AS_ERRORS) + +endif() diff --git a/Examples/mitkdumpdir/files.cmake b/Examples/mitkdumpdir/files.cmake new file mode 100644 index 0000000000..5f445d4c57 --- /dev/null +++ b/Examples/mitkdumpdir/files.cmake @@ -0,0 +1 @@ +set(CPP_FILES mitkdumpdir.cpp) diff --git a/Examples/mitkdump/mitkdumpdir.cpp b/Examples/mitkdumpdir/mitkdumpdir.cpp similarity index 100% rename from Examples/mitkdump/mitkdumpdir.cpp rename to Examples/mitkdumpdir/mitkdumpdir.cpp