Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake script to add clang-uml as CMake target #46

Open
bkryza opened this issue Jun 23, 2022 · 3 comments
Open

Add CMake script to add clang-uml as CMake target #46

bkryza opened this issue Jun 23, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@bkryza
Copy link
Owner

bkryza commented Jun 23, 2022

Create installable cmake script allowing users to directly invoke clang-uml with required options from CMake.

@bkryza bkryza added the enhancement New feature or request label Jun 23, 2022
@DeveloperPaul123
Copy link

I could possibly help with this issue. How do you envision it working? Would the script provide a macro/function that users could then call on a particular CMake target?

Something like:

target_generate_uml(<TargetName> ...)

Or is the idea to be able to just invoke clang-uml through cmake?

@bkryza
Copy link
Owner Author

bkryza commented Jan 5, 2023

@DeveloperPaul123 As far as I remember it was intended more to be the latter, i.e. there would be a simple CMake module called for instance clang-uml.cmake that would get installed into CMake shared directory along with clang-uml.

It would contain something like:

# Targets to invoke clang-uml

# Get all project files
file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.hpp)

add_custom_target(
        clang-uml
        COMMAND /usr/bin/clang-uml
        <HERE MAYBE SOME MORE OPTIONS>
)

and then if in your projects CMakeLists.txt you've included it:

include(clang-uml.cmake)

it would allow you to simply run it using:

make clang-uml

However at the moment I'm not sure how to enable options to such Makefile targets so that it would make it useful, but if you have some ideas especially on how you would see it in your actual workflows please let me know...

@DeveloperPaul123
Copy link

@bkryza I see, that's definitely pretty simple to do.

I still have yet to use the tool, but can you have clang-uml export individual diagrams as separate files for each class? If that's the case then that would solve our problems and what your propose above would work fine.

Otherwise, we would need more fine grain control. Basically we would delegate responsibility of keeping our UML diagrams up to date to clang-uml which means that the generated UML diagrams need to be included in version control and be part of our Markdown documentation. So we would need a reliable way to create individual diagrams for specific classes/files.

Hopefully that makes sense...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants