From b8002c04566731f8dab34cf9d8e883de51c4f7c3 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Fri, 24 Jun 2016 22:20:24 -0400 Subject: [PATCH] Manually link to thread library. This allows libcreate to build on ARM. --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f029641..727852b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8.3) project(libcreate) find_package(Boost REQUIRED system thread) +find_package(Threads REQUIRED) ## Specify additional locations of header files include_directories( @@ -16,6 +17,15 @@ add_library(create src/packet.cpp ) +if(THREADS_HAVE_PTHREAD_ARG) + set_property(TARGET create PROPERTY COMPILE_OPTIONS "-pthread") + set_property(TARGET create PROPERTY INTERFACE_COMPILE_OPTIONS "-pthread") +endif() + +if(CMAKE_THREAD_LIBS_INIT) + target_link_libraries(create "${CMAKE_THREAD_LIBS_INIT}") +endif() + target_link_libraries(create ${Boost_LIBRARIES} )