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

Build issue: let user decide the MASTER_PROJECT variable #2098

Closed
randomizedthinking opened this issue Jan 16, 2021 · 1 comment
Closed

Build issue: let user decide the MASTER_PROJECT variable #2098

randomizedthinking opened this issue Jan 16, 2021 · 1 comment

Comments

@randomizedthinking
Copy link
Contributor

This is a small question on building the fmt library. In my use case, fmt is included as a git submodule, and I would like to build and install fmt automatically along with the main project. Yet, the current fmt CMakefile would not allow me to do it because the MASTER_PROJECT variable in CMakeLists.txt is determined in the build time.

The solution would be straightforward: define a FMT_MASTER_PROJECT and check whether it is defined before setting it up. If you think it is worthwhile to have, I can submit a PR.

if(NOT DEFINED FMT_MASTER_PROJECT)
    if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
        set(FMT_MASTER_PROJECT ON)
    else()
        set(FMT_MASTER_PROJECT OFF)
    endif()
endif()
@vitaut
Copy link
Contributor

vitaut commented Jan 16, 2021

Sounds reasonable. Please submit a PR to make MASTER_PROJECT configurable.

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

No branches or pull requests

2 participants