Skip to content

Build issue: let user decide the MASTER_PROJECT variable #2098

Description

@randomizedthinking

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions