12.2.0 fails to build with old CMake 3.15.1
envgap__fmtlib__fmt-4818
01 / FAILURE SIGNATURE
As reported upstream
INTERFACE_LIBRARY targets may only have whitelisted properties. The
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
d24fef27d15adb537e60c7c8d54d4b5b23733949- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
fmtlib/fmt #4818 · read the original issue
Hello,
According to CMakeLists.txt supported version range it should work with 3.8 and newer versions. But on old 3.15.1 (default in OpenWRT 19.07) it broke in setup_target() function when specifying VERSION, SOVERSION and DEBUG_POSTFIX properties for INTERFACE type fmt-header-only target.
```
-- {fmt} version: 12.2.0
-- Build type: Release
CMake Error at CMakeLists.txt:259 (set_target_properties):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "VERSION" is not allowed.
Call Stack (most recent call first):
CMakeLists.txt:418 (setup_target)
CMake Error at CMakeLists.txt:259 (set_target_properties):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "SOVERSION" is not allowed.
Call Stack (most recent call first):
CMakeLists.txt:418 (setup_target)
CMake Error at CMakeLists.txt:259 (set_target_properties):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "DEBUG_POSTFIX" is not allowed.
Call Stack (most recent call first):
CMakeLists.txt:418 (setup_target)
```
This worked fine on 12.1.0. Not sure if it is best way, but can be fixed by not setting shared library specific properties for INTERFACE header-only targets. Patch in attachment
[001-fix-cmake.patch](https://github.com/user-attachments/files/29093843/001-fix-cmake.patch)
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]