summaryrefslogtreecommitdiff
blob: 0668f0466a9a532b9991318c578c6868c3ddc9b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
There is no IlmBaseConfig.h in OpenEXR 2.x

../libOpenImageIO/libOpenImageIO.so.1.3.5: error: undefined reference to 'pthread_mutexattr_init'
../libOpenImageIO/libOpenImageIO.so.1.3.5: error: undefined reference to 'pthread_mutexattr_settype'
../libOpenImageIO/libOpenImageIO.so.1.3.5: error: undefined reference to 'pthread_mutexattr_destroy'
../libOpenImageIO/libOpenImageIO.so.1.3.5: error: undefined reference to 'pthread_spin_lock'
../libOpenImageIO/libOpenImageIO.so.1.3.5: error: undefined reference to 'pthread_spin_unlock'
../libOpenImageIO/libOpenImageIO.so.1.3.5: error: undefined reference to 'pthread_spin_destroy'
../libOpenImageIO/libOpenImageIO.so.1.3.5: error: undefined reference to 'pthread_spin_init'
../libOpenImageIO/libOpenImageIO.so.1.3.5: error: undefined reference to 'pthread_detach'

--- src/cmake/modules/FindIlmBase.cmake
+++ src/cmake/modules/FindIlmBase.cmake
@@ -176,17 +176,11 @@
 set (ILMBASE_CACHED_STATE ${ILMBASE_CURRENT_STATE}
   CACHE INTERNAL "State last seen by FindIlmBase.cmake" FORCE)
 
-# Link with pthreads if required
-if (NOT WIN32 AND EXISTS ${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h)
-  file (STRINGS ${ILMBASE_INCLUDE_DIR}/OpenEXR/IlmBaseConfig.h
-    ILMBASE_HAVE_PTHREAD
-    REGEX "^[ \\t]*#define[ \\t]+HAVE_PTHREAD[ \\t]1[ \\t]*\$"
-  )
-  if (ILMBASE_HAVE_PTHREAD)
-    find_package (Threads)
-    if (CMAKE_USE_PTHREADS_INIT)
-      set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
-    endif ()
+# Always link to pthreads for OpenEXR 2.x
+if (NOT WIN32)
+  find_package (Threads)
+  if (CMAKE_USE_PTHREADS_INIT)
+    set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
   endif ()
 endif ()