Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Travis CI support #2

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: c

os:
- linux
- osx

compiler:
- clang
- gcc

script:
#- make
- cmake .
- cmake --build .
79 changes: 79 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
cmake_minimum_required(VERSION 2.8.4)

project(hdhomerun)

include(CheckLibraryExists)

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
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_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)
else()
LIST(APPEND SOURCES hdhomerun_os_posix.c)
LIST(APPEND SOURCES hdhomerun_sock_posix.c)
endif()

if(WIN32)
list(APPEND DEPLIBS ws2_32 iphlpapi)
else()
check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
check_library_exists(rt clock_gettime "" HAVE_LIBRT)
check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET)
if (HAVE_LIBPTHREAD)
list(APPEND DEPLIBS pthread)
endif()
if (HAVE_LIBRT)
list(APPEND DEPLIBS rt)
endif()
if (HAVE_LIBSOCKET)
list(APPEND DEPLIBS socket)
endif()
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()

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_static hdhomerun_config
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright � 2005-2016 Silicondust USA Inc. <www.silicondust.com>.
[![Build Status](https://travis-ci.org/zcsizmadia/libhdhomerun.svg?branch=master)](https://travis-ci.org/zcsizmadia/libhdhomerun)

Copyright © 2005-2016 Silicondust USA Inc. <www.silicondust.com>.

This library implements the libhdhomerun protocol for use with Silicondust HDHomeRun TV tuners.

Expand Down