CMake error. Specify a minimum version?

Hi,

When building OpenMC using the instructions under ‘Manually Installing from Source’ (Quick Install Guide — OpenMC Documentation) I received two errors when running CMake. The errors are:
– Did not find pugixml, will use submodule instead
CMake Error in vendor/pugixml/CMakeLists.txt:
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property “CXX_STANDARD” is not allowed.

CMake Error in vendor/pugixml/CMakeLists.txt:
INTERFACE_LIBRARY targets may only have whitelisted properties. The
property “CXX_EXTENSIONS” is not allowed.

I believe this is due to the version of CMake. I was running 3.16.3, which is a bit old! It might be worth specifying a minimum version of CMake to use to avoid confusion in future? Perhaps I have missed that somewhere.

Cheers,

Paul

Hi @pcosgrove,

Thank you for the notice!

The pugixml library is likely an INTERFACE library (common for header-only libraries), and CMake 3.16 doesn’t allow setting CXX_STANDARD on INTERFACE targets.

And yes, we really should declare a minimum CMake version for the project. I’ll address that shortly.

Circling back here, @pcosgrove. I made an issue about this in the OpenMC repo and we do in fact enforce a minimum CMake requirement of 3.16.

As for the error you’re seeing with 3.16.3, there’s a log there with a build of the development version of OpenMC using CMake 3.16.3 on Ubuntu 20.04. Is there a chance there’s something else at play in your case?