Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[oscpack] Initial commit
Browse files Browse the repository at this point in the history
daschuer committed Jan 16, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent d320630 commit 2061b46
Showing 7 changed files with 153 additions and 0 deletions.
51 changes: 51 additions & 0 deletions ports/oscpack/add-cmake-install-target.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 3a7ee65ecf43b97cc4a8c7cea5493de0d2b992fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <[email protected]>
Date: Wed, 15 Jan 2025 07:58:23 +0100
Subject: [PATCH] Add cmake install target

---
CMakeLists.txt | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e8bef70..4f200b2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,34 @@ osc/OscOutboundPacketStream.cpp

)

+set(IP_HEADERS
+ ip/IpEndpointName.h
+ ip/NetworkingUtils.h
+ ip/PacketListener.h
+ ip/TimerListener.h
+ ip/UdpSocket.h
+)
+
+
+set(OSC_HEADERS
+ osc/MessageMappingOscPacketListener.h
+ osc/OscException.h
+ osc/OscHostEndianness.h
+ osc/OscOutboundPacketStream.h
+ osc/OscPacketListener.h
+ osc/OscPrintReceivedElements.h
+ osc/OscReceivedElements.h
+ osc/OscTypes.h
+)
+
+INSTALL(TARGETS oscpack
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+
+INSTALL(FILES ${IP_HEADERS} DESTINATION include/ip)
+INSTALL(FILES ${OSC_HEADERS} DESTINATION include/osc)

ADD_EXECUTABLE(OscUnitTests tests/OscUnitTests.cpp)
TARGET_LINK_LIBRARIES(OscUnitTests oscpack ${LIBS})
--
2.34.1

25 changes: 25 additions & 0 deletions ports/oscpack/link-ws2_32-and-winmm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From d2a920a78f3b29df26d8e1e8ca6a0e93260999db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= <[email protected]>
Date: Wed, 15 Jan 2025 21:56:46 +0100
Subject: [PATCH] link Ws2_32 and winmm

---
CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1fc1fbe..1b3c4aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,6 +43,8 @@ osc/OscOutboundPacketStream.cpp

)

+TARGET_LINK_LIBRARIES(oscpack PRIVATE ${LIBS})
+
set(IP_HEADERS
ip/IpEndpointName.h
ip/NetworkingUtils.h
--
2.34.1

36 changes: 36 additions & 0 deletions ports/oscpack/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
set(opts "")
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(opts -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=ON)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO RossBencina/oscpack
REF release_1_1_0
SHA512 7a61a364cab4914c81e113d7aeee2b4accf5e560f500df6634232e0093f564ed4bb0ef8e87d2c8a18f245b0c7ec25f41e64f42f20a6654c22bb5c02aa253bbd0
PATCHES
add-cmake-install-target.patch
link-ws2_32-and-winmm.patch
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${opts}
)

vcpkg_cmake_build()

vcpkg_cmake_install()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"}
RENAME copyright
)

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

10 changes: 10 additions & 0 deletions ports/oscpack/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
oscpack can be used from CMake via:

find_path(OSCPACK_INCLUDE_DIRS "osc" PATH_SUFFIXES "oscpack")
find_library(OSCPACK_LIBRARY oscpack REQUIRED)
target_include_directories(main PRIVATE ${OSCPACK_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${OSCPACK_LIBRARY})

In case of Windows static link in addition:

target_link_libraries(main PRIVATE ws2_32 winmm)
18 changes: 18 additions & 0 deletions ports/oscpack/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "oscpack",
"version": "1.1.0",
"description": "A simple C++ Open Sound Control (OSC) packet manipulation library",
"homepage": "http://www.rossbencina.com/code/oscpack",
"license": null,
"supports": "!uwp & !xbox",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
@@ -6836,6 +6836,10 @@
"baseline": "1.5.1",
"port-version": 0
},
"oscpack": {
"baseline": "1.1.0",
"port-version": 0
},
"osg": {
"baseline": "3.6.5",
"port-version": 25
9 changes: 9 additions & 0 deletions versions/o-/oscpack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "8c69d566894d098325563c097fc0ae22a37ab709",
"version": "1.1.0",
"port-version": 0
}
]
}

0 comments on commit 2061b46

Please sign in to comment.