Skip to content

CMake build is missing key features to be properly usable via FetchContent #550

Closed
@globberwops

Description

@globberwops

Describe the bug

The CMake build is missing key features to be properly usable via CMake's FetchContent module.

Describe how to reproduce the bug

Steps to reproduce the behavior:

  1. In a downstream CMake project, do
include(FetchContent)
FetchContent_Declare(
  open-simulation-interface
  GIT_REPOSITORY https://github.com/OpenSimulationInterface/open-simulation-interface.git
  GIT_TAG v3.3.1
)
FetchContent_MakeAvailable(open-simulation-interface)
  1. This will
    a. pollute your upstream project's cache with non-prefixed variables INSTALL_LIB_DIR, INSTALL_INCLUDE_DIR, and INSTALL_CMAKE_DIR
    b. not provide namespaced alias targets e.g. open-simulation-interface::static
    c. not install the export set with a namespace
    d. pollute the downstream project's build with an unnecessary, redundant warning:
    message(WARNING "Doxygen could not be found.")

Describe the expected behavior

  1. prefix cache variables with the project name
  2. provide namespaced alias targets usable from the build tree
  3. provide a namespace for the export set
  4. do not warn unnecessarily

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