prepare add_package_xml for usage outside conan scope
@@ -65,34 +65,38 @@ def convert_from_conan(package_path, name, version="0.0.1"):
_generate_conan_share_cmake(package_path, deps)
if sys.platform == "darwin":
_fix_rpaths(os.path.join(package_path, "lib"))
- _add_conan_package_xml(package_path, name, info, version)
+ add_package_xml(package_path, name, version, settings.get("os"))
res = _compress_package(package_path, name, settings, version)
ui.info(ui.green, "Archive generated in", res)
return res
-def _generate_conan_share_cmake(package_path, deps):
- """ Copy qibuild cmake module files. """
- name = deps.get("name")
- cmake_path = os.path.join(package_path, "share", "cmake")
- qisys.sh.mkdir(cmake_path, recursive=True)
- cmake_path = qibuild.cmake.modules.generate_cmake_module(package_path, name, deps)
- ui.info(ui.green, "CMake module generated in", ui.reset, ui.bold, cmake_path)
-
-
-def _add_conan_package_xml(package_path, name, info, version):
+def add_package_xml(package_path, name, version, target, licence):
""" Write an xml file to descibe the package. """
package_xml = os.path.join(package_path, "package.xml")
- ui.info(" -> Create package.xml for {}".format(name))
+ ui.info(" -> Create package.xml for {} v{}".format(name, version))
root = etree.Element('package')
root.set("name", name)
root.set("version", version)
- root.set("target", info.get("settings").get("os"))
- child = etree.Element("licence", text="BSD")
+ if target:
+ ui.info(" -> For target {}".format(target))
+ root.set("target", target)
+ if licence:
+ ui.info(" -> With license {}".format(licence))
+ child = etree.Element("licence", text=licence)
root.append(child)
qisys.qixml.write(root, package_xml)
+def _generate_conan_share_cmake(package_path, deps):
+ """ Copy qibuild cmake module files. """
+ name = deps.get("name")
+ cmake_path = os.path.join(package_path, "share", "cmake")
+ qisys.sh.mkdir(cmake_path, recursive=True)
+ cmake_path = qibuild.cmake.modules.generate_cmake_module(package_path, name, deps)
+ ui.info(ui.green, "CMake module generated in", ui.reset, ui.bold, cmake_path)
+
+
def _compress_package(package_path, name, settings, version):
""" Form the name and create the archive. """
parts = [name, settings.get("os"), settings.get("arch"), version]
