Skip to content

fix(cmake): move GNUInstallDirs include into cet_cmake_env macro#40

Open
greenc-FNAL wants to merge 1 commit into
developfrom
bugfix/macro-local-GNUInstallDirs
Open

fix(cmake): move GNUInstallDirs include into cet_cmake_env macro#40
greenc-FNAL wants to merge 1 commit into
developfrom
bugfix/macro-local-GNUInstallDirs

Conversation

@greenc-FNAL

Copy link
Copy Markdown
Member

The include(GNUInstallDirs) call performs work that must be
executed when cet_cmake_env() is called, not merely when the
CetCMakeEnv.cmake file is included.

Fixes #38, #39

The `include(GNUInstallDirs)` call performs work that must be
executed when `cet_cmake_env()` is called, not merely when the
`CetCMakeEnv.cmake` file is included.

Fixes #38, #39
Copilot AI review requested due to automatic review settings July 1, 2026 21:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts cet_cmake_env() initialization behavior so GNUInstallDirs is processed at the time the environment is bootstrapped (and in the caller’s scope), rather than when Modules/CetCMakeEnv.cmake is merely included. This aligns module behavior with subproject/FETCHCONTENT use cases and addresses the scope-related output/install-directory issues described in #39.

Changes:

  • Move include(GNUInstallDirs) from file scope into the cet_cmake_env() macro.
  • Keep the developer-warning suppression around GNUInstallDirs inclusion, but now applied at macro invocation time.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Modules/CetCMakeEnv.cmake
Comment on lines +107 to +118
# ##############################################################################
# See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html.
#
# We suppress developer warnings for this `include()` to silence
# complaints from CMake >=4 when no `LANGUAGES` are enabled for this
# project.
set(_cce_suppress_dev_warnings "$CACHE{CMAKE_SUPPRESS_DEVELOP_WARNINGS}")
set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS ON CACHE INTERNAL "" FORCE)
include(GNUInstallDirs)
set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS "${_cce_suppress_dev_warnings}" CACHE INTERNAL "" FORCE)
unset(_cce_suppress_dev_warnings)
# ##############################################################################
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

Successfully merging this pull request may close these issues.

Include core modules in CMake config

2 participants