Confusing error message with cmake version 3.13 (or <3.16)
envgap__cuberite__cuberite-5097
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
959b26309319a199cf70fe362d360d11fe38b19a- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
cuberite/cuberite #5097 · read the original issue
Client version: N/A
Server OS: Linux
Cuberite Commit id: 90ce4ed2b8ac47bd6f528815e6c21f0128e71dba
### Description
Confusing CMake warning message caused by a minor typo in [CMakeLists.txt:85](https://github.com/cuberite/cuberite/blob/a145980795a4f37ebb9857bddb7427a184bbd6dd/CMakeLists.txt#L85).
### Expected behavior
CMake output:
```
...snip...
Precompiled headers for FASTER BUILDS not enabled, upgrade to CMake 3.16 or newer!
...snip...
```
### Actual behavior
CMake output:
```
...snip...
Precompiled headers for FASTER BUILDS not enabled, upgrade to CMake 1.16 or newer!
...snip...
```
### Steps to reproduce the behavior
Configure project using a cmake version >=3.13 and <3.16
### Server log
N/A
It could be changed to something like this:
```diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index da77aed5a..e4f99d125 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,14 +75,15 @@ set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${CMAKE_PROJECT_NAME})
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Server")
# Enable PCH and jumbo builds on supporting CMake:
-if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.16")
+set(CMAKE_PCH_VERSION_MIN "3.16")
+if (CMAKE_VERSION VERSION_GREATER_EQUAL ${CMAKE_PCH_VERSION_MIN})
if (PRECOMPILE_HEADERS)
target_precompile_headers(${CMAKE_PROJECT_NAME} PRIVATE src/Globals.h)
endif()
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES UNITY_BUILD ${UNITY_BUILDS})
else()
- message(WARNING "Precompiled headers for FASTER BUILDS not enabled, upgrade to CMake 1.16 or newer!")
+ message(WARNING "Precompiled headers for FASTER BUILDS not enabled, upgrade to CMake ${CMAKE_PCH_VERSION_MIN} or newer!")
endif()
# Selectively disable warnings in the level where the target is created:
```04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]