summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2012-02-07 10:37:50 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2012-02-07 10:37:50 +0100
commit884b1b4660cbc399565854bed90122ab3f906b91 (patch)
tree94c2b5496100c441154fe9842829f9cc177be8b1 /CMakeLists.txt
parent0408a26c145fe2188bdb86314b1f559044cba356 (diff)
downloadpcitool-884b1b4660cbc399565854bed90122ab3f906b91.tar.gz
pcitool-884b1b4660cbc399565854bed90122ab3f906b91.tar.bz2
pcitool-884b1b4660cbc399565854bed90122ab3f906b91.tar.xz
pcitool-884b1b4660cbc399565854bed90122ab3f906b91.zip
Portable pthreads detection
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e484f1d..3b25eb9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library")
find_package(PkgConfig REQUIRED)
+find_package(Threads REQUIRED)
#Check in sibling directory
pkg_check_modules(UFODECODE ufodecode REQUIRED)
@@ -18,7 +19,8 @@ if (NOT DISABLE_PCITOOL)
endif (NOT DISABLE_PCITOOL)
set(HEADERS pcilib.h pci.h register.h kmem.h irq.h dma.h event.h default.h tools.h error.h)
-add_definitions("-fPIC --std=c99 -Wall -O2 -pthread")
+add_definitions("-fPIC --std=c99 -Wall -O2")
+#add_definitions("-fPIC --std=c99 -Wall -O2 -pthread")
add_subdirectory(dma)
add_subdirectory(ipecamera)
@@ -31,7 +33,8 @@ add_dependencies(pcilib dma ipecamera)
set_target_properties(pcilib PROPERTIES
VERSION ${PCILIB_VERSION}
SOVERSION ${PCILIB_ABI_VERSION}
- LINK_FLAGS "-pthread"
+ LINK_FLAGS ${CMAKE_THREAD_LIBS_INIT}
+# LINK_FLAGS "-pthread"
# LINK_FLAGS "-pthread -Wl,--whole-archive,dma/libdma.a,ipecamera/libipecamera.a,--no-whole-archive"
)