[soem] Add new port (#9572)

* initial SOEM port.

* don't use the vendored winpcap.

* removed the unused flag.

* addressed feedback.

* addressed feedback.
This commit is contained in:
Sean Yen 2020-01-14 12:28:06 -08:00 committed by Victor Romero
parent a982079028
commit fc5134c3a2
4 changed files with 59 additions and 0 deletions

5
ports/soem/CONTROL Normal file
View File

@ -0,0 +1,5 @@
Source: soem
Version: 1.4.0
Homepage: https://github.com/OpenEtherCATsociety/SOEM
Description: Simple Open Source EtherCAT Master
Build-Depends: winpcap (windows)

29
ports/soem/portfile.cmake Normal file
View File

@ -0,0 +1,29 @@
vcpkg_fail_port_install(ON_TARGET "UWP")
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OpenEtherCATsociety/SOEM
REF abbf0d42e38d6cfbaa4c1e9e8e07ace651c386fd #v1.4.0
SHA512 2967775c6746bb63becea5eb12f136c184bbf874e1e5e8753374bfc212ec9cefbf1159350e79627b978af3562d261b61c50f38936a425c4d9c70598a1d136817
HEAD_REF master
PATCHES
winpcap.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin
${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

23
ports/soem/winpcap.patch Normal file
View File

@ -0,0 +1,23 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -13,15 +13,13 @@
if(WIN32)
set(OS "win32")
- include_directories(oshw/win32/wpcap/Include)
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- link_directories(${CMAKE_SOURCE_DIR}/oshw/win32/wpcap/Lib/x64)
- elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
- link_directories(${CMAKE_SOURCE_DIR}/oshw/win32/wpcap/Lib)
- endif()
+ find_path(winpcap_INCLUDE_DIRS NAMES pcap.h)
+ find_library(winpcap_LIBRARY NAMES wpcap)
+ find_library(packet_LIBRARY NAMES packet)
+ include_directories(${winpcap_INCLUDE_DIRS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_NO_WARNINGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
- set(OS_LIBS wpcap.lib Packet.lib Ws2_32.lib Winmm.lib)
+ set(OS_LIBS ${winpcap_LIBRARY} ${packet_LIBRARY} Ws2_32.lib Winmm.lib)
elseif(UNIX AND NOT APPLE)
set(OS "linux")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")

View File

@ -1562,6 +1562,8 @@ smpeg2:x64-linux=fail
smpeg2:x64-uwp=fail
soci:arm-uwp=fail
soci:x64-uwp=fail
soem:x64-uwp=fail
soem:arm-uwp=fail
soil:arm-uwp=fail
soil:x64-uwp=fail
soil2:arm-uwp=fail