-#Add the autotools
-foreach(tool ${vv_TOOLS})
- SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
- QT4_WRAP_CPP(vv_SRCS ${tool}.h)
- QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
+# Add DICOM SERVER gui selector if the adequate GDCM is available
+#IF(CLITK_USE_SYSTEM_GDCM)
+message("ololoa")
+ SET(vv_SRCS ${vv_SRCS}
+ vvQPacsConnection.cxx
+ vvPacsSettingsDialog.cxx)
+ QT4_WRAP_CPP(vv_SRCS vvQPacsConnection.cxx
+ vvPacsSettingsDialog.cxx)
+ QT4_WRAP_UI(vv_UI_CXX qt_ui/vvPacsConnection.ui
+ qt_ui/vvPacsSettingsDialog.ui)
+#ENDIF(CLITK_USE_SYSTEM_GDCM)
+
+# Add the autotools in the header vvToolsList.h for initialization of the dummy
+# variables in vv.cxx for the tools contained in vvLib
+if(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
+ file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
+ foreach(tool ${vv_TOOLS})
+ FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "#include \"${tool}.h\"\n")
+ FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "extern const vvToolCreator<${tool}> *dummy${tool};\n")
+ FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "const vvToolCreator<${tool}> *dummy${tool}2 = dummy${tool};\n\n")
+ endforeach(tool)
+endif(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
+
+# Add the autotools and the common files ui
+foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI})
+ SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
+ QT4_WRAP_CPP(vv_SRCS ${tool}.h)
+ QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
+endforeach(tool)
+
+# Add the common source files
+foreach(tool ${vv_COMMON})
+ SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
+ QT4_WRAP_CPP(vv_SRCS ${tool}.h)