Update CMakeLists.txt

This commit is contained in:
Zoltan Csizmadia 2016-03-06 08:22:05 -06:00
commit 2333bb7ef6

View file

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8.4)
project(hdhomerun) project(hdhomerun)
@ -27,22 +27,22 @@ set(HEADERS
hdhomerun_sock.h hdhomerun_sock.h
hdhomerun_types.h hdhomerun_types.h
hdhomerun_os.h hdhomerun_os.h
hdhomerun_os_posix.h
hdhomerun_os_windows.h
hdhomerun_video.h) hdhomerun_video.h)
if(WIN32) if(WIN32)
LIST(APPEND SOURCES hdhomerun_os_windows.c) LIST(APPEND SOURCES hdhomerun_os_windows.c)
LIST(APPEND SOURCES hdhomerun_sock_windows.c) LIST(APPEND SOURCES hdhomerun_sock_windows.c)
LIST(APPEND HEADERS hdhomerun_os_windows.h)
else() else()
LIST(APPEND SOURCES hdhomerun_os_posix.c) LIST(APPEND SOURCES hdhomerun_os_posix.c)
LIST(APPEND SOURCES hdhomerun_sock_posix.c) LIST(APPEND SOURCES hdhomerun_sock_posix.c)
LIST(APPEND HEADERS hdhomerun_os_posix.h)
endif() endif()
if(WIN32) if(WIN32)
list(APPEND DEPLIBS ws2_32 iphlpapi) list(APPEND DEPLIBS ws2_32 iphlpapi)
else() 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(socket getaddrinfo "" HAVE_LIBSOCKET)
check_library_exists(rt clock_gettime "" HAVE_LIBRT) check_library_exists(rt clock_gettime "" HAVE_LIBRT)
if (HAVE_LIBTHREADS) if (HAVE_LIBTHREADS)
@ -56,11 +56,6 @@ else()
endif() endif()
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}) add_library(hdhomerun SHARED ${SOURCES})
target_link_libraries(hdhomerun ${DEPLIBS}) target_link_libraries(hdhomerun ${DEPLIBS})