0002-cmake-always-depend-on-threads-not-only-in-the-xmp-c.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From 7acb235c05089e82b16634383ac2b33721258ba1 Mon Sep 17 00:00:00 2001
  2. From: Bernd Kuhls <bernd.kuhls@t-online.de>
  3. Date: Sat, 3 Jun 2017 18:25:05 +0200
  4. Subject: [PATCH] cmake: always depend on threads, not only in the xmp case
  5. Patch sent upstream: https://github.com/Exiv2/exiv2/pull/7
  6. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  7. ---
  8. CMakeLists.txt | 1 -
  9. config/CMakeChecks.txt | 2 ++
  10. src/CMakeLists.txt | 2 ++
  11. 3 files changed, 4 insertions(+), 1 deletion(-)
  12. diff --git a/CMakeLists.txt b/CMakeLists.txt
  13. index 7034bb67..64604c6f 100644
  14. --- a/CMakeLists.txt
  15. +++ b/CMakeLists.txt
  16. @@ -120,7 +120,6 @@ IF( EXIV2_ENABLE_XMP )
  17. IF (NOT MINGW)
  18. set(THREADS_PREFER_PTHREAD_FLAG ON)
  19. ENDIF()
  20. - find_package(Threads REQUIRED)
  21. ENDIF( EXIV2_ENABLE_XMP )
  22. INCLUDE( config/CMakeChecks.txt )
  23. diff --git a/config/CMakeChecks.txt b/config/CMakeChecks.txt
  24. index b3a888f2..e0557642 100644
  25. --- a/config/CMakeChecks.txt
  26. +++ b/config/CMakeChecks.txt
  27. @@ -51,6 +51,8 @@ INCLUDE_DIRECTORIES( ${CMAKE_INCLUDE_PATH} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_C
  28. LINK_DIRECTORIES( ${CMAKE_LIBRARY_PATH} )
  29. SET( CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH} )
  30. +find_package(Threads REQUIRED)
  31. +
  32. IF( EXIV2_ENABLE_PNG )
  33. FIND_PACKAGE( ZLIB REQUIRED )
  34. INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR} )
  35. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  36. index aecd6215..15d521c5 100644
  37. --- a/src/CMakeLists.txt
  38. +++ b/src/CMakeLists.txt
  39. @@ -268,10 +268,12 @@ else()
  40. TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} dl ${EXPAT_LIBRARIES} )
  41. TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} dl ${CURL_LIBRARIES} )
  42. TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} dl ${SSH_LIBRARIES} )
  43. + TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} dl ${CMAKE_THREAD_LIBS_INIT} )
  44. else()
  45. TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${EXPAT_LIBRARIES} )
  46. TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${CURL_LIBRARIES} )
  47. TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${SSH_LIBRARIES} )
  48. + TARGET_LINK_LIBRARIES( exiv2lib ${PRIVATE_VAR} ${CMAKE_THREAD_LIBS_INIT} )
  49. endif()
  50. endif()
  51. --
  52. 2.11.0