Browse Source

CMake: Generally provide instructions for install

This will install QGC to the selected prefix when executing the install target.
However, there is a little difference to the code before, so we don't install the icon into pixmaps but icons in /share.
Just saw a warning about a missing icon for the menu entry, which mentioned the location to be expected in /usr/share/icons.
However, after placing it there I get complains by flatpak the the file is in a layer, which is too deep?!
Need to make further investigations here, therefore take it as WIP.

Signed-off-by: Thomas Karl Pietrowski <thopiekar@gmail.com>
QGC4.4
Thomas Karl Pietrowski 4 years ago committed by Patrick José Pereira
parent
commit
513b87aa62
  1. 42
      CMakeLists.txt

42
CMakeLists.txt

@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.10) @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.10)
project(QGroundControl LANGUAGES C CXX)
include(GNUInstallDirs)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel;Coverage")
set(CMAKE_CXX_STANDARD 14)
@ -186,28 +188,24 @@ endif() @@ -186,28 +188,24 @@ endif()
target_link_libraries(QGroundControl PRIVATE qgc)
option(ENABLE_INSTALL_TARGET "Enable real installation of QGC when running install" OFF)
if(ENABLE_INSTALL_TARGET)
include(GNUInstallDirs)
install(
TARGETS QGroundControl
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/resources/
DESTINATION ${CMAKE_INSTALL_DATADIR}/qgroundcontrol
)
install(
FILES ${CMAKE_SOURCE_DIR}/deploy/qgroundcontrol-clean.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
RENAME qgroundcontrol.desktop
)
install(
FILES ${CMAKE_SOURCE_DIR}/resources/icons/qgroundcontrol.png
DESTINATION ${CMAKE_INSTALL_DATADIR}/pixmaps/
)
endif()
# Files/directories to install
install(
TARGETS QGroundControl
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/resources/
DESTINATION ${CMAKE_INSTALL_DATADIR}/qgroundcontrol
)
install(
FILES ${CMAKE_SOURCE_DIR}/deploy/qgroundcontrol-clean.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
RENAME qgroundcontrol.desktop
)
install(
FILES ${CMAKE_SOURCE_DIR}/resources/icons/qgroundcontrol.png
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/
)
if(BUILD_TESTING)
target_link_libraries(QGroundControl PRIVATE Qt5::Test)

Loading…
Cancel
Save