Interface library warnings, but only when using cmake -E server mode
This is a regression with CMake 3.13.0-rc1.
Consider the following minimal project:
cmake_minimum_required(VERSION 3.7)
project(CMakeTest)
add_library(realstuff foo.cpp)
add_library(myiface INTERFACE)
target_link_libraries(myiface INTERFACE realstuff)
If processing this with cmake
or cmake-gui
, there are no warnings. If you load this project in Qt Creator, which uses cmake -E server
instead, there are many warnings about non-whitelisted properties that this project does not actually set. Here's an example of that output:
Starting to parse CMake project.
Configuring done
Generating done
CMake Error at CMakeLists.txt:6 (add_library):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "INTERPROCEDURAL_OPTIMIZATION_DEBUG" is not allowed.
CMake Error at CMakeLists.txt:6 (add_library):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "INTERPROCEDURAL_OPTIMIZATION" is not allowed.
CMake Error at CMakeLists.txt:6 (add_library):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "CXX_VISIBILITY_PRESET" is not allowed.
CMake Error at CMakeLists.txt:6 (add_library):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "COMPILE_FLAGS" is not allowed.
CMake Error at CMakeLists.txt:6 (add_library):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "CXX_EXTENSIONS" is not allowed.
CMake Error at CMakeLists.txt:6 (add_library):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "CXX_STANDARD" is not allowed.
CMake Error at CMakeLists.txt:6 (add_library):
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property "COMPILE_DEFINITIONS_DEBUG" is not allowed.
CMake Project was parsed successfully.
This does not occur when using 3.12.3, so it is a behaviour change with 3.13.0-rc1. Tested on Linux, if that matters.