X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps%2Fcamera-gstreamer.git;a=blobdiff_plain;f=app%2FCMakeLists.txt;fp=app%2FCMakeLists.txt;h=fc71e8fa8e4835c5e347631e5583ba8fd1e43fa6;hp=02322d485583d6b06469be93255be12b5770c9b2;hb=30c275c5c87b9d4f0bc3b0e0e3175775d3738319;hpb=714ad7e26b9860360fb8098613f8b4887d851e12 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)