mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-15 00:34:05 +09:00
reworked (simplified) CmakeLists.txt, lib/CMakeLists.txt (thanks @swills )
This commit is contained in:
@@ -19,6 +19,16 @@ if( UNIX AND NOT APPLE )
|
|||||||
add_definitions( -DSUPPRESS_AVAHI_COMPAT_WARNING )
|
add_definitions( -DSUPPRESS_AVAHI_COMPAT_WARNING )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if( UNIX AND NOT APPLE )
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(DNSSD REQUIRED avahi-compat-libdns_sd)
|
||||||
|
pkg_check_modules(PLIST libplist>=2.0)
|
||||||
|
if(NOT PLIST_FOUND)
|
||||||
|
pkg_check_modules(PLIST REQUIRED libplist-2.0)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory( lib/llhttp )
|
add_subdirectory( lib/llhttp )
|
||||||
add_subdirectory( lib/playfair )
|
add_subdirectory( lib/playfair )
|
||||||
add_subdirectory( lib )
|
add_subdirectory( lib )
|
||||||
@@ -30,30 +40,31 @@ if( UNIX AND NOT APPLE )
|
|||||||
include_directories( uxplay ${GST_INCLUDE_DIRS} )
|
include_directories( uxplay ${GST_INCLUDE_DIRS} )
|
||||||
else()
|
else()
|
||||||
include_directories( uxplay
|
include_directories( uxplay
|
||||||
/Library/FrameWorks/GStreamer.framework/Headers/
|
/Library/FrameWorks/GStreamer.framework/Headers/
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
/usr/local/include/glib-2.0
|
/usr/local/include/glib-2.0
|
||||||
/usr/local/lib/glib-2.0/include
|
/usr/local/lib/glib-2.0/include
|
||||||
/opt/local/include
|
/opt/local/include
|
||||||
/opt/local/include/glib-2.0
|
/opt/local/include/glib-2.0
|
||||||
/opt/local/lib/glib-2.0/include
|
/opt/local/lib/glib-2.0/include
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (BSD )
|
|
||||||
target_link_directories( uxplay PUBLIC
|
|
||||||
${GST_LIBRARY_DIRS}
|
|
||||||
${PLIST_LIBRARY_DIRS}
|
|
||||||
${DNSSD_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
target_link_libraries( uxplay ${PLIST_LIBRARIES} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries( uxplay
|
target_link_libraries( uxplay
|
||||||
renderers
|
renderers
|
||||||
airplay
|
airplay
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if ( UNIX AND NOT APPLE )
|
||||||
|
target_link_directories( uxplay PUBLIC
|
||||||
|
${GST_LIBRARY_DIRS}
|
||||||
|
${DNSSD_LIBRARY_DIRS}
|
||||||
|
${PLIST_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
target_link_libraries( uxplay ${PLIST_LIBRARIES} )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
install( TARGETS uxplay RUNTIME DESTINATION bin )
|
install( TARGETS uxplay RUNTIME DESTINATION bin )
|
||||||
install( FILES uxplay.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
|
install( FILES uxplay.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
|
||||||
install( FILES README.md README.txt README.html LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR} )
|
install( FILES README.md README.txt README.html LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR} )
|
||||||
|
|||||||
@@ -33,17 +33,10 @@ target_link_libraries( airplay
|
|||||||
llhttp )
|
llhttp )
|
||||||
|
|
||||||
# libplist
|
# libplist
|
||||||
|
if( UNIX AND NOT APPLE )
|
||||||
if( BSD )
|
|
||||||
pkg_check_modules( PLIST REQUIRED libplist-2.0 )
|
|
||||||
target_include_directories( airplay PUBLIC ${PLIST_INCLUDE_DIRS} )
|
target_include_directories( airplay PUBLIC ${PLIST_INCLUDE_DIRS} )
|
||||||
link_directories( ${PLIST_LIBRARY_DIRS} )
|
link_directories( ${PLIST_LIBRARY_DIRS} )
|
||||||
message( STATUS "LIBPLIST " ${PLIST_LIBRARIES} )
|
|
||||||
target_link_libraries ( airplay ${PLIST_LBRARIES} )
|
target_link_libraries ( airplay ${PLIST_LBRARIES} )
|
||||||
elseif( UNIX AND NOT APPLE )
|
|
||||||
find_library( LIBPLIST NAMES plist3 plist plist-2.0 libplist-2.0 )
|
|
||||||
message( STATUS "LIBPLIST " ${LIBPLIST} )
|
|
||||||
target_link_libraries ( airplay ${LIBPLIST} )
|
|
||||||
elseif( APPLE )
|
elseif( APPLE )
|
||||||
# use static linking
|
# use static linking
|
||||||
pkg_check_modules( PLIST REQUIRED libplist-2.0 )
|
pkg_check_modules( PLIST REQUIRED libplist-2.0 )
|
||||||
@@ -58,30 +51,14 @@ endif()
|
|||||||
|
|
||||||
#libcrypto
|
#libcrypto
|
||||||
if( UNIX AND NOT APPLE )
|
if( UNIX AND NOT APPLE )
|
||||||
if (STATIC_OPENSSL3 )
|
find_package(OpenSSL 1.1.1 REQUIRED)
|
||||||
set( ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig/" )
|
target_compile_definitions( airplay PUBLIC OPENSSL_API_COMPAT=0x10101000L )
|
||||||
set( ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib64/pkgconfig/" )
|
target_link_libraries( airplay OpenSSL::Crypto )
|
||||||
pkg_check_modules( OPENSSL REQUIRED openssl>=3.0.0 )
|
|
||||||
message( "OPENSSL_LIBRARY_DIRS " ${OPENSSL_LIBRARY_DIRS} )
|
|
||||||
message( "OPENSSL_INCLUDE_DIRS " ${OPENSSL_INCLUDE_DIRS} )
|
|
||||||
find_library( LIBCRYPTO libcrypto.a PATHS ${OPENSSL_LIBRARY_DIRS} REQUIRED )
|
|
||||||
message( "LIBCRYPTO " ${LIBCRYPTO} )
|
|
||||||
target_link_libraries( airplay ${LIBCRYPTO} ${CMAKE_DL_LIBS})
|
|
||||||
target_include_directories( airplay PRIVATE
|
|
||||||
${OPENSSL_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
else ()
|
|
||||||
find_package(OpenSSL 1.1.1 REQUIRED)
|
|
||||||
message( "OpenSSL " ${OpenSSL} )
|
|
||||||
target_compile_definitions( airplay PUBLIC OPENSSL_API_COMPAT=0x10101000L )
|
|
||||||
target_link_libraries( airplay OpenSSL::Crypto )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
elseif( APPLE )
|
elseif( APPLE )
|
||||||
# use static linking
|
# use static linking
|
||||||
# can either compile Openssl 1.1.1 from source (install_dev to /usr/local) or use Macports or Brew
|
# can either compile Openssl 1.1.1 from source (install_dev to /usr/local) or use Macports or Brew
|
||||||
# MacPorts needs zlib with it, Brew has a strange "keg-only" installation in usr/local/opt/openssl@1.1
|
# MacPorts needs zlib with it, Brew has a strange "keg-only" installation in usr/local/opt/openssl@1.1
|
||||||
pkg_check_modules( OPENSSL REQUIRED Openssl>=1.1.1)
|
pkg_check_modules( OPENSSL REQUIRED openssl>=1.1.1)
|
||||||
message( "OPENSSL_LIBRARY_DIRS " ${OPENSSL_LIBRARY_DIRS} )
|
message( "OPENSSL_LIBRARY_DIRS " ${OPENSSL_LIBRARY_DIRS} )
|
||||||
message( "OPENSSL_INCLUDE_DIRS " ${OPENSSL_INCLUDE_DIRS} )
|
message( "OPENSSL_INCLUDE_DIRS " ${OPENSSL_INCLUDE_DIRS} )
|
||||||
find_library( LIBCRYPTO libcrypto.a PATHS ${OPENSSL_LIBRARY_DIRS} REQUIRED )
|
find_library( LIBCRYPTO libcrypto.a PATHS ${OPENSSL_LIBRARY_DIRS} REQUIRED )
|
||||||
@@ -98,18 +75,8 @@ elseif( APPLE )
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
#dns_sd
|
#dns_sd
|
||||||
if( BSD )
|
if ( UNIX AND NOT APPLE )
|
||||||
pkg_check_modules( DNSSD REQUIRED avahi-compat-libdns_sd )
|
|
||||||
target_include_directories( airplay PUBLIC ${DNSSD_INCLUDE_DIRS} )
|
target_include_directories( airplay PUBLIC ${DNSSD_INCLUDE_DIRS} )
|
||||||
link_directories( ${DNSSD_LIBRARY_DIRS} )
|
link_directories( ${DNSSD_LIBRARY_DIRS} )
|
||||||
target_link_libraries( airplay ${DNSSD_LIBRARIES})
|
target_link_libraries( airplay ${DNSSD_LIBRARIES})
|
||||||
elseif( UNIX AND NOT APPLE )
|
|
||||||
find_file( DNS_SD_H dns_sd.h PATHS /usr/include/* /usr/local/include/* )
|
|
||||||
if( NOT DNS_SD_H )
|
|
||||||
message( FATAL_ERROR "(avahi_compat) did not find dns_sd.h" )
|
|
||||||
endif()
|
|
||||||
string( REPLACE "dns_sd.h" "" DNS_SD ${DNS_SD_H} )
|
|
||||||
message( STATUS "found dns_sd.h in " ${DNS_SD} )
|
|
||||||
target_include_directories( airplay PRIVATE ${DNS_SD} )
|
|
||||||
target_link_libraries( airplay dns_sd )
|
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user