File: SystemLibs.cmake

package info (click to toggle)
opencpn 1%3A5.10.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 164,172 kB
  • sloc: ansic: 515,707; cpp: 353,066; xml: 84,559; sh: 5,343; python: 1,833; makefile: 101; perl: 83; cs: 65; javascript: 65; ruby: 21
file content (28 lines) | stat: -rw-r--r-- 1,128 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Dummy definitions for systems like Debian which removes some bundled libs
# in the packaging

find_package(TinyXML REQUIRED)
message(STATUS "Building with system tinyxml")
add_library(TINYXML INTERFACE)
target_include_directories(TINYXML INTERFACE ${TINYXML_INCLUDE_DIR})
target_link_libraries(TINYXML INTERFACE ${TINYXML_LIBRARIES})
add_library(ocpn::tinyxml ALIAS TINYXML)

message(STATUS "Building with system serial lib")
add_library(SERIAL_IF INTERFACE)
find_library(LibSerial cxx-serial REQUIRED)
find_file(SerialHeader NAME serial.h  REQUIRED)
target_link_libraries(SERIAL_IF INTERFACE ${LibSerial})
add_library(ocpn::serial ALIAS SERIAL_IF)
set(HAVE_SYS_SERIAL_LIB ON CACHE BOOL "")

# The system libserial serial.h lives in /usr/include, not
# /usr/includ/7serial. Create a link which make the source code using
# "#include serial/serial.h" work.
if (NOT EXISTS ${CMAKE_BINARY_DIR}/include)
  file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include)
endif ()
execute_process(COMMAND ln -s /usr/include ${CMAKE_BINARY_DIR}/include/serial)

find_path(HAVE_STDINT_H NAMES stdint.h)
find_path(HAVE_SYS_SERIAL_LIB NAMES serial.h)