Ticket #9833 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

CMake 3.0.0 warnings

Reported by: Samuel Jackson Owned by: Federico M Pouzols
Priority: minor Milestone: Release 3.3
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Steven Hahn

Description (last modified by Samuel Jackson) (diff)

I tried building Mantid with CMake 3.0.0. It worked great, but I get a bunch of warnings that look something like the following:

CMake Warning (dev) in MantidQt/Python/CMakeLists.txt:
  Policy CMP0043 is not set: Ignore COMPILE_DEFINITIONS_<Config> properties.
  Run "cmake --help-policy CMP0043" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

Here's what the CMake docs say about CMP0043: http://www.cmake.org/cmake/help/v3.0/policy/CMP0043.html

Probably not the most high priority ticket, but we will most likely have to deal with it sooner or later.

Change History

comment:1 in reply to: ↑ description Changed 6 years ago by Samuel Jackson

Last edited 6 years ago by Samuel Jackson (previous) (diff)

comment:2 Changed 6 years ago by Samuel Jackson

  • Description modified (diff)

comment:3 Changed 6 years ago by Samuel Jackson

  • Description modified (diff)

comment:4 Changed 6 years ago by Federico M Pouzols

  • Status changed from new to assigned
  • Owner changed from Anyone to Federico M Pouzols

comment:5 Changed 6 years ago by Federico Montesino Pouzols

  • Status changed from assigned to inprogress

User newer compiler defs syntax in cmake when possible, re #9833

Changeset: 9f26a4fa06437e4cb2e79047624dd7a8792bccf9

comment:6 Changed 6 years ago by Federico M Pouzols

  • Status changed from inprogress to verify
  • Resolution set to fixed

To test: build Mantid with a recent cmake (>3) and double-check that the annoying warnings are not shown anymore. This has been in the develop branch for a while, so I'd assume there's no bad surprises with this ticket.

If you happen to have an old cmake (<=2.8.9) at hand you can also test that it all builds fine. Some of the build machines do actually have such old cmakes and they have been happily building without any issues.


This is in principle simple to fix, provided that everybody had cmake >= 2.8.10 (http://www.cmake.org/cmake/help/v3.0/policy/CMP0043.html).

However, in the build servers it seems we still have an old cmake:

rhel6-build: cmake 2.8.9

(at least I've seen it in one of the Jenkins logs, then I've also seen 2.10.2)

The other systems would be ready for the new compile definitions style:

osx-10.8: cmake 2.8.12.2 / 2.8.11.2

ubuntu-14.04: cmake 2.8.12.2

win7: cmake 2.8.10.2

So I put the new style commands inside an if VERSION_GREATER, it should be safe for old cmakes out there. For me it's working fine in both debug and release builds, and it seems not to break the develop builds.

Last edited 6 years ago by Federico M Pouzols (previous) (diff)

comment:7 Changed 6 years ago by Harry Jeffery

  • Milestone changed from Backlog to Release 3.3

comment:8 Changed 6 years ago by Steven Hahn

  • Status changed from verify to verifying
  • Tester set to Steven Hahn

comment:9 Changed 6 years ago by Steven Hahn

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/9833_cmake_deprecated_compile_definitions_warning'

Full changeset: 9a87be8475e37a71562dbd38e798c2522c3b01af

comment:10 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10675

Note: See TracTickets for help on using tickets.