1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-22 19:54:57 +08:00

Configuring CMake to link against thread libraries

This is used to link against pthread and friends that are used for threading and mutex's.
This commit is contained in:
John Harrison 2012-02-06 18:20:15 -06:00
parent 18f86ebf4b
commit 61c193f5d8

View File

@ -32,6 +32,9 @@ macro(build_serial)
set(BUILD_SHARED_LIBS OFF)
ENDIF(NOT BUILD_SHARED_LIBS)
# Threading libraries added for mutexs
FIND_PACKAGE (Threads)
# Set the default path for built executables to the "bin" directory
IF(NOT DEFINED(EXECUTABLE_OUTPUT_PATH))
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
@ -60,6 +63,7 @@ macro(build_serial)
# Compile the Library
add_library(serial ${SERIAL_SRCS})
target_link_libraries(serial ${CMAKE_THREAD_LIBS_INIT})
## Build Examples