summaryrefslogtreecommitdiff
blob: f2a28042f8d1d2e790ce7cf2b1e5cd5c4b51bb66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- gdl-0.9.2/CMakeLists.txt	2011-11-06 22:39:45.000000000 +0000
+++ gdl-0.9.2/CMakeLists.txt.new	2012-06-21 00:02:42.000000000 +0100
@@ -217,6 +217,19 @@
 		add_definitions(${OpenMP_CXX_FLAGS})
 		set(LIBRARIES ${LIBRARIES} ${OpenMP_CXX_FLAGS})
 	endif(OPENMP_FOUND)
+else(OPENMP)
+  # we need to define those semaphore posix symbols, do it with threads libs
+  find_package(Threads)
+  if(THREADS_FOUND)
+    set(LIBRARIES ${LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+  else(THREADS_FOUND)
+    check_library_exists(rt sem_unlink "" HAVE_RT)
+    if(HAVE_RT)
+      set(LIBRARIES ${LIBRARIES} rt)
+    else(HAVE_RT)
+	message(FATAL_ERROR "Missing a POSIX semaphore symbols (rt or threads).\n")
+    endif(HAVE_RT)
+  endif(THREADS_FOUND)
 endif(OPENMP)
 
 # GSL MANDATORY