From 67a47858f0230d942baaa2854c2715bc7bae5153 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 09:29:38 -0600 Subject: [PATCH 01/21] Create .travis.yml --- .travis.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c88a316 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +language: c + +os: + - linux + - osx + +compiler: + - clang + - gcc + +#before_install: +# - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update --all; fi +# +#install: +# - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install yasm; fi + +script: + - make From 5554e993fdbb2e57da092d8be240b707b08c31ee Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 09:31:38 -0600 Subject: [PATCH 02/21] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c88a316..0aed2bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,5 @@ compiler: # #install: # - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install yasm; fi - script: - make From ab7189d1daf06a16f565876dac0733318d0cac4a Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 09:36:07 -0600 Subject: [PATCH 03/21] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c24502..36c35f9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -Copyright © 2005-2016 Silicondust USA Inc. . +[![Build Status](https://travis-ci.org/zcsizmadia/libhdhomerun.svg?branch=master)](https://travis-ci.org/zcsizmadia/libhdhomerun) + +Copyright © 2005-2016 Silicondust USA Inc. . This library implements the libhdhomerun protocol for use with Silicondust HDHomeRun TV tuners. From 25cbab1ffb9325d7a1414f8bb6bd467b4295f125 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 09:40:04 -0600 Subject: [PATCH 04/21] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36c35f9..6a680a1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/zcsizmadia/libhdhomerun.svg?branch=master)](https://travis-ci.org/zcsizmadia/libhdhomerun) +[![Build Status](https://travis-ci.org/Silicondust/libhdhomerun.svg?branch=master)](https://travis-ci.org/Silicondust/libhdhomerun) Copyright © 2005-2016 Silicondust USA Inc. . From 4d995a3453a2bff7982b0fead4b478c0b498d2d7 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 09:40:38 -0600 Subject: [PATCH 05/21] Update .travis.yml --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0aed2bd..a67b235 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,5 @@ compiler: - clang - gcc -#before_install: -# - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update --all; fi -# -#install: -# - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install yasm; fi script: - make From d1c5d0d255ee9c69c50f7f039adc2737145bc62d Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 09:47:38 -0600 Subject: [PATCH 06/21] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a680a1..36c35f9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/Silicondust/libhdhomerun.svg?branch=master)](https://travis-ci.org/Silicondust/libhdhomerun) +[![Build Status](https://travis-ci.org/zcsizmadia/libhdhomerun.svg?branch=master)](https://travis-ci.org/zcsizmadia/libhdhomerun) Copyright © 2005-2016 Silicondust USA Inc. . From adeaf7438f28052d18a2c78bdb5cda871f5fc965 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 16:26:57 -0600 Subject: [PATCH 07/21] Create CMakeLists.txt --- CMakeLists.txt | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..fd7a6ab --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required(VERSION 2.8) + +project(hdhomerun) + +set(SOURCES + hdhomerun_channels.c + hdhomerun_channelscan.c + hdhomerun_control.c + hdhomerun_debug.c + hdhomerun_device.c + hdhomerun_discover.c + hdhomerun_pkt.c + hdhomerun_video.c) + +set(HEADERS + ${PROJECT_SOURCE_DIR}/hdhomerun.h + hdhomerun_channels.h + hdhomerun_channelscan.h + hdhomerun_control.h + hdhomerun_debug.h + hdhomerun_device.h + hdhomerun_device_selector.h + hdhomerun_discover.h + hdhomerun_pkt.h + hdhomerun_sock.h + hdhomerun_types.h + hdhomerun_os.h + hdhomerun_video.h) + +if(WIN32) + LIST(APPEND SOURCES hdhomerun_os_windows.c) + LIST(APPEND SOURCES hdhomerun_sock_windows.c) + LIST(APPEND HEADERS hdhomerun_os_windows.h) +else() + LIST(APPEND SOURCES hdhomerun_os_posix.c) + LIST(APPEND SOURCES hdhomerun_sock_posix.c) + LIST(APPEND HEADERS hdhomerun_os_posix.h) +endif() + +if(WIN32) + list(APPEND DEPLIBS ws2_32) + list(APPEND DEPLIBS iphlpapi) +endif() + +if(MSVC) + set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE "CXX") + add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS) +endif() + +add_library(hdhomerun SHARED ${SOURCES}) +target_link_libraries(hdhomerun ${DEPLIBS}) + +if(WIN32) + set_target_properties(hdhomerun PROPERTIES DEFINE_SYMBOL "LIBHDHOMERUN_DLLEXPORT") +endif() + +add_executable(hdhomerun_config hdhomerun_config.c) +target_link_libraries(hdhomerun_config hdhomerun) + +include_directories(${PROJECT_SOURCE_DIR}) + +install(FILES ${HEADERS} DESTINATION include/hdhomerun) +install(TARGETS hdhomerun hdhomerun_config + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) From ddbaf786081313f8f788f0aea6527c3e7b7369ef Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 16:37:22 -0600 Subject: [PATCH 08/21] Update CMakeLists.txt --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd7a6ab..3db11df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,8 @@ endif() if(WIN32) list(APPEND DEPLIBS ws2_32) list(APPEND DEPLIBS iphlpapi) +else() + list(APPEND DEPLIBS pthread) endif() if(MSVC) From 2f9386f767e67cb9be8dd0dcd2e78445b7bf2092 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 16:38:10 -0600 Subject: [PATCH 09/21] Update .travis.yml --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a67b235..5e51e0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,6 @@ compiler: - gcc script: - - make + #- make + - cmake . + - cmake --build . From 0c5ecde0354d5d56cfbbd67732fc3fd059e48f77 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 16:41:07 -0600 Subject: [PATCH 10/21] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3db11df..1897cc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ if(WIN32) list(APPEND DEPLIBS ws2_32) list(APPEND DEPLIBS iphlpapi) else() - list(APPEND DEPLIBS pthread) + list(APPEND DEPLIBS pthread rt) endif() if(MSVC) From 0b38d5a59f2c1fa35e3425d00fe5ae7359b342d8 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 16:46:38 -0600 Subject: [PATCH 11/21] Update CMakeLists.txt --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1897cc8..d500dc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,9 +38,8 @@ else() endif() if(WIN32) - list(APPEND DEPLIBS ws2_32) - list(APPEND DEPLIBS iphlpapi) -else() + list(APPEND DEPLIBS ws2_32 iphlpapi) +elsif (${UNIX}) list(APPEND DEPLIBS pthread rt) endif() From 5965957050cb17d31ac57199110b042d8b8a817e Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 16:49:19 -0600 Subject: [PATCH 12/21] Update CMakeLists.txt --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d500dc7..6fba044 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,8 +39,11 @@ endif() if(WIN32) list(APPEND DEPLIBS ws2_32 iphlpapi) -elsif (${UNIX}) - list(APPEND DEPLIBS pthread rt) +elsif() + list(APPEND DEPLIBS pthread) + if (UNIX) + list(APPEND DEPLIBS rt) + endif() endif() if(MSVC) From 838534f4419ca9241feb49899848af2ea6c3cebb Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 17:00:15 -0600 Subject: [PATCH 13/21] Update CMakeLists.txt --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fba044..3728458 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.8) project(hdhomerun) +include(CheckLibraryExists) + set(SOURCES hdhomerun_channels.c hdhomerun_channelscan.c @@ -41,7 +43,8 @@ if(WIN32) list(APPEND DEPLIBS ws2_32 iphlpapi) elsif() list(APPEND DEPLIBS pthread) - if (UNIX) + check_library_exists(rt clock_gettime "" HAS_LIBRT) + if (HAS_LIBRT) list(APPEND DEPLIBS rt) endif() endif() From 5cd6f8fa8027452f596cb5ffea26f67787a91eee Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 17:03:01 -0600 Subject: [PATCH 14/21] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3728458..6068be0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ endif() if(WIN32) list(APPEND DEPLIBS ws2_32 iphlpapi) -elsif() +else() list(APPEND DEPLIBS pthread) check_library_exists(rt clock_gettime "" HAS_LIBRT) if (HAS_LIBRT) From c0e092f19e43176e60b7d894e5625bca2eace9e2 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 17:25:52 -0600 Subject: [PATCH 15/21] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5e51e0d..4d32db1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,3 +12,4 @@ script: #- make - cmake . - cmake --build . + - ./hdhomerun_config From deae6bbc3e36404243a877a9a500126eb94ae682 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sat, 5 Mar 2016 17:27:34 -0600 Subject: [PATCH 16/21] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4d32db1..5e51e0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,3 @@ script: #- make - cmake . - cmake --build . - - ./hdhomerun_config From 85e043ec4404146b353cc02f01dff286091223a8 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sun, 6 Mar 2016 07:52:17 -0600 Subject: [PATCH 17/21] Update CMakeLists.txt --- CMakeLists.txt | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6068be0..f2116ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,11 +42,18 @@ endif() if(WIN32) list(APPEND DEPLIBS ws2_32 iphlpapi) else() - list(APPEND DEPLIBS pthread) - check_library_exists(rt clock_gettime "" HAS_LIBRT) - if (HAS_LIBRT) + check_library_exists(pthreads pthread_create HAVE_LIBTHREAD) + check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET) + check_library_exists(rt clock_gettime "" HAVE_LIBRT) + if (HAVE_LIBTHREADS) + list(APPEND DEPLIBS pthreads) + endif() + if (HAVE_LIBRT) list(APPEND DEPLIBS rt) - endif() + endif() + if (HAVE_LIBSOCKET) + list(APPEND DEPLIBS socket) + endif() endif() if(MSVC) @@ -57,6 +64,9 @@ endif() add_library(hdhomerun SHARED ${SOURCES}) target_link_libraries(hdhomerun ${DEPLIBS}) +add_library(hdhomerun_static STATIC ${SOURCES}) +target_link_libraries(hdhomerun_static ${DEPLIBS}) + if(WIN32) set_target_properties(hdhomerun PROPERTIES DEFINE_SYMBOL "LIBHDHOMERUN_DLLEXPORT") endif() @@ -67,7 +77,7 @@ target_link_libraries(hdhomerun_config hdhomerun) include_directories(${PROJECT_SOURCE_DIR}) install(FILES ${HEADERS} DESTINATION include/hdhomerun) -install(TARGETS hdhomerun hdhomerun_config +install(TARGETS hdhomerun hdhomerun_static hdhomerun_config RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib From 2333bb7ef627105a5435531da133ab5e42d26ff6 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sun, 6 Mar 2016 08:22:05 -0600 Subject: [PATCH 18/21] Update CMakeLists.txt --- CMakeLists.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2116ef..d26e83d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(hdhomerun) @@ -27,22 +27,22 @@ set(HEADERS hdhomerun_sock.h hdhomerun_types.h hdhomerun_os.h + hdhomerun_os_posix.h + hdhomerun_os_windows.h hdhomerun_video.h) if(WIN32) LIST(APPEND SOURCES hdhomerun_os_windows.c) LIST(APPEND SOURCES hdhomerun_sock_windows.c) - LIST(APPEND HEADERS hdhomerun_os_windows.h) else() LIST(APPEND SOURCES hdhomerun_os_posix.c) LIST(APPEND SOURCES hdhomerun_sock_posix.c) - LIST(APPEND HEADERS hdhomerun_os_posix.h) endif() if(WIN32) list(APPEND DEPLIBS ws2_32 iphlpapi) else() - check_library_exists(pthreads pthread_create HAVE_LIBTHREAD) + check_library_exists(pthreads pthread_create "" HAVE_LIBTHREAD) check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET) check_library_exists(rt clock_gettime "" HAVE_LIBRT) if (HAVE_LIBTHREADS) @@ -56,11 +56,6 @@ else() endif() endif() -if(MSVC) - set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE "CXX") - add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS) -endif() - add_library(hdhomerun SHARED ${SOURCES}) target_link_libraries(hdhomerun ${DEPLIBS}) From 6dd7bd7f4fc62a62d69474dc24a9cddc392a6d93 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sun, 6 Mar 2016 08:22:37 -0600 Subject: [PATCH 19/21] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d26e83d..672069a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set(SOURCES hdhomerun_video.c) set(HEADERS - ${PROJECT_SOURCE_DIR}/hdhomerun.h + hdhomerun.h hdhomerun_channels.h hdhomerun_channelscan.h hdhomerun_control.h From 461e6a4e5d8cf0fa2141c0d3efae0c912a5ab49a Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sun, 6 Mar 2016 08:24:25 -0600 Subject: [PATCH 20/21] Update CMakeLists.txt --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 672069a..a9d3650 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,11 +42,11 @@ endif() if(WIN32) list(APPEND DEPLIBS ws2_32 iphlpapi) else() - check_library_exists(pthreads pthread_create "" HAVE_LIBTHREAD) + check_library_exists(pthread pthread_create "" HAVE_LIBTHREAD) check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET) check_library_exists(rt clock_gettime "" HAVE_LIBRT) - if (HAVE_LIBTHREADS) - list(APPEND DEPLIBS pthreads) + if (HAVE_LIBTHREAD) + list(APPEND DEPLIBS pthread) endif() if (HAVE_LIBRT) list(APPEND DEPLIBS rt) From 1ebbd2dba3aedc49dc124fa2b65eb11a23cb63f9 Mon Sep 17 00:00:00 2001 From: Zoltan Csizmadia Date: Sun, 6 Mar 2016 08:25:42 -0600 Subject: [PATCH 21/21] Update CMakeLists.txt --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9d3650..28a99f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,10 +42,10 @@ endif() if(WIN32) list(APPEND DEPLIBS ws2_32 iphlpapi) else() - check_library_exists(pthread pthread_create "" HAVE_LIBTHREAD) - check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET) + check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD) check_library_exists(rt clock_gettime "" HAVE_LIBRT) - if (HAVE_LIBTHREAD) + check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET) + if (HAVE_LIBPTHREAD) list(APPEND DEPLIBS pthread) endif() if (HAVE_LIBRT)