From 30c275c5c87b9d4f0bc3b0e0e3175775d3738319 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 7 Mar 2022 15:56:17 -0500 Subject: Update for app framework removal Changes: - Remove the autobuild scripts and config.xml used by the app framework widget build. - Update the CMake files to just build a "camera-gstreamer" binary and install it into /usr/bin by default. - Remove the code in main.cpp that handled reading the WebSocket command-line arguments and passing them to binding related code. - Added installation of a minimal .desktop file to work with the new applaunchd. Bug-AGL: SPEC-4284 Signed-off-by: Scott Murray Change-Id: I87816800c117a243a107eecb8895f07d6c90f23a --- app/CMakeLists.txt | 31 +++++++++++++------------------ app/camera-gstreamer.desktop | 10 ++++++++++ 2 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 app/camera-gstreamer.desktop (limited to 'app') diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 02322d4..fc71e8f 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,5 +1,5 @@ ########################################################################### -# Copyright 2018 Konsulko Group +# Copyright 2018,2022 Konsulko Group # Copyright 2020 Collabora, Ltd. # # Author: Scott Murray @@ -18,15 +18,18 @@ # limitations under the License. ########################################################################### -set(CMAKE_INCLUDE_CURRENT_DIR ON) +project(camera-gstreamer) + +if(CMAKE_VERSION VERSION_LESS "3.7.0") + set(CMAKE_INCLUDE_CURRENT_DIR ON) +endif() + set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(PkgConfig REQUIRED) find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner) -PROJECT_TARGET_ADD(camera-gstreamer) - add_custom_command( OUTPUT agl-shell-desktop-client-protocol.h COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header @@ -35,7 +38,6 @@ add_custom_command( DEPENDS ${CMAKE_SOURCE_DIR}/app/protocol/agl-shell-desktop.xml ) - add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/app/agl-shell-desktop-client-protocol.h COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header @@ -52,7 +54,6 @@ add_custom_command( DEPENDS ${CMAKE_SOURCE_DIR}/app/protocol/agl-shell-desktop.xml ) - pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0) pkg_check_modules(GSTREAMER_PLUGINS_BASE REQUIRED gstreamer-plugins-base-1.0) pkg_check_modules(GSTREAMER_VIDEO REQUIRED gstreamer-video-1.0) @@ -70,7 +71,6 @@ add_custom_command( DEPENDS ${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml ) - add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/app/xdg-shell-client-protocol.h COMMAND ${WAYLAND_SCANNER_EXECUTABLE} client-header @@ -87,7 +87,7 @@ add_custom_command( DEPENDS ${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml ) -add_executable(${TARGET_NAME} +add_executable(${PROJECT_NAME} main.cpp utils.h utils.cpp @@ -105,16 +105,7 @@ include_directories( "${GSTREAMER_VIDEO_INCLUDE_DIRS}" ) -set_target_properties(${TARGET_NAME} PROPERTIES - LABELS "EXECUTABLE" - PREFIX "" - COMPILE_FLAGS "${EXTRAS_CFLAGS} -DFOR_AFB_BINDING" - LINK_FLAGS "${BINDINGS_LINK_FLAG}" - LINK_LIBRARIES "${EXTRAS_LIBRARIES}" - OUTPUT_NAME "${TARGET_NAME}" -) - -target_link_libraries(${TARGET_NAME} +target_link_libraries(${PROJECT_NAME} ${GSTREAMER_LIBRARIES} "${GSTREAMER_PLUGINS_BASE_LIBRARIES}" "${GSTREAMER_PLUGINS_BAD_LIBRARIES}" @@ -122,3 +113,7 @@ target_link_libraries(${TARGET_NAME} ${WAYLAND_CLIENT_LIBRARIES} -lgstwayland-1.0 ) + +install(TARGETS ${PROJECT_NAME} DESTINATION bin) +include(GNUInstallDirs) +install(FILES ${PROJECT_NAME}.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) diff --git a/app/camera-gstreamer.desktop b/app/camera-gstreamer.desktop new file mode 100644 index 0000000..bde67be --- /dev/null +++ b/app/camera-gstreamer.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Name=Camera +Comment=Camera +GenericName=camera +Exec=camera-gstreamer +Terminal=false +Type=Application +Categories=System; +StartupNotify=true -- cgit 1.2.3-korg