CMake: Support for XML documentation#1682
Conversation
|
@dsnopek should I add the main function in the doc_source_generator.py to match the latest build_profile.py ? |
|
Thanks! You can squash my commit in your commit, and I can close mine as superseded by yours.
UPDATE: I changed my mind on this bit - see comment below. |
Er, nevermind, thinking about this a little more, I think it's fine as a separate script. I don't want to end up with too many scripts at the top-level, but this is distinct enough from everything else However, to answer the original questsion: no, I don't think |
dsnopek
left a comment
There was a problem hiding this comment.
I just tried this with the test project and it worked great!
Skimming the code, that looks good to me too.
I think the only things this PR needs is:
- Squash my commit and your commit like I mentioned above (you can list me as
Co-authored-by:in the commit if you want, but my contribution is pretty small, I don't mind if it's omitted) - Rebase on
master, since I just merged PR #1670
Add new function generate_doc_source to python_callouts.cmake
Update Test extension to use generate_doc_source function and include generated file in the build.
Cleanup:
Fix godotcpp.py imports after rebase
Pre-Commit hook sorted python imports in doc_source_generator.py
- replace ${CMAKE_CURRENT_SOURCE_DIR} with ${godot-cpp_SOURCE_DIR} when referencing current working directory and script locations when invoking python scripts.
Co-authored-by: David Snopek <dsnopek@gmail.com>
532b7f9 to
8814ac5
Compare
This PR extends #1499 - [DRAFT] Add CMake support for XML documentation
which follows #1374 - Allow submitting documentation to the Godot editor
This is also built upon #1670 - CMake: Support for using build_profile.json
This PR adds the equivalent functionality to the CMake build scripts. A summary below.
The SCons implementation adds a BUILDER to the env in tools/godotcpp.py:513
Which is then available for consumers to use, with the test example showing how at test/SConstruct:18
This CMake implementationa mirrors this with a function in cmake/python_callouts.cmake:109
function( generate_doc_source OUTPUT_PATH XML_SOURCES ) - - - <snip> - - -which calls the python function of the same name from doc_source_generator.py to create the cpp file at OUTPUT_PATH which can then be added to the sources list of the target. The test extension shows this starting in test/CMakeLists.txt:10