From a2d0a8b2efd3cc4ab91bfd944d48704d85cddf42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20L=C3=A9ger?= <17100565+errollgarner@users.noreply.github.com> Date: Wed, 28 Jun 2023 11:04:12 -0400 Subject: [PATCH] Add option to build all plugins in SuperBuild (#509) --- .github/workflows/build-windows.yml | 11 ++++++++++- CMakeLists.txt | 1 + IbisPlugins/CMakeLists.txt | 6 ++++-- IbisPlugins/PedicleScrewNavigation/CMakeLists.txt | 6 ++++-- IbisSuperBuild/CMakeLists.txt | 2 ++ IbisSuperBuild/IbisDeps/External_OpenCV.cmake | 3 +++ 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 035f24fe..dd0c6d08 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -18,7 +18,16 @@ jobs: fetch-depth: 0 - name: Configure CMake - run: cmake IbisSuperBuild -G "Visual Studio 16 2019" -A x64 -B ${{github.workspace}}/b -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CONFIGURATION_TYPES=${{env.BUILD_TYPE}} -DQt5_DIR=D:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5 + run: cmake IbisSuperBuild + -G "Visual Studio 16 2019" \ + -A x64 \ + -B ${{github.workspace}}/b \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_CONFIGURATION_TYPES=${{env.BUILD_TYPE}} \ + -DQt5_DIR=D:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5 \ + -DIBIS_BUILD_ELASTIX=TRUE \ + -DIBIS_BUILD_OPENCV=TRUE \ + -DIBIS_BUILD_ALL_PLUGINS:BOOL=TRUE - name: Build run: cmake --build ${{github.workspace}}/b --config ${{env.BUILD_TYPE}} -j2 diff --git a/CMakeLists.txt b/CMakeLists.txt index af5bf49e..7520fde1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,6 +106,7 @@ endif() # Create options to build or not the different dependent projects. #================================================================== option( IBIS_BUILD_DEFAULT_HARDWARE_MODULE "Build hardware module based on OpenIGTLink and dependencies (OpenIGTLink and OpenIGTLinkIO)" ON ) +option( IBIS_BUILD_ALL_PLUGINS "Build every plugin contained in the IbisPlugins and Extra directories" OFF ) find_package ( OpenCL QUIET ) include(${CMAKE_COMMON_DIR}/OpenCLMacros.cmake) diff --git a/IbisPlugins/CMakeLists.txt b/IbisPlugins/CMakeLists.txt index 6e610e3c..f236acb7 100644 --- a/IbisPlugins/CMakeLists.txt +++ b/IbisPlugins/CMakeLists.txt @@ -76,8 +76,10 @@ endmacro() set( allEnabledIbisPlugins ) foreach( ibisPlugin ${allIbisPlugins} ) if( ${${${ibisPlugin}Option}} ) - CheckPlugin("${ibisPlugin}" "" "") - list( APPEND allIbisEnabledPlugins ${ibisPlugin} ) + CheckPlugin( "${ibisPlugin}" "" "" ) + list( APPEND allIbisEnabledPlugins ${ibisPlugin} ) + elseif( ${IBIS_BUILD_ALL_PLUGINS} ) + list( APPEND allIbisEnabledPlugins ${ibisPlugin} ) endif() endforeach() diff --git a/IbisPlugins/PedicleScrewNavigation/CMakeLists.txt b/IbisPlugins/PedicleScrewNavigation/CMakeLists.txt index 20e7fbc5..8586d70b 100644 --- a/IbisPlugins/PedicleScrewNavigation/CMakeLists.txt +++ b/IbisPlugins/PedicleScrewNavigation/CMakeLists.txt @@ -20,11 +20,13 @@ set( PluginHdrMoc set( PluginUi vertebraregistrationwidget.ui screwnavigationwidget.ui screwtablewidget.ui ) IF (NOT IBIS_PLUGINS_BUILD_GPU_RigidRegistration) - message( SEND_ERROR "Cannot find the GPU_RigidRegistration plugin. PedicleScrewNavigation Plugin depends on GPU_RigidRegistration.\n" ) + message( WARNING "PedicleScrewNavigation Plugin depends on GPU_RigidRegistration, enabling it.\n" ) + set( IBIS_PLUGINS_BUILD_GPU_RigidRegistration ON ) ENDIF() IF (NOT IBIS_PLUGINS_BUILD_GPU_VolumeReconstruction) - message( SEND_ERROR "Cannot find the GPU_VolumeReconstruction plugin. PedicleScrewNavigation Plugin depends on GPU_VolumeReconstruction.\n" ) + message( WARNING "PedicleScrewNavigation Plugin depends on GPU_VolumeReconstruction. enabling it.\n" ) + set( IBIS_PLUGINS_BUILD_GPU_VolumeReconstruction ON ) ENDIF() add_subdirectory( itkWeightRegistration ) diff --git a/IbisSuperBuild/CMakeLists.txt b/IbisSuperBuild/CMakeLists.txt index a7e12261..1c2e8a2a 100644 --- a/IbisSuperBuild/CMakeLists.txt +++ b/IbisSuperBuild/CMakeLists.txt @@ -40,6 +40,7 @@ option( IBIS_BUILD_MINIMAL_VTK "Build only the minimal set of VTK modules requir if( IBIS_BUILD_ELASTIX ) option( IBIS_BUILD_MINIMAL_ELASTIX "Build only the minimal set of Elastix modules required by Ibis during the superbuild" ON ) endif() +option( IBIS_BUILD_ALL_PLUGINS "Build every plugin contained in the IbisPlugins and Extra directories" OFF ) # Build All External Dependencies except Qt (vtk, Itk, minc, etc.) set( vtk_name vtk-${IBIS_VTK_LONG_VERSION} ) @@ -89,4 +90,5 @@ ExternalProject_Add( -DOpenIGTLink_DIR:PATH=${IBIS_OPENIGTLINK_DIR} -DOpenIGTLinkIO_DIR:PATH=${IBIS_OPENIGTLINKIO_DIR} -DIBIS_BUILD_DEFAULT_HARDWARE_MODULE:BOOL=${IBIS_BUILD_IGTL_HARDWARE_SUPPORT} + -DIBIS_BUILD_ALL_PLUGINS:BOOL=${IBIS_BUILD_ALL_PLUGINS} DEPENDS ${ibis_dependencies} ) diff --git a/IbisSuperBuild/IbisDeps/External_OpenCV.cmake b/IbisSuperBuild/IbisDeps/External_OpenCV.cmake index f49718c7..59c0b3cf 100644 --- a/IbisSuperBuild/IbisDeps/External_OpenCV.cmake +++ b/IbisSuperBuild/IbisDeps/External_OpenCV.cmake @@ -28,6 +28,9 @@ ExternalProject_Add( ${opencv_name} -DWITH_ITT:BOOL=OFF -DBUILD_opencv_python2:BOOL=FALSE -DBUILD_opencv_python3:BOOL=FALSE + -DBUILD_opencv_python_bindings_generator:BOOL=FALSE + -DBUILD_opencv_python_tests:BOOL=FALSE + -DOPENCV_PYTHON_SKIP_DETECTION=ON -DBUILD_opencv_apps:BOOL=FALSE -DBUILD_JAVA:BOOL=FALSE -DBUILD_PACKAGE:BOOL=FALSE