Salome HOME
Update patch for Salome 4.9.13
[tools/install.git] / config_files / build.sh
index 5dace5094a6b6b85e89e216bd3ff72a3a4588bd7..557544f807c8e875d069d687c693574bd9962e8a 100755 (executable)
@@ -84,7 +84,7 @@ inst_with_gui=1
 is_delete=0
 verbose_level=2
 params=""
-modules="KERNEL GUI GEOM MED SMESH VISU YACS NETGENPLUGIN GHS3DPLUGIN BLSURFPLUGIN HexoticPLUGIN GHS3DPRLPLUGIN COMPONENT PYCALCULATOR CALCULATOR HELLO PYHELLO LIGHT PYLIGHT SIERPINSKY RANDOMIZER MULTIPR JOBMANAGER"
+modules="KERNEL GUI GEOM MED SMESH VISU PARAVIS YACS NETGENPLUGIN GHS3DPLUGIN BLSURFPLUGIN HexoticPLUGIN GHS3DPRLPLUGIN COMPONENT PYCALCULATOR CALCULATOR HELLO PYHELLO LIGHT PYLIGHT SIERPINSKY RANDOMIZER ATOMIC ATOMGEN ATOMSOLV JOBMANAGER"
 optim=""
 is_install=1
 is_tui=0
@@ -229,7 +229,7 @@ for module in ${modules}; do
         # check if configure script exists
         #########################################################
        cfg_exist=0
-       if [ -e ${module_src}/configure ] ; then
+       if [ -e ${module_src}/configure ] || [ -e ${module_src}/CMakeLists.txt ] ; then
            cfg_exist=1
        fi
         #########################################################
@@ -241,9 +241,12 @@ for module in ${modules}; do
            #########################################################
             # check if build_configure script exists
            #########################################################
-           if [ ! -e ${module_src}/build_configure ] ; then
+           if [ ! -e ${module_src}/build_configure ] && [ "${module}" != "PARAVIS" ] ; then
                echo '!!! Warning !!! Cannot find build_configure script in '${module_src}'.'
            else
+               if [ "${module}" == "PARAVIS" ]; then
+                   echo '!!! Warning !!! build_configure step is not executed for '${module}'.'                    
+                   else
                #########################################################
                 # call build_configure
                #########################################################
@@ -260,6 +263,7 @@ for module in ${modules}; do
                    cat ${LOG_DIR}/build_configure_${module}.log | grep -E "(failed|: error:)" >&2
                fi
            fi
+           fi
        fi
         #########################################################
         # deleting build directory if -d flag is given
@@ -299,12 +303,6 @@ for module in ${modules}; do
         # previous launch
         #########################################################
        opts_changed=0
-##      if [ -f ${module_build}/config.log ] ; then
-##         old_prefix=`grep -e '^prefix=' ${module_build}/config.log | sed -e "s%^prefix='\(.*\)'%\1%"`
-##         if [ "$old_prefix" != "$prefix" ] ; then
-##             opts_changed=1
-##         fi
-##      fi
         #########################################################
         # define installation directory (by using module's version
         # number); default is a build directory
@@ -317,17 +315,17 @@ for module in ${modules}; do
            if [ "$vx" == "" ] ; then
                vx=`grep -e "^AC_INIT" ${module_src}/configure.in.base | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"`
            fi
+       elif [ -e ${module_src}/CMakeLists.txt ] ; then
+           ver_maj=`cat ${module_src}/CMakeLists.txt | grep SET\(VERSION_MAJOR | sed -e "s%[A-Z_() ]%%g"`
+           ver_min=`cat ${module_src}/CMakeLists.txt | grep SET\(VERSION_MINOR | sed -e "s%[A-Z_() ]%%g"`
+           ver_maintenance=`cat ${module_src}/CMakeLists.txt | grep SET\(VERSION_MAINTENANCE | sed -e "s%[A-Z_() ]%%g"`
+           vx="${ver_maj}.${ver_min}.${ver_maintenance}"
        fi
        if [ "$vx" != "" ] ; then
            vx="_$vx"
        fi
        if [ "$prefix" == "" ] ; then
-           #module_root_dir=`printenv ${module}_ROOT_DIR`
-           #if [ "$module_root_dir" != "" ] ; then
-           #    px=$module_root_dir
-           #else
                px=${BUILD_DIR}${def_install_dir}/${module}${vx}
-           #fi
        else
            px=$prefix/${module}${vx}
        fi
@@ -340,7 +338,7 @@ for module in ${modules}; do
            #########################################################
            # check if configure script exists
            #########################################################
-           if [ ! -e ${module_src}/configure ] ; then
+           if [ ! -e ${module_src}/configure ] && [ "${module}" != "PARAVIS" ] ; then
                echo
                echo '!!! Warning !!! Can not find configure script in '${module_src}'.'
                echo
@@ -355,7 +353,13 @@ for module in ${modules}; do
                if [ "${module}" == "NETGENPLUGIN" ] && [ "$NETGENHOME" != "" ] ; then
                    myconf_keys="${myconf_keys} --with-netgen=${NETGENHOME}"
                fi
+
+               if [ "${module}" == "PARAVIS" ] ; then
+               cd ${module_build}; cmake ${module_src} -DCMAKE_INSTALL_PREFIX=$px >& ${LOG_DIR}/configure_${module}.log
+                   else
                ${module_src}/configure --prefix=$px ${optim} ${myconf_keys} >& ${LOG_DIR}/configure_${module}.log
+               fi
+
                #########################################################
                # echo possible errors
                #########################################################