This extends the existing XML-based template generator to allow an
additional kind of Python-based input.
The Python code is read as source code to an AST to a typed model
equivalent to the existing XML model, and processed by the existing
code templates into compatible code.
This provides a few benefits, namely readability is much increased,
but more importantly, it allows associating the APIs with Python's new
typing information, which will allow to provide accurate type hinting
without additional downstream processing in the future.
Right now this is just a proof-of-concept but if the approach is
well received, then a more complete implementation can be done with
further conversion of existing binding files.
Here is an example of how it looks, though I still think the metadata
is too verbose and can be made to look nicer with some further work.
```python
from ..Base.Metadata import metadata
from ..Base.Persistence import PersistencePy
from typing import Any, Optional, List
@metadata(
Father="PersistencePy",
Name="DocumentPy",
Twin="Document",
TwinPointer="Document",
Include="Gui/Document.h",
Namespace="Gui",
FatherInclude="Base/PersistencePy.h",
FatherNamespace="Base"
)
class DocumentPy(PersistencePy):
"""
This is a Document class.
Author: Werner Mayer (wmayer@users.sourceforge.net)
Licence: LGPL
"""
def __init__(self, *args: Any, **kwargs: Any) -> None:
"""
Constructor for DocumentPy.
"""
super(DocumentPy, self).__init__(*args, **kwargs)
pass
def show(self, objName: str) -> None:
"""
show(objName) -> None
Show an object.
Parameters:
objName (str): Name of the `Gui.ViewProvider` to show.
"""
pass
```
* cMake: Add base support for LibPack3
Minor changes to FreeCAD source code to support compiling with Qt 6.5 on MSVC,
and changes to cMake setup to support the new Libpack.
* NETGENPlugin: Fix compilation with MSVC and OCCT 7.8
* Material: Switch to Wrapped_ParseTupleAndKeywords for /fpermissive- on MSVC
* Base: Prevent accidental definition of MIN and MAX by MSVC
* cMake: Prevent accidentally finding an old LibPack
* Material: Wrap another ParseTuple call
* OCCT: Modify includes for 7.8.x
* Part: Change TNP code to use Wrapped_ParseTupleAndArgs
* Spreadsheet: Workaround for MSVC macro pollution
* Mesh: Workaround for MSVC macro pollution
* Base: Remove extra MSVC flag (moved to CMake)
* Tests: Fix compiling with /permissive-
* FEM: Fix Qt warnings about duplicate element names
* cMake: Ensure major version numbers are set
* Address review comments.
* cMake: Further tweaks for LibPack3
* cMake: Modify specification of compiler flags for MSVC
* Main: Remove QtQuick testing code
* cmake: Find Boost before SMESH (which uses it)
* Fixes for LibPack2
* cMake: Another try at importinhg VTK cleanly
In CMake 3.0 the policy CMP0050 was introduced where it could be set to OLD to keep this behaviour while for NEW an error was raised.
Since CMake 3.5.2 a warning comes up when using the OLD behaviour and that it will be removed in a future version.
In FreeCAD we switched to the new behaviour now and removed the SOURCE signature from add_custom_command which affects the macros
fc_copy_sources, fc_target_copy_resource and fc_target_copy_resource_flat and their usage.
It's not possible any more to add files to a target by using the macros. Now a file must be added to the target before using the macros.
This commit fixes it for Arch, Draft, OpenSCAD, Material, Plot and Ship
The previous steps of TO_NATIVE_PATH followed by ABSOLUTE
is not meaningful or reliable: output of ABSOLUTE is always in
"cmake" path format, not native path format. Native path input to
CMake commands may not do what you want.
set_target_properties used up until now in the SET_BIN_DIR macro sets
the INSTALL_RPATH property and discards whatever it contained before.
The INSTALL_RPATH target property is initialized with the cache variable
CMAKE_INSTALL_RPATH (possilbly given via the -D option of cmake). To
preserve this "default" value this commit replaced set_target_properties
with set_property(... APPEND ...).
Fixes:
-- Installing: /home/abuild/rpmbuild/BUILDROOT/FreeCAD-0.15.99+git20150727.1925-1.1.x86_64/usr/lib64/FreeCAD/lib/area.so
CMake Error at src/Mod/Path/libarea/cmake_install.cmake:53 (file):
file RPATH_CHANGE could not write new RPATH:
/usr/lib64/FreeCAD/lib
to the file:
/home/abuild/rpmbuild/BUILDROOT/FreeCAD-0.15.99+git20150727.1925-1.1.x86_64/usr/lib64/FreeCAD/lib/area.so
No valid ELF RPATH or RUNPATH entry exists in the file;