mirror of
https://github.com/triqs/dft_tools
synced 2024-11-01 03:33:50 +01:00
ab3b9b3d4d
- Given a C++ file, e.g. a class, it calls libclang to parse the C++, and retrieve from its AST the necessary info to write a xxx_desc.py file. - THIS IS WORK IN PROGRESS. There are several corner cases for which we may want (or not) the script to do better. - It is not designed to be used automatically, but to to 90 % of the boring typesetting work... - The preamble still needs manual choices - The properties, methods, functions are automatically declared in the _desc file, in the simplest possible way. - An option --properties, -p : to transform some simple methods or get_x, set_x into python properties, not methods. Cf doc. - requires clang (tested on 3.4). - the script is configured by cmake and installed in INSTALLATION_DIRECTORY/bin, with some other files. It can only be used for applications, after the lib has been installed. It is cmake configured, to include automatically the various include paths configure in the triqs installation, including the triqs install dir in order to simplify invocation. - TODO : improve, and test more in real cases.
15 lines
812 B
CMake
15 lines
812 B
CMake
SET(PYTHON_SOURCES
|
|
${CMAKE_CURRENT_SOURCE_DIR}/wrap_generator.py
|
|
${CMAKE_CURRENT_SOURCE_DIR}/py_converter_wrapper.mako.hpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/wrapper.mako.cpp
|
|
)
|
|
|
|
install(FILES ${PYTHON_SOURCES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/triqs/wrap_generator)
|
|
|
|
# The desc_file generator from libclang ...
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/wrapper_desc_generator.py.in ${CMAKE_CURRENT_BINARY_DIR}/wrapper_desc_generator.py @ONLY)
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/wrapper_desc_generator.py DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/clang_parser.py DESTINATION bin)
|
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wrap_desc.mako.py DESTINATION share/triqs/wrap_generator/)
|
|
|