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

Creeping complexity in CMakeLists due to folder structure #343

Open
amartyads opened this issue Sep 25, 2024 · 0 comments
Open

Creeping complexity in CMakeLists due to folder structure #343

amartyads opened this issue Sep 25, 2024 · 0 comments
Labels
clean-up related to the clean-up of the code and tech dept CMake

Comments

@amartyads
Copy link
Contributor

amartyads commented Sep 25, 2024

Currently, in src/CMakeLists.txt we have the following code:

# if mpi is not enabled, remove the unneeded source files
if(NOT ENABLE_MPI)
    # duplicate the list
    set(MY_SRC_BACK ${MY_SRC})
    # exclude everything from parallel
    list(FILTER MY_SRC EXCLUDE REGEX "/parallel/")

    # but include DomainDecompBase* and LoadCalc*
    list(FILTER MY_SRC_BACK INCLUDE REGEX "/parallel/")
    list(FILTER MY_SRC_BACK INCLUDE REGEX "DomainDecompBase|LoadCalc|Zonal|ForceHelper")
    list(APPEND MY_SRC ${MY_SRC_BACK})

This exclude/include with regex is not intuitive, error-prone and will get worse as more features are added. This can (and should) be mitigated with a better folder structure.

@amartyads amartyads added CMake clean-up related to the clean-up of the code and tech dept labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean-up related to the clean-up of the code and tech dept CMake
Projects
None yet
Development

No branches or pull requests

1 participant