jll63 / yomm2

Fast, orthogonal, open multi-methods. Solve the Expression Problem in C++17.
Boost Software License 1.0
343 stars 18 forks source link

CMake warning related to policy CMP0048 #9

Closed derpda closed 4 years ago

derpda commented 4 years ago

First of all thank you for developing this great library, we are using it massively in our code.

Problem

One minor issue we have is that when building it automatically as an external dependency from the cmake script of our library, the following warning is generated

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

This is probably due to newer versions expecting the project version to be set in the project command. We try to minimize the amount of warnings and this is one of the last ones, so the perfectionist in me was motivated enough to write this issue. I hope you don't mind me taking your time on such a minor problem.

project (YOMM2)

set (YOMM2_VERSION_MAJOR 1)
set (YOMM2_VERSION_MINOR 0)

Suggestion

One option would be to require cmake 3.0 or higher which allows specifying the version in the project command and automatically defines YOMM2_VERSION_MINOR and YOMM2_VERSION_MAJOR. See here for more detail (3.0 version of documentation on purpose). This would remove warnings generated when building the library.

The resulting start of CMakeLists.txt would then become

# <COPYRIGHT NOTICE>

cmake_minimum_required (VERSION 3.0)

project (YOMM2 VERSION 1.0)

find_package(Boost)

# <Rest of script as is>

I will make an according small pull request and link this issue to it.

jll63 commented 4 years ago

Thanks for the nice words and the PR.

Can you share the name of your company and give an overview of the project(s) you use yomm2 in? I'd like to make a list of users. If it's not possible, no worry.

derpda commented 4 years ago

Thank you for the quick merge!

It's not a company, but research we do at Tokyo Institute of Technology on a low rank approximation framework! We use hierarchical matrices, and they hold an iterable container of matrices that don't have the same type necessarily. The classes are related through a common parent class and we use yomm's open multi-methods to implement the interactions. Thanks to yomm, we can do so in an extendible and clean way. I really with open multi-methods were a part of the language though...

The code is not yet public but will be open-source in the future, although we haven't decided on a license yet.

jll63 commented 4 years ago

Glad to hear that. When you go open-source, please notify me.

I will cut a new release when I have finalized support for friendship, and another improvement I have in mind.