ERT: link to the pthreads library

this is required to make the opm-core build succeed if ERT was build
with -DBUILD_SHARED_LIBS=OFF . (without it, I get errors like

    /home/and/src/ert/devel/libert_util/src/thread_pool_posix.c:328: error: undefined reference to 'pthread_create'
This commit is contained in:
Andreas Lauser
2014-07-25 15:19:09 +02:00
parent cc79c93184
commit 316cf05666

View File

@@ -182,6 +182,11 @@ if (UNIX)
list (APPEND ERT_LIBRARIES ${MATH_LIBRARY})
endif (UNIX)
# if shared libraries are disabled on linux, explcitly linking to the
# pthreads library is required by ERT
find_package(Threads ${ERT_QUIET} REQUIRED)
list (APPEND ERT_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
# Platform specific library where dlopen with friends lives
list (APPEND ERT_LIBRARIES ${CMAKE_DL_LIBS})