Commit 44b7070a authored by Pino Toscano's avatar Pino Toscano

cmake: improve linking with pthreads

Use the CMake-provided variable instead of hardcoding -lpthread.
parent 69c281fd
......@@ -412,6 +412,9 @@ endif(PNG_FOUND)
if(TIFF_FOUND)
set(poppler_LIBS ${poppler_LIBS} ${TIFF_LIBRARIES})
endif(TIFF_FOUND)
if(HAVE_PTHREAD)
set(poppler_LIBS ${poppler_LIBS} ${CMAKE_THREAD_LIBS_INIT})
endif()
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
......@@ -422,9 +425,6 @@ add_library(poppler SHARED ${poppler_SRCS})
endif(MSVC)
set_target_properties(poppler PROPERTIES VERSION 41.0.0 SOVERSION 41)
target_link_libraries(poppler ${poppler_LIBS})
if(HAVE_PTHREAD)
target_link_libraries(poppler -lpthread)
endif()
target_link_libraries(poppler LINK_INTERFACE_LIBRARIES "")
install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
......
......@@ -37,7 +37,7 @@ if (HAVE_CAIRO)
target_link_libraries(pdftocairo ${LCMS_LIBRARIES})
endif(LCMS_FOUND)
if(HAVE_PTHREAD)
target_link_libraries(pdftocairo -lpthread)
target_link_libraries(pdftocairo ${CMAKE_THREAD_LIBS_INIT})
endif()
if(LCMS2_FOUND)
target_link_libraries(pdftocairo ${LCMS2_LIBRARIES})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment