tqdm/tqdm.cpp

CMake support

tdegeus opened this issue · 11 comments

Nice library!

I wonder though, do you provide CMake support / would you be willing to consider this (I'm happy to open a PR)?

What exactly do you mean by CMake support?

I mean that it would be great if a CMake target be defined that contains the path where the header is installed. This way one can use CMake to configure, for example as follows:

cmake_minimum_required(VERSION 3.1)
project(example)
find_package(tqdm.cpp REQUIRED)
add_executable(example example.cpp)
target_link_libraries(example PRIVATE tqdm.cpp)

It's really not hard, and on top of that I would be willing to provide a PR

I am not a member of the tqdm org but looking at the commit history and their delayed/no response to PRs/issues tells me that they aren't interested in this C++ port of tqdm which is a pity.

I would love to see a similar scoped library for C++.

Hi; would be happy to accept a PR.

The library itself is really basic compared to the Python version and I'm unlikely to personally work on it more until I have a personal project which needs it (as with all my unpaid open source efforts :P).

I spend most of my time now wrapping CUDA/C/C++ in Python so happily get to use the latter for progress monitoring.

Also in simple cases you could always pipe the stderr or stdout of a C/C++/etc program to tqdm's CLI interface:

seq 10000 | python -m tqdm --null --total 10000

Alright, then I'll make a PR in the coming days. Would you be willing to create a release thereafter, such that I can add the library to conda-forge?

Thanks for the pipe suggestion, that is in fact really nice!

Yes, sure.

@casperdcl The lines under this if statement cause all kinds of problems on my system. What do they do? Are they really needed?

if(UNIX)

@tdegeus What OS are you on?

not super necessary - it's possible that maybe we should even leave out precompiled header logic altogether (leaving it as an optimisation for users to implement in case they want).

If it doesn't work on fruit, maybe try changing to:

if(UNIX AND NOT APPLE)