diff options
Diffstat (limited to 'vcpkg/ports/soem')
| -rw-r--r-- | vcpkg/ports/soem/disable-werror-and-wx.patch | 32 | ||||
| -rw-r--r-- | vcpkg/ports/soem/portfile.cmake | 33 | ||||
| -rw-r--r-- | vcpkg/ports/soem/vcpkg.json | 22 | ||||
| -rw-r--r-- | vcpkg/ports/soem/winpcap.patch | 25 |
4 files changed, 112 insertions, 0 deletions
diff --git a/vcpkg/ports/soem/disable-werror-and-wx.patch b/vcpkg/ports/soem/disable-werror-and-wx.patch new file mode 100644 index 0000000..4d683e4 --- /dev/null +++ b/vcpkg/ports/soem/disable-werror-and-wx.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7fa930c..5d96ae4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,16 +27,13 @@ if(WIN32) + 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 ${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") + set(OS_LIBS pthread rt) + elseif(APPLE) + # This must come *before* linux or MacOSX will identify as Unix. + set(OS "macosx") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") + set(OS_LIBS pthread pcap) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "rt-kernel") + set(OS "rtk") +@@ -45,10 +42,6 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "rt-kernel") + include_directories(oshw/${OS}/${ARCH}) + file(GLOB OSHW_EXTRA_SOURCES oshw/${OS}/${ARCH}/*.c) + set(OSHW_SOURCES "${OS_HW_SOURCES} ${OSHW_ARCHSOURCES}") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format") + set(OS_LIBS "-Wl,--start-group -l${BSP} -l${ARCH} -lkern -ldev -lsio -lblock -lfs -lusb -llwip -leth -li2c -lrtc -lcan -lnand -lspi -lnor -lpwm -ladc -ltrace -lc -lm -Wl,--end-group") + elseif(${CMAKE_SYSTEM_NAME} MATCHES "rtems") + message(STATUS "Building for RTEMS") diff --git a/vcpkg/ports/soem/portfile.cmake b/vcpkg/ports/soem/portfile.cmake new file mode 100644 index 0000000..6eb3a56 --- /dev/null +++ b/vcpkg/ports/soem/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO OpenEtherCATsociety/SOEM
+ REF a901500618405760a564e64a6816705e29f50f9f
+ SHA512 d554bc1c3780b1a81402a7fda490f516caba6bd943a28482740b5c9d97e4273a11546e79c92796487ee9901f568cbf1b329d4e1c1d32602fdce0088a77c82443
+ HEAD_REF master
+ PATCHES
+ winpcap.patch
+ disable-werror-and-wx.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_TESTS=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH "share/soem/cmake")
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/bin"
+ "${CURRENT_PACKAGES_DIR}/debug/bin"
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+)
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/soem/vcpkg.json b/vcpkg/ports/soem/vcpkg.json new file mode 100644 index 0000000..bad6e3e --- /dev/null +++ b/vcpkg/ports/soem/vcpkg.json @@ -0,0 +1,22 @@ +{ + "name": "soem", + "version-date": "2023-06-09", + "port-version": 2, + "description": "Simple Open Source EtherCAT Master", + "homepage": "https://github.com/OpenEtherCATsociety/SOEM", + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + { + "name": "winpcap", + "platform": "windows" + } + ] +} diff --git a/vcpkg/ports/soem/winpcap.patch b/vcpkg/ports/soem/winpcap.patch new file mode 100644 index 0000000..ca795f1 --- /dev/null +++ b/vcpkg/ports/soem/winpcap.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index baf26bd..7fa930c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,15 +22,13 @@ endif() + + if(WIN32) + set(OS "win32") +- include_directories(oshw/win32/wpcap/Include) +- if(CMAKE_SIZEOF_VOID_P EQUAL 8) +- link_directories(${CMAKE_CURRENT_LIST_DIR}/oshw/win32/wpcap/Lib/x64) +- elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) +- link_directories(${CMAKE_CURRENT_LIST_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") |