Skip to content

"Namespace" CMake target names to be able to build Umpire via CMake's FetchContent #965

@evaleev

Description

@evaleev

When trying to build Umpire using CMake's FetchContent module from within a large project we run into many target name clashes, e.g.

CMake Error at cmake-build-debug/_deps/umpire-src/blt/cmake/SetupDocs.cmake:9 (add_custom_target):
  add_custom_target cannot create target "docs" because another target with
  the same name already exists.  The existing target is a custom target
  created in source directory
  "/Users/efv/code/tiledarray/cmake-build-debug/_deps/parsec-src/docs".  See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  cmake-build-debug/_deps/umpire-src/blt/SetupBLT.cmake:141 (include)
  cmake-build-debug/_deps/umpire-src/CMakeLists.txt:77 (include)


CMake Error at cmake-build-debug/_deps/umpire-src/blt/cmake/SetupCodeChecks.cmake:9 (add_custom_target):
  add_custom_target cannot create target "check" because another target with
  the same name already exists.  The existing target is a custom target
  created in source directory "/Users/efv/code/madness".  See documentation
  for policy CMP0002 for more details.
Call Stack (most recent call first):
  cmake-build-debug/_deps/umpire-src/blt/SetupBLT.cmake:146 (include)
  cmake-build-debug/_deps/umpire-src/CMakeLists.txt:77 (include)

To solve this need to "namespace" all CMake targets, e.g. docs should become docs-blt, etc.

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