]> Creatis software - clitk.git/blobdiff - vv/CMakeLists.txt
Increment patch version number
[clitk.git] / vv / CMakeLists.txt
index 3d73df5959725be545bcf1a280d2a3bd602c6a0e..34396de5fab977203fe4bc1f17c6c66990b47af6 100644 (file)
@@ -7,6 +7,7 @@ if(COMMAND cmake_policy)
 endif(COMMAND cmake_policy)
 #=========================================================
 
+
 #=========================================================
 #List of vv tools to compile
 SET(vv_TOOLS
@@ -16,8 +17,9 @@ SET(vv_TOOLS
   vvToolBinarize
   vvToolImageArithm
   vvToolResample
-#  vvToolExtractPatient
+#   vvToolExtractPatient
 #  vvToolExtractLung
+  vvToolStructureSetManager
   vvToolMIP
   vvToolConvert ## with dummy vvToolConvert.ui
   
@@ -30,14 +32,16 @@ SET(vv_TOOLS
 # dependencies of the tools
 # Future issues : when tool depend on other tools ... how to manage that ?
 #  >> add the relevant $_LIBS variable to the tool that has dependencies?
-SET(vvToolRigidReg_LIBS clitkAffineRegistrationLib clitkRegistrationGgoLib)
+SET(vvToolRigidReg_LIBS clitkAffineRegistrationLib)
 SET(vvToolBinarize_LIBS clitkBinarizeImageLib)
 SET(vvToolResample_LIBS clitkResampleImageLib)
 SET(vvToolConvert_LIBS clitkImageConvertLib)
 SET(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
 SET(vvToolExtractLung_LIBS clitkSegmentationGgoLib)
-SET(vvToolCropImage_LIBS clitkToolsGgoLib)
-SET(vvToolMIP_LIBS clitkMIPLib clitkToolsGgoLib)
+SET(vvToolCropImage_LIBS clitkCropImageLib)
+SET(vvToolMIP_LIBS clitkMIPLib)
+SET(vvToolMedianFilter_LIBS clitkMedianImageFilterLib)
+SET(vvToolImageArithm_LIBS clitkImageArithmImageLib)
 
 #=========================================================
 # List of vv source files
@@ -59,7 +63,7 @@ SET(vv_COMMON_WITH_UI
   vvToolWidgetBase  
   vvToolSimpleInputSelectorWidget
   vvToolInputSelectorWidget
-  vvToolStructureSetManager
+  vvRegisterForm
 )
 
 # All others sources
@@ -73,10 +77,6 @@ SET(vv_SRCS
   vtkVOXImageWriter.cxx
   vvInteractorStyleNavigator.cxx
   vvSlicer.cxx
-  vvImageReader.cxx
-  vvImageReader.txx
-  vvImageWriter.cxx
-  vvImageWriter.txx
   vvLandmarks.cxx
   vvLandmarksGlyph.cxx
   vvGlyphSource.cxx
@@ -84,7 +84,7 @@ SET(vv_SRCS
   vvSlicerManager.cxx
   vvSlicerManagerCommand.cxx
   vvUtils.cxx
-  vvMaximumIntensityProjection.cxx
+#  vvMaximumIntensityProjection.cxx
   vvMesh.cxx
   vvMeshActor.cxx
   vvMeshReader.cxx
@@ -126,14 +126,23 @@ QT4_WRAP_UI(vv_UI_CXX
 
 QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
 
-#Add the autotools and the common files ui
+# Add the autotools in the header vvToolsList.h for initialization of the dummy
+# variables in vv.cxx for the tools contained in vvLib
+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)
+
+# 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
+# Add the common source files
 foreach(tool ${vv_COMMON})
     SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
     QT4_WRAP_CPP(vv_SRCS ${tool}.h)
@@ -167,11 +176,11 @@ INCLUDE_DIRECTORIES(
 
 #=========================================================
 #support for parallel deformable registration with OpenMP
-IF(NOT __APPLE__)
+IF(NOT APPLE)
 IF(CMAKE_COMPILER_IS_GNUCC)
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
 ENDIF(CMAKE_COMPILER_IS_GNUCC)
-ENDIF(NOT __APPLE__)
+ENDIF(NOT APPLE)
 #=========================================================
 
 #=========================================================
@@ -181,26 +190,32 @@ INCLUDE_DIRECTORIES(
   ../segmentation
   )
 
-IF(WIN32)
-  SET(EXE_ICON vvIcon.rc)
-ENDIF(WIN32)
-
 LINK_DIRECTORIES(${QT_LIBRARY_DIR})
-ADD_EXECUTABLE(vv ${vv_SRCS} vv.cxx ${vv_UI_CXX} ${EXE_ICON})
-ADD_DEPENDENCIES(vv clitkToolsGgoLib clitkSegmentationGgoLib)
-TARGET_LINK_LIBRARIES(vv clitkDicomRTStruct)
-
 #=========================================================
 #Add each tool's dependencies
 foreach(tool ${vv_TOOLS})
-    target_link_libraries(vv ${${tool}_LIBS})
+  SET(toolLibs ${toolLibs} ${${tool}_LIBS})
 endforeach(tool)
-
 #=========================================================
 #Add Foundation Libraries (this should be after our libraries, since we depend
 #on them)
-TARGET_LINK_LIBRARIES(vv
-clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
+SET(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
+
+#=========================================================
+#Create binary and libs for tests
+SET(vvExternalLibs clitkSegmentationGgoLib clitkDicomRTStruct ${toolLibs} ${foundationLibraries})
+
+ADD_LIBRARY(vvLib ${vv_SRCS} ${vv_UI_CXX})
+TARGET_LINK_LIBRARIES(vvLib ${vvExternalLibs})
+
+IF(WIN32)
+  ADD_EXECUTABLE(vv WIN32 vv.cxx vvIcon.rc)
+ELSE(WIN32)
+  ADD_EXECUTABLE(vv vv.cxx)
+ENDIF(WIN32)
+
+TARGET_LINK_LIBRARIES(vv vvLib)
+
 
 #=========================================================
 # Install options (also used by CPack)
@@ -234,9 +249,10 @@ SET(CPACK_PACKAGE_VENDOR "Creatis-CLB")
 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
 SET(CPACK_PACKAGE_VERSION_MAJOR "1")
-SET(CPACK_PACKAGE_VERSION_MINOR "1")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_VERSION_MINOR "2")
+SET(CPACK_PACKAGE_VERSION_PATCH "2")
 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
+SET(CPACK_STRIP_FILES TRUE)
 
 IF(WIN32)
   # There is a bug in NSI that does not handle full unix paths properly. Make
@@ -257,3 +273,6 @@ ELSE(WIN32)
 ENDIF(WIN32)
 INCLUDE(CPack)
 #=========================================================
+#=========================================================
+configure_file(vvConfiguration.h.in vvConfiguration.h)
+#=========================================================