Cmake Policy CMP0048
kriegalex opened this issue · 3 comments
When integrating this project in an existing project using cmake and versioning, this happens :
CMake Warning (dev) at 3rdparty/PoissonReconstruction/CMakeLists.txt:3 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
PROJECT_VERSION
PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR
PROJECT_VERSION_PATCH
This warning is for project developers. Use -Wno-dev to suppress it.
There is two ways of fixing it :
- This project checks for cmake 3.0 minimum
cmake_minimum_required(VERSION 3.0)
- Set the policy behavior to
OLDNEW if cmake minimum should stay to 2.6
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
project(PoissonReconstruction)
I can PR it but it would require some more testing with old versions of cmake (<3.0)
For "individually maintained" projects like this, I'm totally fine with just supporting a "reasonable" version of everything (CMake, etc.). That is, I'm not worried about CMake < 3.0, but I don't want to require CMake 5 pre-alpha either :). So I'm happy to accept a pull request for this.
Ubuntu 16.04 LTS has been shipping for 2 years with cmake 3.5.X and now Ubuntu 18.04 LTS is shipping with 3.10.X. VTK 8.1.0 has a requirement for 3.3.
So I would say that cmake 3.0 is reasonable. I will PR it when I have time, thanks for yours.