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

Multiple entries for doxygenStripFromPath #108

Open
opelx opened this issue Apr 10, 2021 · 2 comments
Open

Multiple entries for doxygenStripFromPath #108

opelx opened this issue Apr 10, 2021 · 2 comments
Labels

Comments

@opelx
Copy link

opelx commented Apr 10, 2021

Hello,
I'm just starting with sphinx and exhale using it with CMake. CMake allows to generate setup.py where variables like @CMAKE_SOURCE_DIR@ and @CMAKE_BINARY_DIR@ are replaced by real paths during generating. The CMAKE_BINARY_DIR holds the path to the out of source build. These path I wan't to remove now. As you know Doxygen has STRIP_FROM_PATH for this which allows multiple entries. I failed with this to try this with doxygenStripFromPath too. Are multiple entries supported (my impression is not) and if yes, what is the syntax for this? The documentation isn't clear regards this.

@svenevs svenevs added the bug label May 7, 2021
@svenevs
Copy link
Owner

svenevs commented May 7, 2021

Currently only one path is allowed for the exhale configuration side. Kind of a frustrating design flaw you've found, the exhale configuration variable doxygenStripFromPath was mostly a hack and I didn't consider multiple entries... On the interface level in conf.py it can be updated to allow str or list[str].

Sorry for the long delay. I have some questions on your usage

CMake allows to generate setup.py where variables like @CMAKE_SOURCE_DIR@ and @CMAKE_BINARY_DIR@ are replaced by real paths during generating.

Do you mean conf.py for sphinx? (Not setup.py)? I ask because the above change sounds like it will resolve your scenario. Long term I think I just want to remove that configuration variable, it may be better to just parse it from the other user configs and/or possibly default it to something sane rather than it being required. Thoughts welcome 🙂

@opelx
Copy link
Author

opelx commented May 9, 2021

Thank you for your answer. Sorry for confusion, I did I mean conf.py. In the CMakeLists.txt (Like an "Control" File for CMake, equivalent to Makefile) I have:

configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in
    ${CMAKE_CURRENT_BINARY_DIR}/source/conf.py
    @ONLY
)

with conf.py.in this time:

exhale_args = {
    # These arguments are required
    "containmentFolder":     "./api",
    "rootFileName":          "testsuite_root.rst",
    "rootFileTitle":         "Testsuite API",
    "doxygenStripFromPath":  "@PROJECT_SOURCE_DIR@",
    # Suggested optional arguments
    "createTreeView":        True,
    "exhaleExecutesDoxygen": True,
    "exhaleDoxygenStdin":    textwrap.dedent('''
                            QUIET = YES
                            WARN_LOGFILE = "@DOXYGEN_OUTPUT_DIR@/DoxygenWarningLog.txt"
                            EXCLUDE_PATTERNS = pch*.hpp
                            WARN_IF_UNDOCUMENTED = NO
                            BUILTIN_STL_SUPPORT = YES
                            EXTRACT_ALL = YES
                            INTERNAL_DOCS = YES
                            GENERATE_TODOLIST = YES
                            INPUT = \
                                "@PROJECT_SOURCE_DIR@/testsuite/util/include" \
                                "@PROJECT_SOURCE_DIR@/testsuite/util/src" \
                                "@PROJECT_BINARY_DIR@/testsuite/util/include"
    ''')
}

where CMake knows how to replace @VARIABLES@.

I would suggest, that the user has to write/generate the the Doxyfile as he intended (and usually does), e.g. with own HTML enabled as fallback if wished. exhale should pick up variables required for exhaleDoxygenStdin from there.

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

No branches or pull requests

2 participants