]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/libmodbus/CMakeLists.txt
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / libmodbus / CMakeLists.txt
diff --git a/ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/libmodbus/CMakeLists.txt b/ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/libmodbus/CMakeLists.txt
new file mode 100644 (file)
index 0000000..618ba5f
--- /dev/null
@@ -0,0 +1,114 @@
+cmake_minimum_required(VERSION 3.0)\r
+project(libmodbus VERSION 3.1.6)\r
+\r
+set(LIBMODBUS_VERSION ${PROJECT_VERSION})\r
+set(LIBMODBUS_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})\r
+set(LIBMODBUS_VERSION_MINOR ${PROJECT_VERSION_MINOR})\r
+set(LIBMODBUS_VERSION_MICRO ${PROJECT_VERSION_PATCH})\r
+configure_file(src/modbus-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/modbus-version.h)\r
+\r
+if(WIN32)\r
+  set(HAVE_ERRNO_H 1)\r
+  set(HAVE_FCNTL_H 1)\r
+  set(HAVE_LIMITS_H 1)\r
+  set(HAVE_SYS_TYPES_H 1)\r
+  set(HAVE_TIME_H 1)\r
+  set(HAVE_MALLOC 1)\r
+  set(HAVE_MEMSET 1)\r
+  set(HAVE_STRERROR 1)\r
+else()\r
+  include(CheckIncludeFile)\r
+  check_include_file(arpa/inet.h HAVE_ARPA_INET_H)\r
+  check_include_file(byteswap.h HAVE_BYTESWAP_H)\r
+  check_include_file(errno.h HAVE_ERRNO_H)\r
+  check_include_file(fcntl.h HAVE_FCNTL_H)\r
+  check_include_file(limits.h HAVE_LIMITS_H)\r
+  check_include_file(linux/serial.h HAVE_LINUX_SERIAL_H)\r
+  check_include_file(netdb.h HAVE_NETDB_H)\r
+  check_include_file(netinet/in.h HAVE_NETINET_IN_H)\r
+  check_include_file(netinet/tcp.h HAVE_NETINET_TCP_H)\r
+  check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H)\r
+  check_include_file(sys/params.h HAVE_SYS_PARAMS_H)\r
+  check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)\r
+  check_include_file(sys/time.h HAVE_SYS_TIME_H)\r
+  check_include_file(sys/types.h HAVE_SYS_TYPES_H)\r
+  check_include_file(termios.h HAVE_TERMIOS_H)\r
+  check_include_file(time.h HAVE_TIME_H)\r
+  check_include_file(unistd.h HAVE_UNISTD_H)\r
+\r
+  include(CheckFunctionExists)\r
+  check_function_exists(accept4 HAVE_ACCEPT4)\r
+  check_function_exists(fork HAVE_FORK)\r
+  check_function_exists(getaddrinfo HAVE_GETADDRINFO)\r
+  check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)\r
+  check_function_exists(inet_ntoa HAVE_INET_NTOA)\r
+  check_function_exists(malloc HAVE_MALLOC)\r
+  check_function_exists(memset HAVE_MEMSET)\r
+  check_function_exists(select HAVE_SELECT)\r
+  check_function_exists(socket HAVE_SOCKET)\r
+  check_function_exists(strerror HAVE_STRERROR)\r
+  check_function_exists(strlcpy HAVE_STRLCPY)\r
+\r
+  include(CheckSymbolExists)\r
+  check_symbol_exists(TIOCSRS485 sys/ioctl.h HAVE_TIOCRS485)\r
+  check_symbol_exists(TIOCM_RTS sys/ioctl.h HAVE_TIOCM_RTS)\r
+endif()\r
+\r
+configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)\r
+\r
+\r
+if(BUILD_SHARED_LIBS)\r
+  add_compile_options(-DDLLBUILD=ON)\r
+else()\r
+  add_compile_options(-DLIBBUILD=ON)\r
+endif()\r
+\r
+set(MODBUS_PUBLIC_HEADERS\r
+  src/modbus-rtu.h\r
+  src/modbus-tcp.h\r
+  src/modbus.h\r
+  ${CMAKE_CURRENT_BINARY_DIR}/modbus-version.h\r
+)\r
+\r
+add_library(modbus\r
+  src/modbus-data.c\r
+  src/modbus-rtu.c\r
+  src/modbus-tcp.c\r
+src/modbus.c)\r
+\r
+target_include_directories(modbus PRIVATE ${CMAKE_CURRENT_BINARY_DIR})\r
+target_include_directories(modbus INTERFACE\r
+  $<INSTALL_INTERFACE:include>\r
+)\r
+set_target_properties(modbus PROPERTIES PUBLIC_HEADER "${MODBUS_PUBLIC_HEADERS}")\r
+\r
+if(CMAKE_COMPILER_IS_GNUCC)\r
+  target_compile_options(modbus PRIVATE -D_GNU_SOURCE)\r
+endif()\r
+\r
+if(WIN32)\r
+  target_link_libraries(modbus  wsock32 ws2_32)\r
+endif()\r
+\r
+set(LIBMODBUS_SOVERSION_VERSION 5.1.0)\r
+set(LIBMODBUS_SOVERSION_SOVERSION 5)\r
+\r
+\r
+set_target_properties(modbus PROPERTIES\r
+  VERSION ${LIBMODBUS_SOVERSION_VERSION}\r
+SOVERSION ${LIBMODBUS_SOVERSION_SOVERSION})\r
+\r
+\r
+install(\r
+  TARGETS modbus\r
+  EXPORT libmodbusConfig\r
+  RUNTIME DESTINATION bin\r
+  LIBRARY DESTINATION lib\r
+  ARCHIVE DESTINATION lib\r
+)\r
+install(EXPORT libmodbusConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)\r
+\r
+\r
+if(NOT DISABLE_INSTALL_HEADERS)\r
+  install(FILES ${MODBUS_PUBLIC_HEADERS} DESTINATION include/)\r
+endif()\r