=== modified file 'mitk/Applications/CoreApp/CMakeLists.txt' --- mitk/Applications/CoreApp/CMakeLists.txt 2010-03-26 17:30:16 +0000 +++ mitk/Applications/CoreApp/CMakeLists.txt 2010-03-30 14:19:11 +0000 @@ -15,6 +15,8 @@ optimized PocoUtil debug PocoUtild optimized org_blueberry_osgi debug org_blueberry_osgi${BLUEBERRY_DEBUG_POSTFIX}) +SET_TARGET_PROPERTIES(CoreApp PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/bin/BlueBerry/org.blueberry.osgi/bin") + SET(_plugin_deps ${BLUEBERRY_ENABLED_PLUGINS} ${MITK_CORE_ENABLED_PLUGINS} === modified file 'mitk/Applications/ExtApp/CMakeLists.txt' --- mitk/Applications/ExtApp/CMakeLists.txt 2010-01-16 18:57:43 +0000 +++ mitk/Applications/ExtApp/CMakeLists.txt 2010-03-30 12:57:45 +0000 @@ -21,6 +21,7 @@ optimized org_blueberry_osgi debug org_blueberry_osgi${BLUEBERRY_DEBUG_POSTFIX} ${ALL_LIBRARIES}) +SET_TARGET_PROPERTIES(ExtApp PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/bin/BlueBerry/org.blueberry.osgi/bin") SET(EXTAPP_REQUIRED_BUNDLES org.mitk.gui.qt.datamanager === modified file 'mitk/BlueBerry/Bundles/org.blueberry.osgi/src/berryBundleLoader.cpp' --- mitk/BlueBerry/Bundles/org.blueberry.osgi/src/berryBundleLoader.cpp 2010-02-04 14:26:38 +0000 +++ mitk/BlueBerry/Bundles/org.blueberry.osgi/src/berryBundleLoader.cpp 2010-03-30 13:51:10 +0000 @@ -15,13 +15,6 @@ =========================================================================*/ -#ifdef _WIN32 -#define _WIN32_WINNT 0x0502 -#include -#endif - -// for std::memcpy -#include #include "berryLog.h" @@ -43,6 +36,7 @@ #include "service/berryIExtensionPointService.h" +#include namespace berry { @@ -302,21 +296,10 @@ // a batch file every time he adds a new plugin from outside the // build system. #ifdef BERRY_OS_FAMILY_WINDOWS - DWORD size = GetEnvironmentVariableA("path", 0, 0); - char* currPath = new char[size]; - DWORD currSize = GetEnvironmentVariableA("path", currPath, size); - //BERRY_INFO << "Current path: " << currPath << std::endl; - char* newPath = new char[currSize + bundlePath.toString().length() + 2]; - std::memcpy(newPath, currPath, currSize); - newPath[currSize] = ';'; - std::memcpy(newPath + currSize + 1, bundlePath.toString().c_str(), bundlePath.toString().length()); - newPath[currSize+bundlePath.toString().length()+1] = '\0'; - //BERRY_INFO << "Setting additional path: " << newPath; - /*bool success =*/ SetEnvironmentVariableA("path", newPath); - //BERRY_INFO << " " << (success ? "SUCCESS" : "FAILED") << std::endl; - - delete[] newPath; - delete[] currPath; + std::string pathEnv = Poco::Environment::get("PATH", ""); + if (!pathEnv.empty()) pathEnv += ";"; + pathEnv += bundlePath.toString(); + Poco::Environment::set("PATH", pathEnv); #endif m_CodeCache->InstallLibrary(libFileName, bundlePath); === modified file 'mitk/BlueBerry/CMake/MacroInstallPlugin.cmake' --- mitk/BlueBerry/CMake/MacroInstallPlugin.cmake 2010-01-15 15:19:01 +0000 +++ mitk/BlueBerry/CMake/MacroInstallPlugin.cmake 2010-03-30 14:04:21 +0000 @@ -37,11 +37,21 @@ PATTERN "Debug/*" EXCLUDE PATTERN "bin/*" EXCLUDE PATTERN "lib/*" EXCLUDE) + + SET(_target_install_rpath ${CMAKE_INSTALL_RPATH}) + FOREACH(_dep ${_plugin_dependencies}) + SET(_linklib_path "${${_dep}_OUT_DIR}") + STRING(REPLACE "${CMAKE_BINARY_DIR}" "${CMAKE_INSTALL_PREFIX}" _linklib_path "${_linklib_path}") + LIST(APPEND _target_install_rpath "${_linklib_path}/bin") + ENDFOREACH() + SET_TARGET_PROPERTIES(${_INSTALL_TARGETS} + PROPERTIES INSTALL_RPATH "${_target_install_rpath}") INSTALL(TARGETS ${_INSTALL_TARGETS} RUNTIME DESTINATION ${_plugin_install_dir}/bin - LIBRARY DESTINATION ${_plugin_install_dir}/lib - ARCHIVE DESTINATION ${_plugin_install_dir}/lib + LIBRARY DESTINATION ${_plugin_install_dir}/bin + ARCHIVE DESTINATION ${_plugin_install_dir}/bin ) -ENDMACRO() \ No newline at end of file +ENDMACRO() + === modified file 'mitk/CMakeLists.txt' --- mitk/CMakeLists.txt 2010-02-24 15:34:50 +0000 +++ mitk/CMakeLists.txt 2010-03-30 14:06:11 +0000 @@ -5,6 +5,9 @@ cmake_policy(SET CMP0003 OLD) endif(COMMAND cmake_policy) +SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" "${CMAKE_INSTALL_PREFIX}/lib/mitk") +SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) + SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/CMake) SET(MITK_MODULES_CONF_DIR ${MITK_BINARY_DIR}/modulesConf CACHE INTERNAL "Modules Conf") @@ -263,56 +266,56 @@ SET(QT_USE_PHONON 1) ENDIF() IF (QT_QTXMLPATTERNS_FOUND) - SET(QT_USE_QTXMLPATTERNS 1) -ENDIF() - - INCLUDE(${QT_USE_FILE}) + SET(QT_USE_QTXMLPATTERNS 1) + ENDIF() + + # this is not a godd idea since it adds the QT include directories to everything that is built below this directory + INCLUDE(${QT_USE_FILE}) - SET(qtdebugdlls) - SET(qtreleasedlls) - FOREACH(qtlib ${QT_LIBRARIES}) - GET_FILENAME_COMPONENT(qtdllname ${qtlib} NAME_WE) - # strip the leading "lib" from the filename for MINGW installs - IF(MINGW) - STRING(REPLACE "lib" "" qtdllname ${qtdllname}) - ENDIF() - STRING(REGEX MATCH ".*d4" debugmatch ${qtdllname}) - IF(debugmatch) - LIST(APPEND qtdebugdlls "${QT_INCLUDE_DIR}/../bin/${qtdllname}.dll") - ELSE() - STRING(REGEX MATCH ".*4" releasematch ${qtdllname}) - IF(releasematch) - LIST(APPEND qtreleasedlls "${QT_INCLUDE_DIR}/../bin/${qtdllname}.dll") - ENDIF() - ENDIF() - ENDFOREACH(qtlib) - + SET(qtdebugdlls) + SET(qtreleasedlls) + FOREACH(qtlib ${QT_LIBRARIES}) + GET_FILENAME_COMPONENT(qtdllname ${qtlib} NAME_WE) + # strip the leading "lib" from the filename for MINGW installs + IF(MINGW) + STRING(REPLACE "lib" "" qtdllname ${qtdllname}) + ENDIF() + STRING(REGEX MATCH ".*d4" debugmatch ${qtdllname}) + IF(debugmatch) + LIST(APPEND qtdebugdlls "${QT_INCLUDE_DIR}/../bin/${qtdllname}.dll") + ELSE() + STRING(REGEX MATCH ".*4" releasematch ${qtdllname}) + IF(releasematch) + LIST(APPEND qtreleasedlls "${QT_INCLUDE_DIR}/../bin/${qtdllname}.dll") + ENDIF() + ENDIF() + ENDFOREACH(qtlib) + INSTALL(FILES ${qtdebugdlls} DESTINATION bin CONFIGURATIONS Debug) INSTALL(FILES ${qtreleasedlls} DESTINATION bin CONFIGURATIONS Release) - - INSTALL(FILES "${QT_INCLUDE_DIR}/../bin/assistant.exe" DESTINATION bin) - - IF(QT_PLUGINS_DIR) - # install sqllite plugin - IF(EXISTS ${QT_PLUGINS_DIR}/sqldrivers/qsqlite4.dll) - INSTALL(FILES ${QT_PLUGINS_DIR}/sqldrivers/qsqlite4.dll DESTINATION bin/sqldrivers CONFIGURATIONS Release) - INSTALL(FILES ${QT_PLUGINS_DIR}/sqldrivers/qsqlited4.dll DESTINATION bin/sqldrivers CONFIGURATIONS Debug) - ENDIF() - # install imageformat plugins - SET(_img_formats qgif qico qjpeg qsvg qtiff) - FOREACH(_img_format ${_img_formats}) - IF(EXISTS ${QT_PLUGINS_DIR}/imageformats/${_img_format}4.dll) - INSTALL(FILES ${QT_PLUGINS_DIR}/imageformats/${_img_format}4.dll DESTINATION bin/imageformats CONFIGURATIONS Release) - INSTALL(FILES ${QT_PLUGINS_DIR}/imageformats/${_img_format}d4.dll DESTINATION bin/imageformats CONFIGURATIONS Debug) - ENDIF() - ENDFOREACH() - ENDIF() - - + + INSTALL(FILES "${QT_INCLUDE_DIR}/../bin/assistant.exe" DESTINATION bin) + + IF(QT_PLUGINS_DIR) + # install sqllite plugin + IF(EXISTS ${QT_PLUGINS_DIR}/sqldrivers/qsqlite4.dll) + INSTALL(FILES ${QT_PLUGINS_DIR}/sqldrivers/qsqlite4.dll DESTINATION bin/sqldrivers CONFIGURATIONS Release) + INSTALL(FILES ${QT_PLUGINS_DIR}/sqldrivers/qsqlited4.dll DESTINATION bin/sqldrivers CONFIGURATIONS Debug) + ENDIF() + # install imageformat plugins + SET(_img_formats qgif qico qjpeg qsvg qtiff) + FOREACH(_img_format ${_img_formats}) + IF(EXISTS ${QT_PLUGINS_DIR}/imageformats/${_img_format}4.dll) + INSTALL(FILES ${QT_PLUGINS_DIR}/imageformats/${_img_format}4.dll DESTINATION bin/imageformats CONFIGURATIONS Release) + INSTALL(FILES ${QT_PLUGINS_DIR}/imageformats/${_img_format}d4.dll DESTINATION bin/imageformats CONFIGURATIONS Debug) + ENDIF() + ENDFOREACH() + ENDIF() + ENDIF(MITK_USE_QT) IF(MITK_USE_OPEN_CV) - INCLUDE(MITK_OpenCV_Config) + INCLUDE(MITK_OpenCV_Config) FILE(GLOB opencvdebuglllist "${OPENCV_DIR}/bin/Debug/*.dll") FILE(GLOB opencvreleasedlllist "${OPENCV_DIR}/bin/Release/*.dll") @@ -325,11 +328,11 @@ IF(MINGW) FILE(GLOB vtkreleasedlllist ${VTK_RUNTIME_LIBRARY_DIRS}/*.dll) FILE(GLOB vtkdebugdlllist ${VTK_RUNTIME_LIBRARY_DIRS}/*.dll) - - # VTKs freetype library is buggy when used with gcc, need freetype > 2.3.9 - IF(VTK_FREETYPE_LIBRARIES) - INSTALL(FILES ${VTK_FREETYPE_LIBRARIES} DESTINATION bin) - ENDIF() + + # VTKs freetype library is buggy when used with gcc, need freetype > 2.3.9 + IF(VTK_FREETYPE_LIBRARIES) + INSTALL(FILES ${VTK_FREETYPE_LIBRARIES} DESTINATION bin) + ENDIF() ELSE() FILE(GLOB vtkreleasedlllist ${VTK_RUNTIME_LIBRARY_DIRS}/release/*.dll) FILE(GLOB vtkdebugdlllist ${VTK_RUNTIME_LIBRARY_DIRS}/debug/*.dll) @@ -353,14 +356,14 @@ #DCMTK Dlls install target (shared libs on gcc only) IF(MINGW AND DCMTK_ofstd_LIBRARY) SET(_dcmtk_libs - ${DCMTK_dcmdata_LIBRARY} - ${DCMTK_dcmimgle_LIBRARY} - ${DCMTK_dcmnet_LIBRARY} - ${DCMTK_ofstd_LIBRARY} + ${DCMTK_dcmdata_LIBRARY} + ${DCMTK_dcmimgle_LIBRARY} + ${DCMTK_dcmnet_LIBRARY} + ${DCMTK_ofstd_LIBRARY} ) - FOREACH(_dcmtk_lib ${_dcmtk_libs}) - INSTALL(FILES ${_dcmtk_lib} DESTINATION bin) - ENDFOREACH() + FOREACH(_dcmtk_lib ${_dcmtk_libs}) + INSTALL(FILES ${_dcmtk_lib} DESTINATION bin) + ENDFOREACH() ENDIF() #BlueBerry @@ -377,20 +380,82 @@ #MinGW dll IF(MINGW) FIND_LIBRARY(MINGW_RUNTIME_DLL "mingwm10.dll" HINTS ${CMAKE_FIND_ROOT_PATH}/sys-root/mingw/bin) - IF (MINGW_RUNTIME_DLL) - INSTALL(FILES ${MINGW_RUNTIME_DLL} DESTINATION bin) - ELSE() - MESSAGE(SEND_ERROR "Could not find mingwm10.dll which is needed for a proper install") - ENDIF() - - FIND_LIBRARY(MINGW_GCC_RUNTIME_DLL "libgcc_s_dw2-1.dll" HINTS ${CMAKE_FIND_ROOT_PATH}/sys-root/mingw/bin) - IF (MINGW_GCC_RUNTIME_DLL) - INSTALL(FILES ${MINGW_GCC_RUNTIME_DLL} DESTINATION bin) - ELSE() - MESSAGE(SEND_ERROR "Could not find libgcc_s_dw2-1.dll which is needed for a proper install") - ENDIF() - ENDIF() - + IF (MINGW_RUNTIME_DLL) + INSTALL(FILES ${MINGW_RUNTIME_DLL} DESTINATION bin) + ELSE() + MESSAGE(SEND_ERROR "Could not find mingwm10.dll which is needed for a proper install") + ENDIF() + + FIND_LIBRARY(MINGW_GCC_RUNTIME_DLL "libgcc_s_dw2-1.dll" HINTS ${CMAKE_FIND_ROOT_PATH}/sys-root/mingw/bin) + IF (MINGW_GCC_RUNTIME_DLL) + INSTALL(FILES ${MINGW_GCC_RUNTIME_DLL} DESTINATION bin) + ELSE() + MESSAGE(SEND_ERROR "Could not find libgcc_s_dw2-1.dll which is needed for a proper install") + ENDIF() + ENDIF() + +ELSE(WIN32) + FOREACH(vtklib ${VTK_FOR_MITK_LIBRARIES}) + IF(EXISTS ${vtklib}) + # already an absolute path + INSTALL(FILES ${vtklib} DESTINATION lib) + ENDIF(EXISTS ${vtklib}) + ENDFOREACH(vtklib) + + INSTALL(DIRECTORY ${VTK_RUNTIME_LIBRARY_DIRS}/ DESTINATION lib + FILES_MATCHING PATTERN "libvtk*.so*" PATTERN "libVTK*.so*" + ) + + IF(MITK_USE_QT) + INSTALL(DIRECTORY ${VTK_RUNTIME_LIBRARY_DIRS}/ DESTINATION lib + FILES_MATCHING PATTERN "libQ*.so*") + ENDIF() + + + INSTALL(DIRECTORY ${ITK_LIBRARY_DIRS}/ DESTINATION lib + FILES_MATCHING PATTERN "libitk*.so*" PATTERN "libITK*.so*" + ) + + #DCMTK Dlls install target (shared libs on gcc only) + IF(DCMTK_ofstd_LIBRARY) + SET(_dcmtk_libs + ${DCMTK_dcmdata_LIBRARY} + ${DCMTK_dcmimgle_LIBRARY} + ${DCMTK_dcmnet_LIBRARY} + ${DCMTK_ofstd_LIBRARY} + ) + FOREACH(_dcmtk_lib ${_dcmtk_libs}) + INSTALL(FILES ${_dcmtk_lib} DESTINATION lib) + ENDFOREACH() + ENDIF() + + #BlueBerry + IF(MITK_USE_BLUEBERRY) + IF(MINGW) + INSTALL(FILES ${BLUEBERRY_PLUGINS_OUTPUT_DIR}/org.blueberry.osgi/bin/liborg_blueberry_osgid.dll DESTINATION bin CONFIGURATIONS Debug) + INSTALL(FILES ${BLUEBERRY_PLUGINS_OUTPUT_DIR}/org.blueberry.osgi/bin/liborg_blueberry_osgi.dll DESTINATION bin CONFIGURATIONS Release) + ELSE() + #INSTALL(FILES ${BLUEBERRY_PLUGINS_OUTPUT_DIR}/org.blueberry.osgi/bin/debug/liborg_blueberry_osgid.dll DESTINATION bin CONFIGURATIONS Debug) + #INSTALL(FILES ${BLUEBERRY_PLUGINS_OUTPUT_DIR}/org.blueberry.osgi/bin/release/liborg_blueberry_osgi.dll DESTINATION bin CONFIGURATIONS Release) + ENDIF() + ENDIF() + + #MinGW dll + IF(MINGW) + FIND_LIBRARY(MINGW_RUNTIME_DLL "mingwm10.dll" HINTS ${CMAKE_FIND_ROOT_PATH}/sys-root/mingw/bin) + IF (MINGW_RUNTIME_DLL) + INSTALL(FILES ${MINGW_RUNTIME_DLL} DESTINATION bin) + ELSE() + MESSAGE(SEND_ERROR "Could not find mingwm10.dll which is needed for a proper install") + ENDIF() + + FIND_LIBRARY(MINGW_GCC_RUNTIME_DLL "libgcc_s_dw2-1.dll" HINTS ${CMAKE_FIND_ROOT_PATH}/sys-root/mingw/bin) + IF (MINGW_GCC_RUNTIME_DLL) + INSTALL(FILES ${MINGW_GCC_RUNTIME_DLL} DESTINATION bin) + ELSE() + MESSAGE(SEND_ERROR "Could not find libgcc_s_dw2-1.dll which is needed for a proper install") + ENDIF() + ENDIF() ENDIF(WIN32)