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

configure_new errors with minimum required CMake version #2124

Open
Quba1 opened this issue Oct 30, 2024 · 0 comments
Open

configure_new errors with minimum required CMake version #2124

Quba1 opened this issue Oct 30, 2024 · 0 comments

Comments

@Quba1
Copy link

Quba1 commented Oct 30, 2024

CMakeLists.txt specifies minimum CMake version as 3.20

https://github.com/wrf-model/WRF/blob/c21d571d625286369212424810af300ca27495c6/CMakeLists.txt#L1C1-L1C39

However running configure_new with CMake version <3.23 fails with several errors like this:

CMake Error at cmake/target_source_properties.cmake:41 (define_property):
  define_property not given a BRIEF_DOCS <brief-doc> argument.
Call Stack (most recent call first):
  CMakeLists.txt:323 (define_target_source_properties)

This is because target_source_properties.cmake doesn't have BRIEF_DOCS and FULL_DOCS arguments in define_property():

foreach( PROPERTY ${FUNC_PROP_PROPERTIES} )
define_property(
SOURCE
PROPERTY ${PROPERTY}
# INHERITED # they will be "inherited" via target to source
)
define_property(
TARGET
PROPERTY ${PROPERTY}
# INHERITED # they will be "inherited" via target to source
)
endforeach()

Those arguments have been changed to optional in Cmake 3.23 (see docs).

With Cmake <3.23 I have found this workaround to solve the issue:

  foreach( PROPERTY ${FUNC_PROP_PROPERTIES} )
    define_property(
                    SOURCE
                    PROPERTY   ${PROPERTY}
                    # INHERITED # they will be "inherited" via target to source
                    BRIEF_DOCS "dummy docs"
                    FULL_DOCS "dummy docs"
                    )

    define_property(
                    TARGET
                    PROPERTY   ${PROPERTY}
                    # INHERITED # they will be "inherited" via target to source
                    BRIEF_DOCS "dummy docs"
                    FULL_DOCS "dummy docs"
                    )
  endforeach()

Thus to solve this issue either minimum Cmake version should be raised to 3.23 or a workaround similar to mine should be used. I'm happy to create PR for either solution when a decision is reached.

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

No branches or pull requests

1 participant