I'm ruinning on RHEL 5.1 and use gcc.
How I tell cmake to add -pthread to compilation and linking?
I'm ruinning on RHEL 5.1 and use gcc.
How I tell cmake to add -pthread to compilation and linking?
Should be as simple as adding
find_package(PTHREAD)
to your CMakeLists.txt file
Take a look at this link for more details
Here is the right anwser:
ADD_EXECUTABLE(your_executable ${source_files})
TARGET_LINK_LIBRARIES(
pthread
)
equivalent to
-lpthread