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)
|