Skip to content

Include core modules in CMake config #38

Description

@olantwin

While packaging cetmodules for conda and aliBuild/bits for SHiP, I noticed that not all modules/tools are available included in the CMake config.

The cetmodulesConfig.cmake generated by cet_cmake_config() should auto-include the core modules that cetmodules' own CMakeLists.txt loads (all of which use include_guard(), so double-inclusion is safe). This would make find_package(cetmodules) a drop-in replacement for the FetchContent path, which is important for package managers (conda, spack, etc.) that provide pre-built cetmodules, requiring (trivial) patches.

I can prepare a small PR to address this, the patch we apply during the build currently is:

# Patch config so find_package(cetmodules) includes modules loaded via FetchContent
cat >> "${PREFIX}/share/cetmodules/cmake/cetmodulesConfig.cmake" <<'EOF'
include(CetProvideDependency)
include(CetCMakeEnv)
include(CetCMakeUtils)
include(CetCMakeConfig)
include(CetMake)
EOF

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions