summaryrefslogtreecommitdiffstats
path: root/app/CMakeLists.txt
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-03-07 15:56:17 -0500
committerScott Murray <scott.murray@konsulko.com>2022-03-07 16:12:00 -0500
commit30c275c5c87b9d4f0bc3b0e0e3175775d3738319 (patch)
tree715a4d5c79cee50b763e9253cc454b43fb9efea6 /app/CMakeLists.txt
parent714ad7e26b9860360fb8098613f8b4887d851e12 (diff)
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 <scott.murray@konsulko.com> Change-Id: I87816800c117a243a107eecb8895f07d6c90f23a
Diffstat (limited to 'app/CMakeLists.txt')
-rw-r--r--app/CMakeLists.txt31
1 files changed, 13 insertions, 18 deletions
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 <scott.murray@konsulko.com>
@@ -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)