-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CMake Support #61
Conversation
I will create Windows fix (conditional pthreads) once this is accepted, there is currently no way to build this on Windows (unless we use MinGW or something to build from make files). pthreads are only included by test target or manually if someone wants to use spinlock. |
What problem does your CMake support tries to solve? You can run Ubuntu natively in Windows and build Linux projects without having to write or change a line of code. https://ubuntu.com/desktop/wsl Boost is a number one dependency in all C++ projects I worked on since year 2004. Asking to ditch Boost and change code is an absurd request, in my opinion. CMake was created with a goal of being able to build C++ projects on different platforms. CMake support would need to be able to build tests and benchmarks on Windows to fulfil its purpose. Conan package manager solves the problem of acquiring libraries and making them available in CMake. |
The goal is to build natively on Windows and support CMake build systems without requiring 3rd party package managers or manual CMake configurations, even if this is just a header-only library.
Yes, that doesn't however solve the problem of targeting Windows natively.
That's fair. I proposed it as a way of getting around having to install 3rd party dependencies manually or using external package managers.
I can work on bringing the benchmark target to CMake and making it work on Windows. The main goal for me was to port the library and test targets to CMake. |
Ah, I see now.
Fair enough.
Fine, amputate boost.
Okay, benchmarks can be a tall order. |
Added basic CMake support
Because of the way dependencies are set up in benchmarking I did not implement benchmark target. Those could be implemented with either cmake's install + find_package or with FetchContent if respective libraries use CMake and are small enough.
Boost, which is used by the test target, is found using find_opackage. This causes some issues on Windows - the easiest way to get it to work on windows is by using vcpkg. To mitigate it, it would be the best to replace boost-test with google-test, which can be easily downloaded and installed per-repo with fetch_content.