Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecbuild_add_option with REQUIRED_PACKAGES not correctly reflected in project summary #73

Open
marcosbento opened this issue Nov 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@marcosbento
Copy link
Collaborator

What happened?

As follow up to #65, we have found that when ecbuild_add_option is used with REQUIRED_PACKAGES to define project options, the project summary doesn't properly reflect the enabled/disabled options.

  1. When using CMakeLists.txt:
cmake_minimum_required( VERSION 3.18.4 FATAL_ERROR )
find_package( ecbuild 3.4 REQUIRED )

project( proja LANGUAGES NONE VERSION 0.2 )
ecbuild_add_option(
    FEATURE MYFEATURE
    DEFAULT ON
)

project( projb LANGUAGES NONE VERSION 0.1 )
ecbuild_add_option(
    FEATURE MYFEATURE
    DEFAULT OFF
)

project( projc LANGUAGES NONE VERSION 0.3 )
ecbuild_add_option(
    FEATURE MYFEATURE
    DEFAULT ON
    REQUIRED_PACKAGES unexistent       
)

ecbuild_print_summary()

the project configuration output shows option MYFEATURE disabled for projc:

-- [proja] (0.2)
-- Feature TESTS enabled
-- Feature PKGCONFIG enabled
-- Feature MYFEATURE enabled
-- ---------------------------------------------------------
-- [projb] (0.1)
-- Feature TESTS enabled
-- Feature PKGCONFIG enabled
-- Feature MYFEATURE enabled
-- ---------------------------------------------------------
-- [projc] (0.3)
-- Feature TESTS enabled
-- Feature PKGCONFIG enabled
-- Could NOT find unexistent (missing: unexistent_DIR)
-- projc FAILED to find OPTIONAL package unexistent
-- Could NOT find package unexistent required for feature MYFEATURE --
-- Feature MYFEATURE was not enabled (also not requested) -- following required packages weren't found: unexistent

while the project summary incorrect reports that MYFEATURE is enabled () for projc:

 * MYFEATURE, proja(✔): '', projb(✔): '', projc(✔): ''

What are the steps to reproduce the bug?

Configure the provided CMakeLists.txt.

Version

3.8.5

Platform (OS and architecture)

Linux/macOS

Relevant log output

No response

Accompanying data

No response

Organisation

ECMWF

@marcosbento marcosbento added the bug Something isn't working label Nov 12, 2024
@marcosbento marcosbento self-assigned this Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant