aantron / better-enums

C++ compile-time enum to string, iteration, in a single header file
http://aantron.github.io/better-enums
BSD 2-Clause "Simplified" License
1.65k stars 172 forks source link

CMake Package and Installation for Better Enums #37

Open FlorianWolters opened 7 years ago

FlorianWolters commented 7 years ago

In issue #24 this has been already discussed.

If Better Enums would provide a CMake Package, it would be much easier to use by clients.

Don't get me wrong: Copy & Pasting one header file isn't hard, but it is against the Don't Repeat Yourself Principle (DRYP). Currently I implemented a custom (old-style) FindBetterEnums.cmake CMake Find Module, but that is also a poor man's solution.

I think it would be much cleaner to provide a CMake package together with a proper CMake Installation.

I could provide a clean and modern CMakeLists.txt file for the project via a PR if it is desired (I have a bit of experience with CMake). @rcdailey already provided one, but it haven't been included in the master?


If this issue isn't rejected I would install Better Enum in a way, that #includes would look like the following (see #11):

#include <better_enum/enum.h>
#include <better_enum/n4428.h>

IMO that would be a little clearer.

BrainStone commented 1 year ago

Would it be possible to provide a snippet people who are not super farmiliar with CMake can just use?