From ba54b806984d3c236cfc62621fb6edddfd2f59f1 Mon Sep 17 00:00:00 2001 From: Pavel Koshevoy Date: Sun, 19 May 2019 14:21:16 -0600 Subject: [PATCH 1/3] Add CMake support --- CMakeLists.txt | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d7c32ca --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,93 @@ +project(hdhomerun) +cmake_minimum_required(VERSION 3.0.2) + +set(hdhomerun_sources + hdhomerun_channels.c + hdhomerun_channelscan.c + hdhomerun_control.c + hdhomerun_debug.c + hdhomerun_device.c + hdhomerun_device_selector.c + hdhomerun_discover.c + hdhomerun_pkt.c + hdhomerun_video.c + ) + +set(hdhomerun_headers + hdhomerun_channels.h + hdhomerun_channelscan.h + hdhomerun_control.h + hdhomerun_debug.h + hdhomerun_device.h + hdhomerun_device_selector.h + hdhomerun_discover.h + hdhomerun.h + hdhomerun_os.h + hdhomerun_pkt.h + hdhomerun_sock.h + hdhomerun_types.h + hdhomerun_video.h + ) + +if (WIN32) + + set(hdhomerun_sources + ${hdhomerun_sources} + + hdhomerun_os_windows.c + hdhomerun_sock_windows.c + ) + + set(hdhomerun_headers + ${hdhomerun_headers} + + hdhomerun_os_windows.h + ) + + set(hdhomerun_libs iphlpapi ws2_32) + +else (WIN32) + + set(hdhomerun_sources + ${hdhomerun_sources} + + hdhomerun_os_posix.c + hdhomerun_sock_posix.c + ) + + set(hdhomerun_headers + ${hdhomerun_headers} + + hdhomerun_os_posix.h + ) + + set(hdhomerun_libs pthread) + + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(hdhomerun_libs ${hdhomerun_libs} rt) + endif() + + if (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") + set(hdhomerun_libs ${hdhomerun_libs} socket) + endif() +endif () + +add_library(hdhomerun SHARED ${hdhomerun_sources} ${hdhomerun_headers}) +target_compile_definitions(hdhomerun PRIVATE -DLIBHDHOMERUN_DLLEXPORT) +target_link_libraries(hdhomerun + PRIVATE + ${hdhomerun_libs} + ) + +install(TARGETS hdhomerun DESTINATION lib) +install(FILES ${hdhomerun_headers} DESTINATION include) + +add_executable(hdhomerun_config hdhomerun_config.c) +target_compile_definitions(hdhomerun_config PRIVATE -DLIBHDHOMERUN_DLLIMPORT) +target_link_libraries(hdhomerun_config + PRIVATE + hdhomerun + ${hdhomerun_libs} + ) + +install(TARGETS hdhomerun_config DESTINATION bin) From e0a3461d7401a22fafd1ce5d81b568ae0679c399 Mon Sep 17 00:00:00 2001 From: Pavel Koshevoy Date: Sun, 19 May 2019 14:21:16 -0600 Subject: [PATCH 2/3] Add CMake support --- CMakeLists.txt | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d7c32ca --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,93 @@ +project(hdhomerun) +cmake_minimum_required(VERSION 3.0.2) + +set(hdhomerun_sources + hdhomerun_channels.c + hdhomerun_channelscan.c + hdhomerun_control.c + hdhomerun_debug.c + hdhomerun_device.c + hdhomerun_device_selector.c + hdhomerun_discover.c + hdhomerun_pkt.c + hdhomerun_video.c + ) + +set(hdhomerun_headers + hdhomerun_channels.h + hdhomerun_channelscan.h + hdhomerun_control.h + hdhomerun_debug.h + hdhomerun_device.h + hdhomerun_device_selector.h + hdhomerun_discover.h + hdhomerun.h + hdhomerun_os.h + hdhomerun_pkt.h + hdhomerun_sock.h + hdhomerun_types.h + hdhomerun_video.h + ) + +if (WIN32) + + set(hdhomerun_sources + ${hdhomerun_sources} + + hdhomerun_os_windows.c + hdhomerun_sock_windows.c + ) + + set(hdhomerun_headers + ${hdhomerun_headers} + + hdhomerun_os_windows.h + ) + + set(hdhomerun_libs iphlpapi ws2_32) + +else (WIN32) + + set(hdhomerun_sources + ${hdhomerun_sources} + + hdhomerun_os_posix.c + hdhomerun_sock_posix.c + ) + + set(hdhomerun_headers + ${hdhomerun_headers} + + hdhomerun_os_posix.h + ) + + set(hdhomerun_libs pthread) + + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(hdhomerun_libs ${hdhomerun_libs} rt) + endif() + + if (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") + set(hdhomerun_libs ${hdhomerun_libs} socket) + endif() +endif () + +add_library(hdhomerun SHARED ${hdhomerun_sources} ${hdhomerun_headers}) +target_compile_definitions(hdhomerun PRIVATE -DLIBHDHOMERUN_DLLEXPORT) +target_link_libraries(hdhomerun + PRIVATE + ${hdhomerun_libs} + ) + +install(TARGETS hdhomerun DESTINATION lib) +install(FILES ${hdhomerun_headers} DESTINATION include) + +add_executable(hdhomerun_config hdhomerun_config.c) +target_compile_definitions(hdhomerun_config PRIVATE -DLIBHDHOMERUN_DLLIMPORT) +target_link_libraries(hdhomerun_config + PRIVATE + hdhomerun + ${hdhomerun_libs} + ) + +install(TARGETS hdhomerun_config DESTINATION bin) From 85ed34fd80084f4288c8ee16d48cc5cdb6a85a56 Mon Sep 17 00:00:00 2001 From: Pavel Koshevoy Date: Sun, 4 Dec 2022 12:05:32 -0700 Subject: [PATCH 3/3] Update to match upstream changes --- CMakeLists.txt | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7c32ca..69ebd70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,10 @@ set(hdhomerun_sources hdhomerun_device.c hdhomerun_device_selector.c hdhomerun_discover.c + hdhomerun_os_posix.c hdhomerun_pkt.c + hdhomerun_sock.c + hdhomerun_sock_posix.c hdhomerun_video.c ) @@ -35,7 +38,7 @@ if (WIN32) ${hdhomerun_sources} hdhomerun_os_windows.c - hdhomerun_sock_windows.c + hdhomerun_sock_netdevice.c ) set(hdhomerun_headers @@ -48,13 +51,6 @@ if (WIN32) else (WIN32) - set(hdhomerun_sources - ${hdhomerun_sources} - - hdhomerun_os_posix.c - hdhomerun_sock_posix.c - ) - set(hdhomerun_headers ${hdhomerun_headers} @@ -64,7 +60,16 @@ else (WIN32) set(hdhomerun_libs pthread) if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(hdhomerun_sources + ${hdhomerun_sources} + hdhomerun_sock_netlink.c + ) set(hdhomerun_libs ${hdhomerun_libs} rt) + else() + set(hdhomerun_sources + ${hdhomerun_sources} + hdhomerun_sock_getifaddrs.c + ) endif() if (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")