[poppler] CMakeLists.txt utils/CMakeLists.txt

Pino Toscano pino at kemper.freedesktop.org
Mon Jul 8 10:43:02 PDT 2013


 CMakeLists.txt       |    6 +++---
 utils/CMakeLists.txt |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 44b7070aa713b2e20eb97b868000d432e2f8504e
Author: Pino Toscano <pino at kde.org>
Date:   Mon Jul 8 19:42:15 2013 +0200

    cmake: improve linking with pthreads
    
    Use the CMake-provided variable instead of hardcoding -lpthread.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d6cff5..3dbdbfc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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})
 
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 609f7ed..f82cfa4 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -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})


More information about the poppler mailing list