2019-01-06 19:49:56 +01:00
|
|
|
find_package(PythonLibs 3.4 REQUIRED)
|
2019-02-17 13:44:26 +01:00
|
|
|
find_package(Qt5Widgets REQUIRED)
|
2018-12-27 23:11:32 +01:00
|
|
|
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
|
|
|
|
|
2020-02-16 16:24:33 +01:00
|
|
|
macro(InstallDependencies TARGET INSTALL_COMPONENT)
|
|
|
|
set(TARGET_FILE ${CMAKE_BINARY_DIR}/bin/${TARGET})
|
|
|
|
set(SYSTEM_LIBS_SKIP
|
|
|
|
"libbsd"
|
|
|
|
"libc"
|
|
|
|
"libdbus-1"
|
|
|
|
"libdl"
|
|
|
|
"libexpat"
|
|
|
|
"libfontconfig"
|
|
|
|
"libfreetype"
|
|
|
|
"libgcc_s"
|
|
|
|
"libgcrypt"
|
|
|
|
"libGL"
|
|
|
|
"libGLdispatch"
|
|
|
|
"libglib-2"
|
|
|
|
"libGLX"
|
|
|
|
"libgpg-error"
|
|
|
|
"liblz4"
|
|
|
|
"liblzma"
|
|
|
|
"libm"
|
|
|
|
"libpthread"
|
|
|
|
"librt"
|
|
|
|
"libstdc++"
|
|
|
|
"libsystemd"
|
|
|
|
"libudev"
|
|
|
|
"libusb-1"
|
|
|
|
"libutil"
|
|
|
|
"libX11"
|
|
|
|
"libXau"
|
|
|
|
"libxcb"
|
|
|
|
"libXdmcp"
|
|
|
|
"libXext"
|
|
|
|
"libXrender"
|
|
|
|
"libz"
|
2020-02-19 17:27:25 +01:00
|
|
|
)
|
2020-02-16 16:24:33 +01:00
|
|
|
|
|
|
|
if(EXISTS ${TARGET_FILE})
|
|
|
|
include(GetPrerequisites)
|
|
|
|
|
|
|
|
if (APPLE)
|
|
|
|
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
|
|
|
|
endif(APPLE)
|
|
|
|
|
|
|
|
# Extract dependencies ignoring the system ones
|
|
|
|
get_prerequisites(${TARGET_FILE} DEPENDENCIES 0 1 "" "")
|
|
|
|
|
|
|
|
# Append symlink and non-symlink dependencies to the list
|
|
|
|
set(PREREQUISITE_LIBS "")
|
|
|
|
foreach(DEPENDENCY ${DEPENDENCIES})
|
|
|
|
get_filename_component(resolved ${DEPENDENCY} NAME_WE)
|
|
|
|
list(FIND SYSTEM_LIBS_SKIP ${resolved} _index)
|
|
|
|
if (${_index} GREATER -1)
|
|
|
|
continue() # Skip system libraries
|
|
|
|
else()
|
|
|
|
gp_resolve_item("${TARGET_FILE}" "${DEPENDENCY}" "" "" resolved_file)
|
|
|
|
get_filename_component(resolved_file ${resolved_file} ABSOLUTE)
|
|
|
|
gp_append_unique(PREREQUISITE_LIBS ${resolved_file})
|
|
|
|
get_filename_component(file_canonical ${resolved_file} REALPATH)
|
|
|
|
gp_append_unique(PREREQUISITE_LIBS ${file_canonical})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Append the OpenSSL library to the list
|
2020-02-19 17:27:25 +01:00
|
|
|
find_package(OpenSSL 1.0.0 REQUIRED)
|
2020-02-16 16:24:33 +01:00
|
|
|
if (OPENSSL_FOUND)
|
|
|
|
foreach(openssl_lib ${OPENSSL_LIBRARIES})
|
|
|
|
get_prerequisites(${openssl_lib} openssl_deps 0 1 "" "")
|
|
|
|
|
|
|
|
foreach(openssl_dep ${openssl_deps})
|
|
|
|
get_filename_component(resolved ${openssl_dep} NAME_WE)
|
|
|
|
list(FIND SYSTEM_LIBS_SKIP ${resolved} _index)
|
|
|
|
if (${_index} GREATER -1)
|
|
|
|
continue() # Skip system libraries
|
|
|
|
else()
|
|
|
|
gp_resolve_item("${openssl_lib}" "${openssl_dep}" "" "" resolved_file)
|
|
|
|
get_filename_component(resolved_file ${resolved_file} ABSOLUTE)
|
|
|
|
gp_append_unique(PREREQUISITE_LIBS ${resolved_file})
|
|
|
|
get_filename_component(file_canonical ${resolved_file} REALPATH)
|
|
|
|
gp_append_unique(PREREQUISITE_LIBS ${file_canonical})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
gp_append_unique(PREREQUISITE_LIBS ${openssl_lib})
|
2020-02-19 17:27:25 +01:00
|
|
|
get_filename_component(file_canonical ${openssl_lib} REALPATH)
|
|
|
|
gp_append_unique(PREREQUISITE_LIBS ${file_canonical})
|
2020-02-16 16:24:33 +01:00
|
|
|
endforeach()
|
|
|
|
endif(OPENSSL_FOUND)
|
|
|
|
|
|
|
|
# Detect the Qt5 plugin directory, source: https://github.com/lxde/lxqt-qtplugin/blob/master/src/CMakeLists.txt
|
|
|
|
get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION)
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_PLUGINS
|
|
|
|
OUTPUT_VARIABLE QT_PLUGINS_DIR
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
|
|
|
|
# Copy Qt plugins to 'share/hyperion/lib'
|
|
|
|
if(QT_PLUGINS_DIR)
|
|
|
|
foreach(PLUGIN "platforms" "sqldrivers" "imageformats")
|
|
|
|
if(EXISTS ${QT_PLUGINS_DIR}/${PLUGIN})
|
|
|
|
file(GLOB files "${QT_PLUGINS_DIR}/${PLUGIN}/*")
|
|
|
|
foreach(file ${files})
|
|
|
|
get_prerequisites(${file} PLUGINS 0 1 "" "")
|
|
|
|
|
|
|
|
foreach(DEPENDENCY ${PLUGINS})
|
|
|
|
get_filename_component(resolved ${DEPENDENCY} NAME_WE)
|
|
|
|
list(FIND SYSTEM_LIBS_SKIP ${resolved} _index)
|
|
|
|
if (${_index} GREATER -1)
|
|
|
|
continue() # Skip system libraries
|
|
|
|
else()
|
|
|
|
gp_resolve_item("${file}" "${DEPENDENCY}" "" "" resolved_file)
|
|
|
|
get_filename_component(resolved_file ${resolved_file} ABSOLUTE)
|
|
|
|
gp_append_unique(PREREQUISITE_LIBS ${resolved_file})
|
|
|
|
get_filename_component(file_canonical ${resolved_file} REALPATH)
|
|
|
|
gp_append_unique(PREREQUISITE_LIBS ${file_canonical})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
install(
|
|
|
|
FILES ${file}
|
|
|
|
DESTINATION "share/hyperion/lib/${PLUGIN}"
|
|
|
|
COMPONENT "${INSTALL_COMPONENT}"
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2020-02-19 17:27:25 +01:00
|
|
|
endif(QT_PLUGINS_DIR)
|
2020-02-16 16:24:33 +01:00
|
|
|
|
|
|
|
# Create a qt.conf file in 'share/hyperion/bin' to override hard-coded search paths in Qt plugins
|
|
|
|
file(WRITE "${CMAKE_BINARY_DIR}/qt.conf" "[Paths]\nPlugins=../lib/\n")
|
|
|
|
install(
|
|
|
|
FILES "${CMAKE_BINARY_DIR}/qt.conf"
|
|
|
|
DESTINATION "share/hyperion/bin"
|
|
|
|
COMPONENT "${INSTALL_COMPONENT}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Copy dependencies to 'share/hyperion/lib'
|
|
|
|
foreach(PREREQUISITE_LIB ${PREREQUISITE_LIBS})
|
|
|
|
install(
|
|
|
|
FILES ${PREREQUISITE_LIB}
|
|
|
|
DESTINATION "share/hyperion/lib"
|
|
|
|
COMPONENT "${INSTALL_COMPONENT}"
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Detect the Python modules directory
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
|
|
|
|
OUTPUT_VARIABLE PYTHON_MODULES_DIR
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
|
|
|
|
# Copy Python modules to 'share/hyperion/lib/python'
|
|
|
|
if (PYTHON_MODULES_DIR)
|
|
|
|
install(
|
|
|
|
DIRECTORY ${PYTHON_MODULES_DIR}/
|
|
|
|
DESTINATION "share/hyperion/lib/python"
|
|
|
|
COMPONENT "${INSTALL_COMPONENT}"
|
|
|
|
)
|
2020-02-19 17:27:25 +01:00
|
|
|
endif(PYTHON_MODULES_DIR)
|
2020-02-16 16:24:33 +01:00
|
|
|
else()
|
|
|
|
# Run CMake after target was built to run get_prerequisites on ${TARGET_FILE}
|
|
|
|
add_custom_command(
|
|
|
|
TARGET ${TARGET} POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
ARGS ${CMAKE_SOURCE_DIR}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
2017-08-01 15:42:36 +02:00
|
|
|
add_executable(hyperiond
|
2017-01-22 14:31:11 +01:00
|
|
|
hyperiond.h
|
2017-08-01 17:29:47 +02:00
|
|
|
systray.h
|
2016-12-23 19:37:35 +01:00
|
|
|
hyperiond.cpp
|
2017-08-01 17:29:47 +02:00
|
|
|
systray.cpp
|
2016-12-23 19:37:35 +01:00
|
|
|
main.cpp
|
|
|
|
)
|
2014-09-08 16:16:02 +02:00
|
|
|
|
|
|
|
target_link_libraries(hyperiond
|
2016-08-28 15:10:43 +02:00
|
|
|
commandline
|
2014-09-08 16:16:02 +02:00
|
|
|
hyperion
|
|
|
|
effectengine
|
|
|
|
jsonserver
|
2018-12-28 18:12:45 +01:00
|
|
|
flatbufserver
|
2019-02-17 15:26:11 +01:00
|
|
|
protoserver
|
2018-12-27 23:11:32 +01:00
|
|
|
webserver
|
2016-06-17 01:25:40 +02:00
|
|
|
bonjour
|
2018-12-30 22:07:53 +01:00
|
|
|
ssdp
|
2019-07-12 16:54:26 +02:00
|
|
|
database
|
2018-12-27 23:11:32 +01:00
|
|
|
python
|
2018-12-31 15:48:29 +01:00
|
|
|
resources
|
2018-12-27 23:11:32 +01:00
|
|
|
${PYTHON_LIBRARIES}
|
2019-07-12 16:54:26 +02:00
|
|
|
Qt5::Widgets
|
2014-09-08 16:16:02 +02:00
|
|
|
)
|
|
|
|
|
2019-02-12 14:55:36 +01:00
|
|
|
if (ENABLE_AMLOGIC)
|
|
|
|
target_link_libraries(hyperiond
|
|
|
|
Qt5::Core
|
|
|
|
pcre16 dl z
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2014-09-08 16:16:02 +02:00
|
|
|
if (ENABLE_DISPMANX)
|
2017-09-02 22:26:22 +02:00
|
|
|
IF ( "${PLATFORM}" MATCHES rpi)
|
|
|
|
find_package(BCM REQUIRED)
|
|
|
|
include_directories(${BCM_INCLUDE_DIRS})
|
|
|
|
ELSE()
|
|
|
|
SET(BCM_INCLUDE_DIRS "")
|
|
|
|
SET(BCM_LIBRARIES "")
|
|
|
|
ENDIF()
|
2014-09-08 16:16:02 +02:00
|
|
|
target_link_libraries(hyperiond dispmanx-grabber)
|
2016-05-22 00:27:06 +02:00
|
|
|
endif ()
|
2014-09-08 16:16:02 +02:00
|
|
|
|
2015-01-18 00:04:45 +01:00
|
|
|
if (ENABLE_FB)
|
|
|
|
target_link_libraries(hyperiond framebuffer-grabber)
|
2016-05-22 00:27:06 +02:00
|
|
|
endif ()
|
2015-01-18 00:04:45 +01:00
|
|
|
|
2015-01-24 23:42:22 +01:00
|
|
|
if (ENABLE_OSX)
|
|
|
|
target_link_libraries(hyperiond osx-grabber)
|
2016-05-22 00:27:06 +02:00
|
|
|
endif ()
|
2015-01-24 23:42:22 +01:00
|
|
|
|
2014-09-08 16:16:02 +02:00
|
|
|
if (ENABLE_V4L2)
|
|
|
|
target_link_libraries(hyperiond v4l2-grabber)
|
2016-05-22 00:27:06 +02:00
|
|
|
endif ()
|
2014-09-08 16:16:02 +02:00
|
|
|
|
2015-08-20 09:51:44 +02:00
|
|
|
if (ENABLE_AMLOGIC)
|
|
|
|
target_link_libraries(hyperiond amlogic-grabber)
|
2016-05-22 00:27:06 +02:00
|
|
|
endif ()
|
2015-08-20 09:51:44 +02:00
|
|
|
|
2016-07-24 15:18:34 +02:00
|
|
|
if (ENABLE_X11)
|
2019-01-19 18:35:40 +01:00
|
|
|
target_link_libraries(hyperiond x11-grabber)
|
2016-07-24 15:18:34 +02:00
|
|
|
endif ()
|
|
|
|
|
2019-01-06 19:49:56 +01:00
|
|
|
if (ENABLE_QT)
|
2019-01-19 18:35:40 +01:00
|
|
|
target_link_libraries(hyperiond qt-grabber)
|
2019-01-06 19:49:56 +01:00
|
|
|
endif ()
|
2017-08-01 17:29:47 +02:00
|
|
|
|
2016-08-20 16:37:45 +02:00
|
|
|
install ( TARGETS hyperiond DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" )
|
|
|
|
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/bin/service DESTINATION "share/hyperion/" COMPONENT "${PLATFORM}" )
|
2016-11-20 22:57:19 +01:00
|
|
|
install ( FILES ${CMAKE_SOURCE_DIR}/effects/readme.txt DESTINATION "share/hyperion/effects" COMPONENT "${PLATFORM}" )
|
2018-12-31 15:48:29 +01:00
|
|
|
install ( FILES ${CMAKE_SOURCE_DIR}/resources/icons/hyperion-icon-32px.png DESTINATION "share/hyperion/icons" COMPONENT "${PLATFORM}" )
|
2016-11-20 22:57:19 +01:00
|
|
|
|
2019-01-19 18:35:40 +01:00
|
|
|
# Desktop file for hyperiond
|
|
|
|
install ( FILES ${CMAKE_SOURCE_DIR}/cmake/desktop/hyperiond_128.png DESTINATION "share/hyperion/desktop" COMPONENT "${PLATFORM}" )
|
|
|
|
install ( FILES ${CMAKE_SOURCE_DIR}/cmake/desktop/hyperiond.desktop DESTINATION "share/hyperion/desktop" COMPONENT "${PLATFORM}" )
|
|
|
|
|
2016-11-20 22:57:19 +01:00
|
|
|
if(CMAKE_HOST_UNIX)
|
|
|
|
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/hyperiond\" \"${CMAKE_BINARY_DIR}/symlink_hyperiond\" )" COMPONENT "${PLATFORM}" )
|
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/symlink_hyperiond DESTINATION "bin" RENAME hyperiond COMPONENT "${PLATFORM}" )
|
|
|
|
install(CODE "FILE (REMOVE ${CMAKE_BINARY_DIR}/symlink_hyperiond )" COMPONENT "${PLATFORM}" )
|
|
|
|
endif(CMAKE_HOST_UNIX)
|
2020-02-16 16:24:33 +01:00
|
|
|
|
2020-02-24 18:02:34 +01:00
|
|
|
|
|
|
|
# Copy dependencies (not for OSX)
|
|
|
|
if (NOT ENABLE_OSX)
|
|
|
|
InstallDependencies("hyperiond" ${PLATFORM})
|
|
|
|
endif ()
|