Salome HOME
add a call to a file to the distene licence for SALOME pacakges
[tools/sat.git] / commands / configure.py
index 9349fed1101357a2cdd9ba3f0ea912195a239153..2fa43e715ffe59d1e27b428ea8864f4a43be9dae 100644 (file)
@@ -23,10 +23,10 @@ import src
 # Define all possible option for configure command :  sat configure <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('products to configure. This option can be'
+    _('Optional: products to configure. This option can be'
     ' passed several time to configure several products.'))
 parser.add_option('o', 'option', 'string', 'option',
-    _('Option to add to the configure or cmake command.'), "")
+    _('Optional: Option to add to the configure or cmake command.'), "")
 
 def get_products_list(options, cfg, logger):
     '''method that gives the product list with their informations from 
@@ -117,7 +117,14 @@ def configure_product(p_name_info, conf_option, config, logger):
     logger.write(header, 3)
     logger.write("\n", 4, False)
     logger.flush()
-    
+
+    # Do nothing if he product is not compilable
+    if ("properties" in p_info and "compilation" in p_info.properties and 
+                                        p_info.properties.compilation == "no"):
+        log_step(logger, header, "ignored")
+        logger.write("\n", 3, False)
+        return 0
+
     # Instantiate the class that manages all the construction commands
     # like cmake, make, make install, make test, environment management, etc...
     builder = src.compilation.Builder(config, logger, p_info)
@@ -170,11 +177,12 @@ def description():
     :rtype: str
     '''
     return _("The configure command executes in the build directory"
-             " the configure commands corresponding to the compilation mode"
+             " the configure commands corresponding\nto the compilation mode"
              " of the application products.\nThe possible compilation modes"
              " are \"cmake\", \"autotools\", or a script.\n\nHere are the "
              "commands to be run :\nautotools: build_configure and configure\n"
-             "cmake: cmake\nscript: N\A")
+             "cmake: cmake\nscript: do nothing\n\nexample:\nsat configure "
+             "SALOME-master --products KERNEL,GUI,PARAVIS")
   
 def run(args, runner, logger):
     '''method that is called when salomeTools is called with make parameter.
@@ -186,7 +194,7 @@ def run(args, runner, logger):
     # check that the command has been called with an application
     src.check_config_has_application( runner.cfg )
 
-    # Get the list of products to threat
+    # Get the list of products to treat
     products_infos = get_products_list(options, runner.cfg, logger)
     
     # Print some informations
@@ -199,6 +207,8 @@ def run(args, runner, logger):
     
     # Call the function that will loop over all the products and execute
     # the right command(s)
+    if options.option is None:
+        options.option = ""
     res = configure_all_products(runner.cfg, products_infos, options.option, logger)
     
     # Print the final state