20

I'm trying to compile LibPD and I am receiving a CMake error message. I have scourged the net for solutions dealing with this problem on Mac, but have found none that are from the past 10 years. I am receiving this error on both my MacBook Pro and my Mac tower desktop. :

I type:

cmake .. -GXcode 

I get:

CMake Error at /Applications/CMake.app/Contents/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): /Applications/CMake.app/Contents/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /Applications/CMake.app/Contents/share/cmake-3.13/Modules/FindThreads.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:317 (find_package) 

Thanks for the help.

1 Answer 1

38

Although I did not get this error on mojave, one way to deal with threads on mac is to tell cmake threads are built in.

# assume built-in pthreads on MacOS IF(APPLE) set(CMAKE_THREAD_LIBS_INIT "-lpthread") set(CMAKE_HAVE_THREADS_LIBRARY 1) set(CMAKE_USE_WIN32_THREADS_INIT 0) set(CMAKE_USE_PTHREADS_INIT 1) set(THREADS_PREFER_PTHREAD_FLAG ON) ENDIF() 
Sign up to request clarification or add additional context in comments.

3 Comments

Just had to refer to my own answer from three years ago.
I pasted this into the CMakeLists.txt file and it worked.
Works for me in Ubuntu Bionic as well

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.