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

Does not compile with CMake version < 3.7 because of "VERSION_GREATER_EQUAL" #2320

Closed
twoixter opened this issue May 29, 2021 · 2 comments
Closed

Comments

@twoixter
Copy link
Contributor

Compilation fails with Unknown arguments specified with CMake versions < 3.7. The VERSION_GREATER_EQUAL command was introduced in CMake version 3.7 along with some other commands like GREATER_EQUAL, etc.

Error log:

[  0%] Performing update step for 'fmt'
Current branch master is up to date.
[  1%] Performing configure step for 'fmt'
-- CMake version: 3.5.1
CMake Error at CMakeLists.txt:86 (if):
  if given arguments:

    "CMAKE_CXX_STANDARD" "GREATER_EQUAL" "20" "AND" "CMAKE_CXX_COMPILER_VERSION" "VERSION_GREATER_EQUAL" "19.29.30036"

  Unknown arguments specified

This is caused by changes in the Module support by #2283 8 days ago:

if (CMAKE_CXX_STANDARD GREATER_EQUAL 20 AND
    # msvc 16.10-pre4
    MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30036)
  set(FMT_CAN_MODULE ON)
endif ()

This is fixed by changing:

  • GREATER_EQUAL 20 to GREATER 17
  • VERSION_GREATER_EQUAL 19.29.30036 to VERSION_GREATER 19.29.30035
@vitaut
Copy link
Contributor

vitaut commented May 29, 2021

Thanks for reporting. Could you submit a PR?

@twoixter
Copy link
Contributor Author

@vitaut Done! I think the solution proposed in the PR is fine, there is no CXX standards 18 & 19 so I kept it like GREATER 17. Same with the MSVC version, I downgraded it from 19.29.30036 to 19.29.30035 so I think it should still work.

@vitaut vitaut closed this as completed May 29, 2021
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

2 participants