docconf=Template(docconf)
+# SalomeApp.xml file for a documentation only module.
+# template parameters:
+# module : module name
+# version : version number of the module
docsalomeapp="""
<document>
<section name="${module}">
<parameter name="name" value="${module}"/>
+ <parameter name="version" value="${version}"/>
</section>
<section name="resources">
<parameter name="${module}" value="$${${module}_ROOT_DIR}/share/salome/resources/${lmodule}"/>
from yacstypes import ValidImpl, ValidImplTypes, ValidStreamTypes, ValidParallelStreamTypes, ValidDependencies
from gui_tmpl import cmake_py_gui, pysalomeapp, cmake_cpp_gui, cppsalomeapp
from doc_tmpl import docmakefile, docconf, docsalomeapp
+import yacsgen_version
def makedirs(namedir):
"""Create a new directory named namedir. If a directory already exists copy it to namedir.bak"""
compolibs=component_libs,
with_doc=cmake_doc,
with_gui=cmake_gui,
- add_modules=add_modules),
+ add_modules=add_modules,
+ major_version=yacsgen_version.major_version,
+ minor_version=yacsgen_version.minor_version,
+ patch_version=yacsgen_version.patch_version),
"README":"", "NEWS":"", "AUTHORS":"", "ChangeLog":"",
"src":srcs,
"resources":{"CMakeLists.txt":cmake_ressources.substitute(
#without gui but with doc: create a small SalomeApp.xml in doc directory
if not os.path.exists(os.path.join(namedir, "doc", "SalomeApp.xml")):
#create a minimal SalomeApp.xml
- salomeapp=docsalomeapp.substitute(module=self.module.name,lmodule=self.module.name.lower())
+ salomeapp=docsalomeapp.substitute(module=self.module.name,
+ lmodule=self.module.name.lower(),
+ version=yacsgen_version.complete_version)
d["SalomeApp.xml"]=salomeapp
if not os.path.exists(os.path.join(namedir, "doc", "CMakeLists.txt")):
if not os.path.exists(os.path.join(namedir, "src", self.module.name+"GUI", "SalomeApp.xml")):
#create a minimal SalomeApp.xml
- salomeapp=pysalomeapp.substitute(module=self.module.name,lmodule=self.module.name.lower())
+ salomeapp=pysalomeapp.substitute(module=self.module.name,
+ lmodule=self.module.name.lower(),
+ version=yacsgen_version.complete_version)
d["SalomeApp.xml"]=salomeapp
return d
if not os.path.exists(os.path.join(namedir, "src", self.module.name+"GUI", "SalomeApp.xml")):
#create a minimal SalomeApp.xml
- salomeapp=cppsalomeapp.substitute(module=self.module.name,lmodule=self.module.name.lower())
+ salomeapp=cppsalomeapp.substitute(module=self.module.name,
+ lmodule=self.module.name.lower(),
+ version=yacsgen_version.complete_version)
d["SalomeApp.xml"]=salomeapp
return d
except:
from compat import Template,set
+# SalomeApp.xml file for a python gui.
+# template parameters:
+# module : module name
+# lmodule : module name in lower case
+# version : version number of the module
pysalomeapp="""
<document>
<section name="${module}">
<parameter name="icon" value="${module}.png"/>
<parameter name="library" value="SalomePyQtGUI"/>
<parameter name="documentation" value="${lmodule}_help"/>
+ <parameter name="version" value="${version}"/>
</section>
<section name="resources">
<parameter name="${module}" value="$${${module}_ROOT_DIR}/share/salome/resources/${lmodule}"/>
"""
pysalomeapp=Template(pysalomeapp)
+# SalomeApp.xml file for a cpp gui.
+# template parameters:
+# module : module name
+# lmodule : module name in lower case
+# version : version number of the module
cppsalomeapp="""
<document>
<section name="${module}">
<parameter name="name" value="${module}"/>
<parameter name="icon" value="${module}.png"/>
<parameter name="documentation" value="${lmodule}_help"/>
+ <parameter name="version" value="${version}"/>
</section>
<section name="resources">
<parameter name="${module}" value="$${${module}_ROOT_DIR}/share/salome/resources/${lmodule}"/>
# with_doc : ON|OFF
# with_gui : ON|OFF - module has its own GUI
# add_modules : code to find other modules
+# major_version : major version of the module
+# minor_version : minor version of the module
+# patch_version : patch version of the module
cmake_root_cpp = """
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
# Project name, upper case
STRING(TOUPPER $${PROJECT_NAME} PROJECT_NAME_UC)
-SET($${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET($${PROJECT_NAME_UC}_MINOR_VERSION 4)
-SET($${PROJECT_NAME_UC}_PATCH_VERSION 0)
+SET($${PROJECT_NAME_UC}_MAJOR_VERSION ${major_version})
+SET($${PROJECT_NAME_UC}_MINOR_VERSION ${minor_version})
+SET($${PROJECT_NAME_UC}_PATCH_VERSION ${patch_version})
SET($${PROJECT_NAME_UC}_VERSION
$${$${PROJECT_NAME_UC}_MAJOR_VERSION}.$${$${PROJECT_NAME_UC}_MINOR_VERSION}.$${$${PROJECT_NAME_UC}_PATCH_VERSION})
SET($${PROJECT_NAME_UC}_VERSION_DEV 1)
--- /dev/null
+# Copyright (C) 2009-2015 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+major_version=7
+minor_version=7
+patch_version=0
+complete_version="%d.%d.%d" % (major_version, minor_version, patch_version)
\ No newline at end of file
#
from distutils.core import setup
+from module_generator import yacsgen_version
setup(name='YACSGEN',
- version='7.7.0',
+ version=yacsgen_version.complete_version,
author='C. Caremoli',
packages=['module_generator'],
scripts=['script/hxx2salome.py',]