cameron314 / concurrentqueue

A fast multi-producer, multi-consumer lock-free concurrent queue for C++11
Other
10k stars 1.69k forks source link

Consider reviewing the include path for a CMake install #391

Open fedapo opened 5 months ago

fedapo commented 5 months ago

The CMake-based build+install works, but it ends up installing the header files in include/concurrentqueue/moodycamel. This forces client code to use this header inclusion:

#include <concurrentqueue/moodycamel/blockingconcurrentqueue.h>

While it would be preferable a simpler path, as this.

#include <concurrentqueue/blockingconcurrentqueue.h>

This is also the path taken by the concurrentqueue installation through Vcpkg and it is in the best interest for the spreading of the library that the two approaches are exactly the same. The line responsible for this, and the only one that should need to be changed is the following.

https://github.com/cameron314/concurrentqueue/blob/6dd38b8a1dbaa7863aa907045f32308a56a6ff5d/CMakeLists.txt#L61

Changed to this.

    ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}

I could take care of the change, but I need to understand there's agreement on it. Will this change find acceptance?

NOTE: Should it be critical to keep the word moodycamel in the path I'd suggest a more intuitive path.

#include <moodycamel/concurrentqueue/blockingconcurrentqueue.h>

The name of the organization (moodycamel) has a broader scope than the name of the library (concurrentqueue), it feel really weird that the two are inverted.