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:
parent
18f86ebf4b
commit
61c193f5d8
@ -32,6 +32,9 @@ macro(build_serial)
|
|||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
ENDIF(NOT BUILD_SHARED_LIBS)
|
ENDIF(NOT BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
|
# Threading libraries added for mutexs
|
||||||
|
FIND_PACKAGE (Threads)
|
||||||
|
|
||||||
# Set the default path for built executables to the "bin" directory
|
# Set the default path for built executables to the "bin" directory
|
||||||
IF(NOT DEFINED(EXECUTABLE_OUTPUT_PATH))
|
IF(NOT DEFINED(EXECUTABLE_OUTPUT_PATH))
|
||||||
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
|
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
|
||||||
@ -60,6 +63,7 @@ macro(build_serial)
|
|||||||
|
|
||||||
# Compile the Library
|
# Compile the Library
|
||||||
add_library(serial ${SERIAL_SRCS})
|
add_library(serial ${SERIAL_SRCS})
|
||||||
|
target_link_libraries(serial ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
## Build Examples
|
## Build Examples
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user