Skip to content

Modify CMake to make more things actually optional #1725

@CoryMartin-NOAA

Description

@CoryMartin-NOAA

For example:

if( eckit_FOUND AND oops_FOUND AND ioda_FOUND )
set(iodaconv_gsi_varbc_ENABLED True)
message(STATUS "Enabled Component: gsi bias converter")
else()
set(iodaconv_gsi_varbc_ENABLED False)
message(STATUS "Disabled Component: gsi bias converter")
endif()
if (NetCDF_Fortran_FOUND )
set(iodaconv_obserror_ENABLED True)
message(STATUS "Enabled Component: obserror converter")
else()
set(iodaconv_obserror_ENABLED False)
message(STATUS "Disabled Component: obserror converter")
endif()

These options are controlled by the presence of libraries but I don't think (according to Google Gemini LLM) we can actually overwrite these with CMake commands at the command line because they are not "options". We should have something like:

option( build_iodaconv_gsi_varbc ON)
if( eckit_FOUND AND oops_FOUND AND ioda_FOUND AND build_iodaconv_gsi_varbc )
    set(iodaconv_gsi_varbc_ENABLED True)
    message(STATUS "Enabled Component: gsi bias converter")
else()
    set(iodaconv_gsi_varbc_ENABLED False)
    message(STATUS "Disabled Component: gsi bias converter")
endif()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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