]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
spns #43020: fix compilation issues
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 9 Oct 2024 11:27:35 +0000 (13:27 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 9 Oct 2024 11:27:35 +0000 (13:27 +0200)
products/compil_scripts/meshbooleanplugin.sh
products/meshbooleanplugin.pyconf
products/patches/mcut-b5b0ec6-p02_cgsboolean.patch [new file with mode: 0644]

index 9d32b9f79be3917886d68ebc0433bccd29e8a065..9f571c6002f483479d1010a92d2d49ad65e3a017 100755 (executable)
@@ -9,6 +9,14 @@ mkdir $BUILD_DIR
 
 LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION"
 
+CMAKE_OPTIONS_COMMON=
+CMAKE_OPTIONS_COMMON+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}"
+if [ -n "$SAT_DEBUG" ]; then
+    CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Debug"
+else
+    CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Release"
+fi
+
 echo "##########################################################################"
 echo "Building cgal"
 echo "##########################################################################"
@@ -16,15 +24,12 @@ echo "##########################################################################
 mkdir $BUILD_DIR/cgal
 cd $BUILD_DIR/cgal
 
-CMAKE_OPTIONS=
-# common settings
-CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}"
-CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release"
+CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON
 CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib"
-CMAKE_OPTIONS+=" -DWITH_examples=ON"
-CMAKE_OPTIONS+=" -DWITH_tests=ON"
-CMAKE_OPTIONS+=" -DWITH_demos=ON"
-CMAKE_OPTIONS+=" -DCGAL_ENABLE_TESTING=ON"
+CMAKE_OPTIONS+=" -DWITH_examples=OFF"
+CMAKE_OPTIONS+=" -DWITH_tests=OFF"
+CMAKE_OPTIONS+=" -DWITH_demos=OFF"
+CMAKE_OPTIONS+=" -DCGAL_ENABLE_TESTING=OFF"
 
 echo "*** cmake" $CMAKE_OPTIONS
 cmake $CMAKE_OPTIONS $SOURCE_DIR/cgal/cgal
@@ -50,6 +55,39 @@ if [ $? -ne 0 ]; then
     exit 3
 fi
 
+echo "##########################################################################"
+echo "Building cgal_test"
+echo "##########################################################################"
+
+mkdir $BUILD_DIR/cgal_test
+cd $BUILD_DIR/cgal_test
+CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON
+CMAKE_OPTIONS+=" -DCGAL_DIR=${PRODUCT_INSTALL}/lib/cmake"
+CMAKE_OPTIONS+=" -DEXECUTABLE_OUTPUT_PATH=${PRODUCT_INSTALL}/bin"
+
+echo "*** cmake" $CMAKE_OPTIONS
+cmake $CMAKE_OPTIONS $SOURCE_DIR/cgal
+if [ $? -ne 0 ]; then
+    echo "ERROR on CMake"
+    exit 1
+fi
+
+echo
+echo "*** make" $MAKE_OPTIONS
+make $MAKE_OPTIONS
+if [ $? -ne 0 ]; then
+    echo "ERROR on make"
+    exit 2
+fi
+
+echo
+echo "*** make install"
+make install
+if [ $? -ne 0 ]; then
+    echo "ERROR on make install"
+    exit 3
+fi
+
 echo "##########################################################################"
 echo "libigl" $VERSION
 echo "##########################################################################"
@@ -57,10 +95,7 @@ echo "##########################################################################
 mkdir $BUILD_DIR/libigl
 cd $BUILD_DIR/libigl
 
-CMAKE_OPTIONS=
-# common settings
-CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}"
-CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release"
+CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON
 CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib"
 
 # overwrite the main.cpp
@@ -105,10 +140,7 @@ cp -f $SOURCE_DIR/mcut/CSGBoolean.cpp $SOURCE_DIR/mcut/mcut/tutorials/CSGBoolean
 mkdir $BUILD_DIR/mcut
 cd $BUILD_DIR/mcut
 
-CMAKE_OPTIONS=
-# common settings
-CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}"
-CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release"
+CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON
 CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib"
 CMAKE_OPTIONS+=" -DLIBIGL_INCLUDE_DIR=${PRODUCT_INSTALL}/include"
 
@@ -144,10 +176,7 @@ echo "##########################################################################
 mkdir $BUILD_DIR/irmb
 cd $BUILD_DIR/irmb
 
-CMAKE_OPTIONS=
-# common settings
-CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}"
-CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release"
+CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON
 CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib"
 
 echo "*** cmake" $CMAKE_OPTIONS
@@ -196,5 +225,44 @@ if [ $? -ne 0 ]; then
 fi
 chmod 755 ${PRODUCT_INSTALL}/bin/cork
 
+echo "##########################################################################"
+echo "MESH BOOLEAN PLUGIN" $VERSION
+echo "##########################################################################"
+
+cd $BUILD_DIR
+CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON
+CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib"
+echo "*** cmake" $CMAKE_OPTIONS
+cmake $CMAKE_OPTIONS $SOURCE_DIR
+if [ $? -ne 0 ]; then
+    echo "ERROR on CMake"
+    exit 1
+fi
+
+echo
+echo "*** make" $MAKE_OPTIONS
+make $MAKE_OPTIONS
+if [ $? -ne 0 ]; then
+    echo "ERROR on make"
+    exit 2
+fi
+
+echo
+echo "*** make install"
+make install
+if [ $? -ne 0 ]; then
+    echo "ERROR on make install"
+    exit 3
+fi
+
+if [ -f ${PRODUCT_INSTALL}/plugins/meshbooleanplugin/MyPlugDialog_ui.py ]; then
+    sed '$d' ${PRODUCT_INSTALL}/plugins/meshbooleanplugin/MyPlugDialog_ui.py > ${BUILD_DIR}/MyPlugDialog_ui.py
+    echo "from qwt import QwtPlot" >> ${BUILD_DIR}/MyPlugDialog_ui.py
+    echo                           >> ${BUILD_DIR}/MyPlugDialog_ui.py
+    mv ${BUILD_DIR}/MyPlugDialog_ui.py ${PRODUCT_INSTALL}/plugins/meshbooleanplugin/MyPlugDialog_ui.py
+else
+    echo "ERROR: could not find MyPlugDialog_ui.py"
+fi
+
 echo
 echo "########## END"
index a289d25e5c0b3c0312a91cbd0f5b5b5020e4aeaa..186c0f2a3f848f2f58e477d4c18384ea0f14c74e 100644 (file)
@@ -15,7 +15,8 @@ default :
     patches: [
               'libigl-v2.5.0-p01_609_Boolean.patch',
                'mcut-b5b0ec6-p01_cgsboolean.patch',
-                'cork-5987de5_off.patch'
+               'mcut-b5b0ec6-p02_cgsboolean.patch',
+               'cork-5987de5_off.patch'
               ]
     system_info : 
     {
diff --git a/products/patches/mcut-b5b0ec6-p02_cgsboolean.patch b/products/patches/mcut-b5b0ec6-p02_cgsboolean.patch
new file mode 100644 (file)
index 0000000..e68d8e0
--- /dev/null
@@ -0,0 +1,48 @@
+--- a/mcut/mcut/CMakeLists.txt 2024-10-08 22:04:07.763300956 +0200
++++ b/mcut/mcut/CMakeLists.txt 2024-10-07 15:25:44.107901112 +0200
+@@ -42,7 +42,8 @@
+ set(MCUT_MAJOR 1)
+ set(MCUT_MINOR 2)
+ set(MCUT_PATCH 0)
+-
++find_package( Eigen3 REQUIRED )
++include_directories( ${EIGEN3_INCLUDE_DIR} )
+ set( MCUT_VERSION "${MCUT_MAJOR}.${MCUT_MINOR}.${MCUT_PATCH}" )
+ message(STATUS "[MCUT] version: ${MCUT_VERSION}")
+@@ -98,6 +99,8 @@
+ endif()
+ option(MCUT_BUILD_WITH_API_EVENT_LOGGING "Configure to build MCUT with event logging to console" OFF)
++option(LIBIGL_INCLUDE_DIR "libigl include directory")
++
+ #
+ # machine-precision-numbers library targets
+ #
+@@ -111,6 +114,7 @@
+ message(STATUS "[MCUT] MCUT_INCLUDE_DIR=${MCUT_INCLUDE_DIR}")
+ list(APPEND include_dirs  ${MCUT_INCLUDE_DIR})
++list(APPEND include_dirs  ${LIBIGL_INCLUDE_DIR})
+ list(APPEND compilation_flags "")
+ if(MCUT_BUILD_AS_SHARED_LIB)
+       list(APPEND preprocessor_defs -DMCUT_SHARED_LIB=1)
+@@ -217,7 +221,6 @@
+       )
+       set(mio_include_dir ${mio_SOURCE_DIR}/include)
+-
+       add_subdirectory(${mio_SOURCE_DIR} build)
+       #
+--- a/mcut/mcut/tutorials/CMakeLists.txt       2024-10-08 22:04:07.775300917 +0200
++++ b/mcut/mcut/tutorials/CMakeLists.txt       2024-10-07 12:57:28.643032926 +0200
+@@ -3,7 +3,7 @@
+ function(create_tutorial_target tutorial_name)
+     add_executable(${tutorial_name} "${CMAKE_CURRENT_SOURCE_DIR}/${tutorial_name}/${tutorial_name}.cpp")
+     target_link_libraries(${tutorial_name} mcut mio)
+-    target_include_directories(${tutorial_name} PRIVATE ${MCUT_INCLUDE_DIR}  ${mio_include_dir})
++    target_include_directories(${tutorial_name} PRIVATE ${MCUT_INCLUDE_DIR}  ${mio_include_dir} ${LIBIGL_INCLUDE_DIR})
+     target_compile_definitions(${tutorial_name} PRIVATE -DDATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/${tutorial_name}/data" -DOUTPUT_DIR="${CMAKE_CURRENT_BINARY_DIR}")
+     target_compile_options(${tutorial_name} PRIVATE ${compilation_flags})
+     target_compile_definitions(${tutorial_name} PRIVATE ${preprocessor_defs})