Bug #5803
closedcmake warning Policy CMP0022 is not set
0%
Description
Wtih wt-3.3.8, github version 3.3.8-rc1-8-gb56bc1de, I'm getting a cmake warning that "Policy CMP0022 is not set" with -DCMAKE_BUILD_TYPE=Debug. I don't think it occurs with RelWithDebInfo build or with wt4 Debug build, but I could be mistaken. I believe this started with commit 05a6858d. This is with Debian stretch and cmake version 3.7.2. Full cmake output with home dir path redacted is attached.
Files
Updated by Roel Standaert over 6 years ago
I've been seeing this warning sometimes, too. We don't actually define INTERFACE_LINK_LIBRARIES
or LINK_INTERFACE_LIBRARIES_DEBUG
, but instead use TARGET_LINK_LIBRARIES
with PRIVATE
and PUBLIC
, so I'm guessing that this is due to something in CMake internally? If you look at either property, you'll notice that they're actually the same, apart from the check whether we're making a debug build or not.
Of course, we could just set CMP0022 to NEW, but I think that if CMake was working properly, we shouldn't have to?
Updated by Bruce Toll over 6 years ago
I agree with you. If you evaluate the conditions, the library lists match. It wasn't clear to me whether cmake was capable of evaluating the conditions in that context or just chose to format the warning message with the conditions present. From stackoverflow, it looks like other projects have encountered the issue and I feel the cmake documentation could be clearer in this area.
But, if the build is correct with CMP0022 set to NEW, it might be expedient to set it and avoid the warning since this is intended to be the default cmake behavior in the future. But, I'm not sure how that would impact older versions of cmake that are still supported by Wt.
Updated by Roel Standaert over 6 years ago
- Status changed from New to Implemented @Emweb
I guess it can't hurt to set the property to NEW if it exists.
Updated by Roel Standaert over 6 years ago
- Status changed from Implemented @Emweb to Resolved
Updated by Roel Standaert over 6 years ago
- Status changed from Resolved to Closed