Warning, /graphics/digikam/core/dplugins/generic/tools/mediaserver/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #
0002 # SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier, <caulier dot gilles at gmail dot com>
0003 # SPDX-FileCopyrightText: 2017      by Ahmed Fathi, <ahmed dot fathi dot abdelmageed at gmail dot com>
0004 #
0005 # SPDX-License-Identifier: BSD-3-Clause
0006 #
0007 
0008 APPLY_COMMON_POLICIES()
0009 
0010 include(MacroDPlugins)
0011 
0012 HEADER_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk DK_LOCAL_INCLUDES_UPNPSDK)
0013 
0014 include_directories($<TARGET_PROPERTY:Qt${QT_VERSION_MAJOR}::Widgets,INTERFACE_INCLUDE_DIRECTORIES>
0015                     $<TARGET_PROPERTY:Qt${QT_VERSION_MAJOR}::Core,INTERFACE_INCLUDE_DIRECTORIES>
0016                     $<TARGET_PROPERTY:Qt${QT_VERSION_MAJOR}::Xml,INTERFACE_INCLUDE_DIRECTORIES>
0017                     $<TARGET_PROPERTY:Qt${QT_VERSION_MAJOR}::Network,INTERFACE_INCLUDE_DIRECTORIES>
0018 
0019                     $<TARGET_PROPERTY:KF${QT_VERSION_MAJOR}::I18n,INTERFACE_INCLUDE_DIRECTORIES>
0020                     $<TARGET_PROPERTY:KF${QT_VERSION_MAJOR}::ConfigCore,INTERFACE_INCLUDE_DIRECTORIES>
0021 
0022                     ${CMAKE_CURRENT_SOURCE_DIR}/server
0023                     ${DK_LOCAL_INCLUDES_UPNPSDK}
0024 )
0025 
0026 # ---------------------------------------------------------------------------------------------------
0027 
0028 set(upnpsdk_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltAction.cpp
0029                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltArgument.cpp
0030                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltConstants.cpp
0031                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltCtrlPoint.cpp
0032                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltCtrlPointTask.cpp
0033                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltDatagramStream.cpp
0034                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltDeviceData.cpp
0035                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltDeviceHost.cpp
0036                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltEvent.cpp
0037                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltHttp.cpp
0038                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltHttpClientTask.cpp
0039                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltHttpServer.cpp
0040                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltHttpServerTask.cpp
0041                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltIconsData.cpp
0042                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltMimeType.cpp
0043                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltProtocolInfo.cpp
0044                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltService.cpp
0045                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltSsdp.cpp
0046                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltStateVariable.cpp
0047                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltTaskManager.cpp
0048                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltThreadTask.cpp
0049                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Core/PltUPnP.cpp
0050                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/PltDidl.cpp
0051                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/PltFileMediaServer.cpp
0052                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/PltMediaBrowser.cpp
0053                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/PltMediaCache.cpp
0054                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/PltMediaItem.cpp
0055                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/PltMediaServer.cpp
0056                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/ConnectionManagerSCPD.cpp
0057                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/ContentDirectorySCPD.cpp
0058                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/ContentDirectorywSearchSCPD.cpp
0059                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.cpp
0060                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaRenderer/PltMediaRenderer.cpp
0061                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaRenderer/PltMediaController.cpp
0062                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaRenderer/AVTransportSCPD.cpp
0063                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaRenderer/RdrConnectionManagerSCPD.cpp
0064                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaRenderer/RenderingControlSCPD.cpp
0065                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaConnect/X_MS_MediaReceiverRegistrarSCPD.cpp
0066                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Platinum/Source/Devices/MediaConnect/PltMediaConnect.cpp
0067 
0068                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptAutomaticCleaner.cpp
0069                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptBase64.cpp
0070                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptBufferedStreams.cpp
0071                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptCommon.cpp
0072                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptDataBuffer.cpp
0073                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptFile.cpp
0074                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptHash.cpp
0075                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptHttp.cpp
0076                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptList.cpp
0077                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptLogging.cpp
0078                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptMessaging.cpp
0079                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptNetwork.cpp
0080                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptQueue.cpp
0081                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptResults.cpp
0082                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptRingBuffer.cpp
0083                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptSimpleMessageQueue.cpp
0084                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptSockets.cpp
0085                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptStreams.cpp
0086                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptStrings.cpp
0087                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptSystem.cpp
0088                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptThreads.cpp
0089                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptTime.cpp
0090                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptTls.cpp
0091                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptUri.cpp
0092                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptUtils.cpp
0093                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptXml.cpp
0094                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Bsd/NptBsdSockets.cpp
0095                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Bsd/NptBsdResolver.cpp
0096                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/StdC/NptStdcDebug.cpp
0097                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/StdC/NptStdcEnvironment.cpp
0098                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/StdC/NptStdcFile.cpp
0099                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Posix/NptPosixFile.cpp
0100                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Posix/NptPosixEnvironment.cpp
0101                  ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Null/NptNullAutoreleasePool.cpp
0102 )
0103 
0104 if(NOT MSVC)
0105 
0106     # Always compiled excepted under Windows with MSVC compiler.
0107 
0108     list(APPEND upnpsdk_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Posix/NptPosixSystem.cpp
0109                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Posix/NptSelectableMessageQueue.cpp
0110                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Posix/NptPosixQueue.cpp
0111                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Posix/NptPosixThreads.cpp
0112                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/Core/NptDebug.cpp
0113     )
0114 
0115 endif()
0116 
0117 if(WIN32)
0118 
0119     # Under Windows with MXE
0120 
0121     list(APPEND upnpsdk_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Win32/NptWin32Time.cpp
0122                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Win32/NptWin32File.cpp
0123                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Win32/NptWin32Network.cpp
0124     )
0125 
0126 else()
0127 
0128     # For Linux and Apple
0129 
0130     list(APPEND upnpsdk_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Posix/NptPosixTime.cpp
0131                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Bsd/NptBsdNetwork.cpp
0132     )
0133 
0134 endif()
0135 
0136 if(APPLE)
0137 
0138     # For Apple only
0139 
0140     list(APPEND upnpsdk_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Apple/NptAppleAutoreleasePool.mm
0141                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Apple/NptAppleLogConfig.mm
0142     )
0143 
0144 endif()
0145 
0146 if(MSVC)
0147 
0148     list(APPEND upnpsdk_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Win32/NptWin32DynamicLibraries.cpp
0149                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Win32/NptWin32MessageQueue.cpp
0150                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Win32/NptWin32Queue.cpp
0151 #                             ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Win32/NptWin32SerialPort.cpp
0152                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Win32/NptWin32System.cpp
0153                              ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/Neptune/Source/System/Win32/NptWin32Threads.cpp
0154     )
0155 
0156 endif()
0157 
0158 # Don't process automoc on UpnpSdk headers
0159 
0160 file(GLOB_RECURSE upnpsdk_headers ${CMAKE_CURRENT_SOURCE_DIR}/upnpsdk/*.h)
0161 
0162 foreach(_file ${upnpsdk_headers})
0163     set_property(SOURCE ${_file} PROPERTY SKIP_AUTOMOC ON)
0164 endforeach()
0165 
0166 set(libmediaserver_SRCS
0167     ${upnpsdk_SRCS}
0168     ${CMAKE_CURRENT_SOURCE_DIR}/server/dlnaserver.cpp
0169     ${CMAKE_CURRENT_SOURCE_DIR}/server/dlnaserverdelegate.cpp
0170     ${CMAKE_CURRENT_SOURCE_DIR}/server/dmediaserver.cpp
0171     ${CMAKE_CURRENT_SOURCE_DIR}/server/dmediaservermngr.cpp
0172 )
0173 
0174 # For Unit-tests and plugin
0175 add_library(mediaserverbackend STATIC ${libmediaserver_SRCS})
0176 
0177 if(MSVC)
0178 
0179     target_compile_options(mediaserverbackend PRIVATE /w)
0180 
0181 else()
0182 
0183     target_compile_options(mediaserverbackend PRIVATE -w)
0184 
0185 endif()
0186 
0187 target_link_libraries(mediaserverbackend
0188                       PRIVATE
0189                       digikamcore
0190                       ${CMAKE_THREAD_LIBS_INIT}
0191 )
0192 
0193 if(WIN32)
0194     target_link_libraries(mediaserverbackend
0195                           PRIVATE
0196                           # Defined in RulesWindows.cmake
0197                           ${WSOCK32_LIBRARY}
0198                           ${WS2_32_LIBRARY}
0199     )
0200 endif()
0201 
0202 # ---------------------------------------------------------------------------------------------------
0203 
0204 set(mediaserverplugin_SRCS
0205     ${CMAKE_CURRENT_SOURCE_DIR}/dmediaserverdlg.cpp
0206     ${CMAKE_CURRENT_SOURCE_DIR}/mediaserverplugin.cpp
0207 )
0208 
0209 DIGIKAM_ADD_GENERIC_PLUGIN(NAME    MediaServer
0210                            SOURCES ${mediaserverplugin_SRCS}
0211                            DEPENDS mediaserverbackend
0212 )