Rename some CMake vars to comply with CMP0048.
Issue
When compiling a project of mine using CMake and libsoundio, I get the following warning:
CMake Warning (dev) at src/voice-recog/libsoundio/CMakeLists.txt:2 (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
To be fair, it's not a serious blocker, but I like to compile release versions of my code without warnings. Seeing as this project definitely supports newer/modern CMake (3.0.0+), I think it's appropriate to apply this fix, as you've already set the project version, just in a non-standard way. Alternatively, you could add another policy override to OLD for this specific policy.
Reason
See the cmake doc for information on this policy.
Additional info
My project uses CMake 3.1+ and I have libsoundio submodularized with git. I use add_subdirectory() to include the library into my project.
Hey sorry for the delay. But does your patch work with cmake 2.8.5? If so, I'll merge it.
@andrewrk unfortunately, no. The policy CMP0048 was introduced in CMake 3.0. Is CMake 2.8.5 still a requirement?