Hi everyone,

Does anyone know how to get CMake to configure properly without looking for a non-existent "pthreads" library? I'm using Qt 4.1.4 in packages on Fedora Core 5. My output reads as follows:

Qt Code:
  1. -- Check for working C compiler: gcc
  2. -- Check for working C compiler: gcc -- works
  3. -- Check size of void*
  4. -- Check size of void* - done
  5. -- Check for working CXX compiler: c++
  6. -- Check for working CXX compiler: c++ -- works
  7. -- Looking for Q_WS_X11
  8. -- Looking for Q_WS_X11 - found
  9. -- Looking for Q_WS_MAC
  10. -- Looking for Q_WS_MAC - not found.
  11. -- Looking for Q_WS_WIN
  12. -- Looking for Q_WS_WIN - not found.
  13. -- Found Qt-Version 4.1.4
  14. -- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
  15. -- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
  16. -- Looking for gethostbyname
  17. -- Looking for gethostbyname - found
  18. -- Looking for connect
  19. -- Looking for connect - found
  20. -- Looking for remove
  21. -- Looking for remove - found
  22. -- Looking for shmat
  23. -- Looking for shmat - found
  24. -- Looking for IceConnectionNumber in ICE
  25. -- Looking for IceConnectionNumber in ICE - found
  26. -- Looking for pthread.h
  27. -- Looking for pthread.h - found
  28. -- Looking for pthread_create in pthreads
  29. -- Looking for pthread_create in pthreads - not found
  30. -- Looking for pthread_create in pthread
  31. -- Looking for pthread_create in pthread - found
  32. CMake Error: Attempt to add link library "-lpthread" to target "/usr/lib/libQtCore.so" which is not built by this project.
  33. CMake Error: Attempt to add link library "dl" to target "/usr/lib/libQtCore.so" which is not built by this project.
  34. CMake Error: Attempt to add link library "/usr/lib/libQtGui.so" to target "/usr/lib/libQtCore.so" which is not built by this project.
  35. CMake Error: Attempt to add link library "-lSM" to target "/usr/lib/libQtCore.so" which is not built by this project.
  36. CMake Error: Attempt to add link library "-lICE" to target "/usr/lib/libQtCore.so" which is not built by this project.
  37. CMake Error: Attempt to add link library "/usr/lib/libX11.so" to target "/usr/lib/libQtCore.so" which is not built by this project.
  38. CMake Error: Attempt to add link library "/usr/lib/libXext.so" to target "/usr/lib/libQtCore.so" which is not built by this project.
  39. CMake Error: Attempt to add link library "/usr/lib/libQtNetwork.so" to target "/usr/lib/libQtCore.so" which is not built by this project.
  40. CMake Error: Attempt to add link library "/usr/lib/libQtNetwork_debug.so" to target "/usr/lib/libQtCore.so" which is not built by this project.
  41. CMake Error: Attempt to add link library "/usr/lib/libQtXml.so" to target "/usr/lib/libQtCore.so" which is not built by this project.
  42. CMake Error: Attempt to add link library "/usr/lib/libQtXml_debug.so" to target "/usr/lib/libQtCore.so" which is not built by this project.
  43. -- Configuring done
To copy to clipboard, switch view to plain text mode 

And the relevant section in CMakeFiles/CMakeError.log reads as follows:

Qt Code:
  1. Determining if the function pthread_create exists in the pthreads failed with the follow
  2. /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec
  3. gmake[1]: Entering directory `/home/indigojo/cvs/0.3/catkin-qtm/CMakeFiles/CMakeTmp'
  4. /usr/bin/cmake -E cmake_progress_report /home/indigojo/cvs/0.3/catkin-qtm/CMakeFiles/CMa
  5. Building C object CMakeFiles/cmTryCompileExec.dir/usr/share/cmake/Modules/CheckFunctionE
  6. /usr/bin/gcc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec.di
  7. Linking C executable cmTryCompileExec
  8. /usr/bin/cmake -P CMakeFiles/cmTryCompileExec.dir/cmake_clean_target.cmake
  9. /usr/bin/gcc -DCHECK_FUNCTION_EXISTS=pthread_create -fPIC "CMakeFiles/cmTryCompile
  10. /usr/bin/ld: cannot find -lpthreads
  11. collect2: ld returned 1 exit status
  12. gmake[1]: *** [cmTryCompileExec] Error 1
  13. gmake[1]: Leaving directory `/home/indigojo/cvs/0.3/catkin-qtm/CMakeFiles/CMakeTmp'
  14. gmake: *** [cmTryCompileExec/fast] Error 2
To copy to clipboard, switch view to plain text mode 

This is the first time I've actually written a CMakeLists.txt file and tried to run it, so I'm really quite new to the game, but I wanted to build an installable source bundle for my application. Is the solution to this to suppress the attempt to use the non-existent pthreads library, and if so how? If not, does anyone know what one does?