X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FCMakeLists.txt;h=9453e1b0362114fecc112a6a3e1b9ec21b81c992;hb=6edda2a8b31b7345623e363dc27efd202aa59c9f;hp=436dfc64449e004af7fa4a11f8c8a04f3bcd2994;hpb=dd52aaffdda312ae9a4b8028fe1e94ac7a0e1b89;p=clitk.git diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index 436dfc6..9453e1b 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -9,6 +9,12 @@ endif(COMMAND cmake_policy) #========================================================= OPTION(CLITK_USE_PACS_CONNECTION "USE PACS CONNECTION" OFF) #========================================================= + +# Look for OpenGL2 version +if (VTK_RENDERING_BACKEND STREQUAL "OpenGL2") + add_definitions(-DVTK_OPENGL2) +endif () + #List of vv tools to compile set(vv_TOOLS vvToolMedianFilter @@ -16,13 +22,10 @@ set(vv_TOOLS vvToolCropImage vvToolBinarize vvToolImageArithm - vvToolResample vvToolMIP vvToolConvert ## with dummy vvToolConvert.ui vvToolROIManager vvToolSegmentation - vvToolProfile - vvToolHistogram ## these ones are for tests (not working) # vvToolTest # vvToolFoo @@ -34,13 +37,18 @@ set(vv_TOOLS # vvToolExtractLung # vvToolStructureSetManager ) +#List of vv tools to compile +#Ensure compatibility with QVTKOpenGL for VTK < v8.1 and QVTKOpenGLNativeWidget for others +set(vv_TOOLS_VTK7 + vvToolProfile + vvToolHistogram +) # 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(vvToolBinarize_LIBS clitkBinarizeImageLib) set(vvToolProfile_LIBS clitkProfileImageLib) set(vvToolHistogram_LIBS clitkHistogramImageLib) -set(vvToolResample_LIBS clitkResampleImageLib) set(vvToolConvert_LIBS clitkImageConvertLib) set(vvToolExtractPatient_LIBS clitkSegmentationGgoLib) set(vvToolExtractLung_LIBS clitkSegmentationGgoLib) @@ -61,8 +69,6 @@ set(vv_COMMON_WITH_UI vvOverlayPanel vvLandmarksPanel vvProgressDialog - vvSegmentationDialog - vvSurfaceViewerDialog vvDeformationDialog vvStructSelector vvIntensityValueSlider @@ -72,6 +78,13 @@ set(vv_COMMON_WITH_UI vvToolInputSelectorWidget vvRegisterForm ) +# in COMMON_WITH_UI -> must have .h and .cxx and VTK7.ui +#Ensure compatibility with QVTKOpenGL for VTK < v8.1 and QVTKOpenGLNativeWidget for others +set(vv_COMMON_WITH_UI_VTK7 + vvMainWindow + vvSegmentationDialog + vvSurfaceViewerDialog +) # All others sources set(vv_SRCS @@ -204,7 +217,7 @@ endif(CLITK_USE_PACS_CONNECTION) # 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}) + foreach(tool ${vv_TOOLS} ${vv_TOOLS_VTK7}) 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") @@ -222,6 +235,28 @@ endif(CLITK_USE_PACS_CONNECTION) QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui) endif() endforeach(tool) + + #Special case for Main Window with QVTKWidget according VTK version + foreach(tool ${vv_TOOLS_VTK7} ${vv_COMMON_WITH_UI_VTK7}) + set(vv_SRCS ${vv_SRCS} ${tool}.cxx) + if(VTK_VERSION VERSION_GREATER "8.0.0") + if(vv_QT_VERSION VERSION_GREATER "4") + QT5_WRAP_CPP(vv_SRCS ${tool}.h) + QT5_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui) + else() + QT4_WRAP_CPP(vv_SRCS ${tool}.h) + QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui) + endif() + else() + if(vv_QT_VERSION VERSION_GREATER "4") + QT5_WRAP_CPP(vv_SRCS ${tool}.h) + QT5_WRAP_UI(vv_UI_CXX qt_ui/${tool}VTK7.ui) + else() + QT4_WRAP_CPP(vv_SRCS ${tool}.h) + QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}VTK7.ui) + endif() + endif() + endforeach(tool) # Add the common source files foreach(tool ${vv_COMMON}) @@ -297,7 +332,7 @@ include_directories( #========================================================= #Add each tool's dependencies -foreach(tool ${vv_TOOLS}) +foreach(tool ${vv_TOOLS} ${vv_TOOLS_VTK7}) set(toolLibs ${toolLibs} ${${tool}_LIBS}) endforeach(tool) @@ -363,7 +398,7 @@ target_link_libraries(vv vvLib) #========================================================= # Install options (also used by CPack) -install(TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) +install(TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) #=========================================================