mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 11:44:53 +08:00
cmake: Add defined so-version and public header to lib.
Adding a so-version means defining an ABI level. This level is decoupled from the ordinary version, even a major version change doesn't necessarily mean that the so-version should change (and thus have all dependencies to be rebuilt). Adding the public header to clarify the setup. Note: cherry-pick from PR #231 Conflicts: CMakeLists.txt Author: Alec Leamas <leamas.alec@gmail.com> Date: Tue Sep 22 13:28:04 2020 +0200 Gbp-Pq: Name 0002-cmake-Add-defined-so-version-and-public-header-to-li.patch Signed-off-by: Alex Moriarty <alex.moriarty@picknik.ai>
This commit is contained in:
parent
c9da89d348
commit
61da1e2c99
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.5.0)
|
||||
|
||||
# General setup
|
||||
set(PROJ_SOVERSION 1)
|
||||
project(serial
|
||||
VERSION 1.2.1
|
||||
DESCRIPTION "Cross-platform, Serial Port library written in C++"
|
||||
@ -33,9 +34,18 @@ else()
|
||||
endif()
|
||||
|
||||
## Add serial library
|
||||
set(serial_HEADERS
|
||||
include/serial/serial.h
|
||||
include/serial/v8stdint.h
|
||||
)
|
||||
# Build, link and install main library
|
||||
add_library(${PROJECT_NAME} ${serial_SRCS})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON)
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJ_SOVERSION}
|
||||
PUBLIC_HEADER "${serial_HEADERS}"
|
||||
)
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||
|
||||
if(APPLE)
|
||||
target_link_libraries(${PROJECT_NAME} ${FOUNDATION_LIBRARY} ${IOKIT_LIBRARY})
|
||||
@ -58,6 +68,7 @@ install(TARGETS ${PROJECT_NAME}
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
PUBLIC_HEADER DESTINATION include/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
## Install headers
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user