Compilation of the multithreading example on Debian with CMake 3.5.1 would
fail with the following error because ${PTHREAD} was not set:
[ 61%] Linking CXX executable bin/multithreading
/usr/bin/ld: CMakeFiles/multithreading.dir/multithreading/multithreading.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
This patch uses ${CMAKE_THREAD_LIB_INIT} [1] instead, initialized using
find_package(Threads REQUIRED).
[1] https://cmake.org/cmake/help/v2.8.12/cmake.html#module:FindThreads
This find module addresses the problem raised by debian (non-sid) and
Ubuntu (and possibly other distributions) that don't install the cmake
config files.
This FindModule will try to use a config file, but will fall back to
using find_library if it can't.
It will unset any variables provided by the config that the find path
wont also expose.
The CMake project name is set to be the same as the name of the first example.
I suggest it gets changed to the name of the Visual Studio solution included in the repository.