As you can see, I call find_package(Threads REQUIRED)
but at no point my example executables, named udp and tcp, link to -pthread (or -lpthread) (which of course makes my build fails). I also tried to link them explicitely to Threads::Threads. This did not work either.
e.g. when doing make in verbose mode, the link invocation is :