### Build and Install QuteNav Linux Desktop Application Source: https://github.com/jusirkka/qutenav/blob/master/README.md Steps to compile and install QuteNav on a Linux desktop system using CMake and make, including initial setup and icon generation. ```Shell git clone git@github.com:jusirkka/qutenav.git cd qutenav make -f sailfishos.make icons mkdir build cd build cmake -DPLATFORM=qtcontrols -DCMAKE_BUILD_TYPE=Release .. make -j4 sudo make install ``` -------------------------------- ### Install qutenav Desktop Entry with CMake Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt This CMake snippet installs the 'qutenav.desktop' file, which provides application metadata for desktop environments, to the system's applications directory (${CMAKE_INSTALL_DATADIR}/applications), allowing the application to appear in menus. ```CMake install(FILES data/qutenav.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) ``` -------------------------------- ### Install qutenav Project Binaries with CMake Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt This CMake snippet installs the compiled 'qutenav' and 'qutenav_dbupdater' executables to the standard binary directory (${CMAKE_INSTALL_BINDIR}), making them accessible system-wide. ```CMake install(TARGETS qutenav DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS qutenav_dbupdater DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Include GNU Install Directories Module Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Includes the `GNUInstallDirs` module, which provides standard installation directory variables (e.g., `CMAKE_INSTALL_BINDIR`, `CMAKE_INSTALL_LIBDIR`) for cross-platform compatibility. ```CMake include(GNUInstallDirs) ``` -------------------------------- ### Install Build Dependencies for Sailfish OS SDK Source: https://github.com/jusirkka/qutenav/blob/master/README.md Commands to install necessary build dependencies within the Sailfish OS SDK build engine, including starting the VM, copying packages, and installing development libraries. ```Shell vboxmanage startvm --type headless "Sailfish SDK Build Engine" scp -P 2222 -i $SDK/vmshare/ssh/private_keys/sdk data-arm/glm-0.9.9.8-1.armv7hl.rpm mersdk@localhost: ssh -p 2222 -i $SDK/vmshare/ssh/private_keys/sdk mersdk@localhost sb2 -t SailfishOS-$VERSION-armv7hl -m sdk-install -R zypper in flex bison harfbuzz-devel sb2 -t SailfishOS-$VERSION-armv7hl -m sdk-install -R rpm -U glm-0.9.9.8-1.armv7hl.rpm exit ``` -------------------------------- ### Install qutenav Application Icons with CMake Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt This CMake snippet installs various sized 'qutenav' application icons (48x48 and 64x64) to the hicolor icon theme directory, renaming them to 'qutenav.png' for consistent access by desktop environments. ```CMake install(FILES data/qutenav-48x48.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps RENAME qutenav.png) install(FILES data/qutenav-64x64.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps RENAME qutenav.png) ``` -------------------------------- ### Install qutenav Translation Files with CMake Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt This CMake snippet installs the application's translation files, specified by the 'QUTENAV_QMS' variable, to the 'qutenav/translations' directory, enabling multi-language support for the user interface. ```CMake install(FILES ${QUTENAV_QMS} DESTINATION ${CMAKE_INSTALL_DATADIR}/qutenav/translations) ``` -------------------------------- ### Install QuteNav Sailfish OS RPM Package Source: https://github.com/jusirkka/qutenav/blob/master/README.md Commands to transfer and install the built QuteNav RPM package onto a Sailfish OS device with developer mode enabled. ```Shell scp RPMS/harbour-qutenav-*.rpm nemo@$HOST: ssh -t nemo@$HOST "devel-su rpm -U harbour-qutenav-*.rpm" ``` -------------------------------- ### Install qutenav 3D Globe and Map Data with CMake Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt This CMake snippet installs 3D model files ('sphere.obj') and associated texture maps (for a globe or world map) to a dedicated 'qutenav/globe' data directory, essential for rendering the application's geographical features. ```CMake install(FILES data/sphere.obj data/negx.jpg data/negy.jpg data/negz.jpg data/posx.jpg data/posy.jpg data/posz.jpg DESTINATION ${CMAKE_INSTALL_DATADIR}/qutenav/globe) ``` -------------------------------- ### Install qutenav S57 Nautical Chart Data with CMake Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt This CMake snippet installs S57 nautical chart related data files, including CSV definitions, XML chart symbols, and raster symbol images, to the 'qutenav/s57data' directory, which are crucial for displaying maritime charts. ```CMake install(FILES data/s57objectclasses.csv data/s57attributes.csv data/s57expectedinput.csv data/chartsymbols.xml data/rastersymbols-dark.png data/rastersymbols-day.png data/rastersymbols-dusk.png DESTINATION ${CMAKE_INSTALL_DATADIR}/qutenav/s57data) ``` -------------------------------- ### Prepare QuteNav for Sailfish OS Build Source: https://github.com/jusirkka/qutenav/blob/master/README.md Initial steps to set up the QuteNav project for building on Sailfish OS, including cloning the repository and generating icons. ```Shell git clone git@github.com:jusirkka/qutenav.git cd qutenav make -f sailfishos.make icons ``` -------------------------------- ### Define and Configure CMake Static Library Source: https://github.com/jusirkka/qutenav/blob/master/platform.silica/CMakeLists.txt This CMake snippet defines a static library named 'Platform'. It specifies the library's source files, private include directories (including paths for Qt, GEOS, qutenavlib, Sailfish, and an emulator path), sets the C++ standard to C++17, and links necessary libraries such as Qt5 modules (Core, Quick, Sql, Positioning) and Freetype. ```CMake add_library(Platform STATIC) target_sources(Platform PRIVATE src/main.cpp ) target_include_directories(Platform PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../src ${CMAKE_CURRENT_SOURCE_DIR}/../geos/src ${CMAKE_CURRENT_SOURCE_DIR}/../qutenavlib/src ${SAILFISH_INCLUDE_DIRS} $ENV{EMU_PATH}/include/sailfishapp ) target_compile_features(Platform PRIVATE cxx_std_17 ) target_link_libraries(Platform PRIVATE ${SAILFISH_LDFLAGS} Qt5::Core Qt5::Quick Qt5::Sql Qt5::Positioning Freetype::Freetype ) ``` -------------------------------- ### Initialize CMake Project and Set Minimum Version Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Sets the minimum required CMake version and defines the project name "qutenav" along with the supported languages (CXX, C). This ensures compatibility and project identification. ```CMake cmake_minimum_required(VERSION 3.11 FATAL_ERROR) project(qutenav LANGUAGES CXX C) ``` -------------------------------- ### Configure CMake Project for Qt Navigation Tests Source: https://github.com/jusirkka/qutenav/blob/master/tests/CMakeLists.txt This snippet defines the CMake configuration for the 'qutenav_tests' project. It ensures a minimum CMake version, enables testing, finds required Qt5 components (Test, OpenGL), defines an executable 'test_region', and configures its sources, include paths, C++ standard (C++17), and linked libraries. ```CMake cmake_minimum_required(VERSION 3.11 FATAL_ERROR) enable_testing() project(qutenav_tests LANGUAGES CXX) # # dependencies # set(QT_MIN_VERSION "5.6.3") find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test OpenGL ) # # targets # add_executable(test_region) add_test(NAME test_region COMMAND test_region) set_target_properties(test_region PROPERTIES AUTOMOC ON ) target_sources(test_region PRIVATE src/test_region.cpp ../src/region.cpp ) target_include_directories(test_region PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../src ) target_compile_features(test_region PRIVATE cxx_std_17 ) target_link_libraries(test_region PRIVATE Qt5::Test Qt5::OpenGL ) ``` -------------------------------- ### Find Core Qt5 Dependencies Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Specifies the minimum required Qt5 version and finds essential Qt5 components like Sql, Xml, Quick, Positioning, OpenGL, DBus, and LinguistTools. These components are crucial for the application's core functionalities. ```CMake set(QT_MIN_VERSION "5.6.3") find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Sql Xml Quick Positioning OpenGL DBus LinguistTools ) ``` -------------------------------- ### Link Required Libraries for QuteNav Executable Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Links the `qutenav` executable against a comprehensive list of private libraries, including platform-specific libraries, various readers, core QuteNav components, GeographicLib, Triangulate, and Qt5 modules (Quick, Gui, Sql, Positioning, DBus), along with Freetype, Fontconfig, and Harfbuzz. ```CMake target_link_libraries(qutenav PRIVATE ${PLATFORM_LDFLAGS} Platform Osencreader Oesureader Cm93reader S57reader GSHHSreader Geos QuteNavLib GeographicLib Triangulate Qt5::Quick Qt5::Gui Qt5::Sql Qt5::Positioning Qt5::DBus Freetype::Freetype fontconfig harfbuzz::harfbuzz ${PLATFORM_LIBS} ) ``` -------------------------------- ### Find Build Tool and Library Dependencies Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Locates and ensures the presence of essential build tools and libraries: Bison (parser generator), Flex (lexical analyzer generator), Freetype (font rendering), and Harfbuzz (text shaping). These are required for various compilation and rendering tasks. ```CMake set(BISON_MIN_VERSION "3.1") find_package(BISON ${BISON_MIN_VERSION} REQUIRED) set(FLEX_MIN_VERSION "2.6.1") find_package(FLEX ${FLEX_MIN_VERSION} REQUIRED) set(FREETYPE_MIN_VERSION "2.10.0") find_package(Freetype ${FREETYPE_MIN_VERSION} REQUIRED) find_package(harfbuzz REQUIRED) ``` -------------------------------- ### Specify Include Directories for QuteNav Executable Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Adds private include directories for the `qutenav` executable, pointing to various source subdirectories and the CMake binary output directory for generated headers. ```CMake target_include_directories(qutenav PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/geographiclib/src ${CMAKE_CURRENT_SOURCE_DIR}/geos/src ${CMAKE_CURRENT_SOURCE_DIR}/triangulate/src ${CMAKE_CURRENT_SOURCE_DIR}/qutenavlib/src ${CMAKE_BINARY_DIR} ) ``` -------------------------------- ### Generate D-Bus Adaptor for DB Updater Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Uses the `qt5_add_dbus_adaptor` function to generate D-Bus adaptor source files from an XML interface definition, integrating D-Bus communication capabilities into the `qutenav_dbupdater`. ```CMake set(dbus_adaptor_SRCS) qt5_add_dbus_adaptor(dbus_adaptor_SRCS dbupdater/src/dbupdater.xml updater.h Updater dbupdater_adaptor ) ``` -------------------------------- ### Specify Source Files for QuteNav DB Updater Executable Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Lists the private source files for the `qutenav_dbupdater` executable, including its main C++ file and the generated D-Bus adaptor sources. ```CMake target_sources(qutenav_dbupdater PRIVATE dbupdater/src/main.cpp ${dbus_adaptor_SRCS} ) ``` -------------------------------- ### Define QML Resources for Sailfish Silica Platform Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Lists all QML files that constitute the user interface for the "silica" platform. These files are added as a custom target named `Qml`, ensuring they are processed during the build. This extensive list covers various UI components and pages. ```CMake add_custom_target(Qml SOURCES qml/Boat.qml qml/Bubble.qml qml/CenterButton.qml qml/ChartDialog.qml qml/ChartFolderSelector.qml qml/ChartPage.qml qml/ChartPreferencesPage.qml qml/CoverPage.qml qml/DimensionalValue.qml qml/DistanceButton.qml qml/EditButton.qml qml/EulaPage.qml qml/InfoPage.qml qml/InfoQueryButton.qml qml/LinkDetailItem.qml qml/MapLabel.qml qml/MenuButton.qml qml/MenuPage.qml qml/ObjectInfoBubble.qml qml/Pinpoint.qml qml/PreferencesPage.qml qml/Renamer.qml qml/RouteButton.qml qml/RouteDisplayDialog.qml qml/RoutePoint.qml qml/RoutingResultDialog.qml qml/RoutingStartDialog.qml qml/Ruler.qml qml/ScaleBar.qml qml/SystemPreferencesPage.qml qml/SimpleBubble.qml qml/TrackButton.qml qml/TrackDisplayDialog.qml qml/TrackInfo.qml qml/TrackInfoBox.qml qml/TrackPointInfoBox.qml qml/TrackResultDialog.qml qml/TrackSpeedInfoBox.qml qml/TrackStatisticsPage.qml qml/TrackTargetInfoBox.qml qml/UnitPreferencesPage.qml qml/ValuePref.qml qml/platform.silica/ApplicationWindowPL.qml qml/platform.silica/ButtonPL.qml qml/platform.silica/BusyIndicatorPL.qml qml/platform.silica/ChartPagePL.qml qml/platform.silica/ComboBoxPL.qml qml/platform.silica/ContextMenuItemPL.qml qml/platform.silica/ContextMenuPL.qml qml/platform.silica/DetailItemPL.qml qml/platform.silica/DialogPL.qml qml/platform.silica/FolderPickerPL.qml qml/platform.silica/IconListItemPL.qml qml/platform.silica/LabelPL.qml qml/platform.silica/LinkAreaPL.qml qml/platform.silica/ListItemPL.qml qml/platform.silica/ListViewPL.qml qml/platform.silica/MapButtonPL.qml qml/platform.silica/PagePL.qml qml/platform.silica/SectionHeaderPL.qml qml/platform.silica/SwitchPL.qml qml/platform.silica/TextFieldPL.qml qml/platform.silica/TextSwitchPL.qml qml/platform.silica/ThemePL.qml qml/platform.silica/ViewPlaceholderPL.qml qml/qutenav.qml ) endif () ``` -------------------------------- ### Define QuteNav Project Executables Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt This snippet defines the main `qutenav` application executable and a separate `qutenav_dbupdater` executable for database updates. ```CMake add_executable(qutenav) add_executable(qutenav_dbupdater) ``` -------------------------------- ### Generate Lexer and Parser Files using Flex and Bison Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Configures CMake to use Flex and Bison for generating C++ lexer and parser files from `.l` (lexer) and `.y` (parser) definitions. This is used for parsing Wavefront, S52 instruction, and S52 HPGL data. ```CMake FLEX_TARGET(WFScanner src/wavefront_scanner.l ${CMAKE_BINARY_DIR}/wavefront_scanner.cpp DEFINES_FILE ${CMAKE_BINARY_DIR}/wavefront_scanner.h) BISON_TARGET(WFParser src/wavefront_parser.y ${CMAKE_BINARY_DIR}/wavefront_parser.cpp DEFINES_FILE ${CMAKE_BINARY_DIR}/wavefront_parser.h) FLEX_TARGET(S52IScanner src/s52instr_scanner.l ${CMAKE_BINARY_DIR}/s52instr_scanner.cpp DEFINES_FILE ${CMAKE_BINARY_DIR}/s52instr_scanner.h) BISON_TARGET(S52IParser src/s52instr_parser.y ${CMAKE_BINARY_DIR}/s52instr_parser.cpp DEFINES_FILE ${CMAKE_BINARY_DIR}/s52instr_parser.h) FLEX_TARGET(S52HScanner src/s52hpgl_scanner.l ${CMAKE_BINARY_DIR}/s52hpgl_scanner.cpp DEFINES_FILE ${CMAKE_BINARY_DIR}/s52hpgl_scanner.h) BISON_TARGET(S52HParser src/s52hpgl_parser.y ${CMAKE_BINARY_DIR}/s52hpgl_parser.cpp DEFINES_FILE ${CMAKE_BINARY_DIR}/s52hpgl_parser.h) ``` -------------------------------- ### Build QuteNav Sailfish OS Application Source: https://github.com/jusirkka/qutenav/blob/master/README.md Instructions to compile the QuteNav application for Sailfish OS using the sfdk tool after setting up the build environment. ```Shell alias sfdk=$SDK/bin/sfdk sfdk config target="SailfishOS-$VERSION-armv7hl" sfdk build ``` -------------------------------- ### Specify Source Files for QuteNav Executable Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Lists all private source files for the `qutenav` executable, including platform-specific QML resources, shaders, and numerous C++ source files related to charting, rendering, database, and utility functions. ```CMake target_sources(qutenav PRIVATE ${PLATFORM_QML_QRC} shaders/${PLATFORM_SHADERS}.qrc src/camera.cpp src/cachereader.cpp src/chartcover.cpp src/chartindicator.cpp src/chartmanager.cpp src/chartmode.cpp src/chartpainter.cpp src/chartproxy.cpp src/chartupdater.cpp src/dbupdater_interface.cpp src/decompose.cpp src/detailmode.cpp src/drawable.cpp src/globe.cpp src/glyphmanager.cpp src/hpglparser.cpp src/hpglopenglparser.cpp src/hpglpixmapparser.cpp src/linecalculator.cpp src/orthocam.cpp src/outlinemode.cpp src/outliner.cpp src/perscam.cpp src/rastersymbolmanager.cpp src/s52functions.cpp src/s52presentation.cpp src/s52presentation_p.cpp src/s57imageprovider.cpp src/s57chart.cpp src/s57paintdata.cpp src/settings.cpp src/shader.cpp src/slotcounter.cpp src/symboldata.cpp src/textmanager.cpp src/tiny_sdf.cpp src/units.cpp src/utils.cpp src/vectorsymbolmanager.cpp src/wfreader.cpp src/chartdisplay.cpp src/chartrenderer.cpp src/configgroup.cpp src/conf_detailmode.cpp src/conf_quick.cpp src/conf_mainwindow.cpp src/conf_marinerparams.cpp src/conf_units.cpp src/crosshairs.cpp src/databasemodel.cpp src/routedatabase.cpp src/router.cpp src/routetracker.cpp src/routemodel.cpp src/trackdatabase.cpp src/tracker.cpp src/trackmodel.cpp ${CMAKE_BINARY_DIR}/wavefront_parser.cpp ${CMAKE_BINARY_DIR}/wavefront_scanner.cpp ${CMAKE_BINARY_DIR}/s52instr_parser.cpp ${CMAKE_BINARY_DIR}/s52instr_scanner.cpp ${CMAKE_BINARY_DIR}/s52hpgl_parser.cpp ${CMAKE_BINARY_DIR}/s52hpgl_scanner.cpp ${QUTENAV_QMS} ) ``` -------------------------------- ### Specify Include Directories for QuteNav DB Updater Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Adds private include directories for the `qutenav_dbupdater` executable, including its own source directory, `qutenavlib`, and the CMake binary output directory. ```CMake target_include_directories(qutenav_dbupdater PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/dbupdater/src ${CMAKE_CURRENT_SOURCE_DIR}/qutenavlib/src ${CMAKE_BINARY_DIR} ) ``` -------------------------------- ### Define Documentation Custom Target Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Creates a custom CMake target named `Doc` that includes `TODO` and `README.md` as its sources. This target can be used to manage or process documentation files within the build system. ```CMake add_custom_target(Doc SOURCES TODO README.md ) ``` -------------------------------- ### Configure Oesureader Static Library with CMake Source: https://github.com/jusirkka/qutenav/blob/master/oesureader/CMakeLists.txt This CMake snippet defines a static library named 'Oesureader'. It enables AUTOMOC for Qt projects, specifies the source file 'src/oesureader.cpp', sets include directories for its own source and a related library, enforces C++17 standard, defines 'QT_STATICPLUGIN', and links against Qt5::OpenGL. ```CMake add_library(Oesureader STATIC) set_target_properties(Oesureader PROPERTIES AUTOMOC ON ) target_sources(Oesureader PRIVATE src/oesureader.cpp ) target_include_directories(Oesureader PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../qutenavlib/src ) target_compile_features(Oesureader PRIVATE cxx_std_17 ) target_compile_definitions(Oesureader PRIVATE QT_STATICPLUGIN ) target_link_libraries(Oesureader PRIVATE Qt5::OpenGL ) ``` -------------------------------- ### Link Required Libraries for QuteNav DB Updater Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Links the `qutenav_dbupdater` executable against its own library, various readers, QuteNavLib, Triangulate, GeographicLib, and core Qt5 modules (Core, Sql, OpenGL). ```CMake target_link_libraries(qutenav_dbupdater PRIVATE Dbupdater Osencreader Oesureader Cm93reader S57reader QuteNavLib Triangulate GeographicLib Qt5::Core Qt5::Sql Qt5::OpenGL ) ``` -------------------------------- ### Configure Build Properties for QuteNav Executable Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Sets properties for the `qutenav` executable, enabling automatic MOC (Meta-Object Compiler) and RCC (Resource Compiler) processing for Qt projects. ```CMake set_target_properties(qutenav PROPERTIES AUTOMOC ON AUTORCC ON ) ``` -------------------------------- ### Configure Dependencies for QtControls Platform Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Defines platform-specific dependencies and settings when `PLATFORM` is set to "qtcontrols". It finds Fontconfig and GLM, and sets variables for OpenGL desktop shaders and QtControls-specific QML resources. ```CMake if (PLATFORM STREQUAL qtcontrols) set(FONTCONFIG_MIN_VERSION "2.13") find_package(Fontconfig ${FONTCONFIG_MIN_VERSION} REQUIRED) set(GLM_VERSION "0.9.9") find_package(glm ${GLM_VERSION} REQUIRED) set(PLATFORM_SHADERS "shaders_opengl_desktop") set(PLATFORM_QML_QRC "qml_qtcontrols.qrc") ``` -------------------------------- ### Configure Dependencies for Sailfish Silica Platform Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Configures build settings and dependencies specifically for the "silica" platform, typically used for Sailfish OS. It includes `FindPkgConfig`, sets `CMAKE_PREFIX_PATH` for Qt Creator compatibility, and finds `sailfishapp`, `glm`, and `Fontconfig` via `pkg-config`. It also defines platform-specific linker flags and libraries. ```CMake elseif (PLATFORM STREQUAL silica) include(FindPkgConfig) # make it cooperate with qt-creator by setting EMU_PATH to appr. value set (CMAKE_PREFIX_PATH "$ENV{EMU_PATH}") pkg_search_module(SAILFISH REQUIRED sailfishapp) pkg_search_module(GLM REQUIRED glm) pkg_search_module(Fontconfig REQUIRED fontconfig) set(PLATFORM_LDFLAGS "${SAILFISH_LDFLAGS}") set(PLATFORM_LIBS -lGLESv2) set(PLATFORM_SHADERS "shaders_opengl_es") ``` -------------------------------- ### Configure CMake for 'Platform' Static Library Source: https://github.com/jusirkka/qutenav/blob/master/platform.qtcontrols/CMakeLists.txt This CMake configuration defines a static library named 'Platform'. It enables AUTOMOC and AUTORCC for Qt integration, specifies source files, includes necessary directories for compilation, sets the C++ standard to C++17, and links against Qt modules (Core, Quick, Sql, Positioning) and Freetype. ```CMake add_library(Platform STATIC) set_target_properties(Platform PROPERTIES AUTOMOC ON AUTORCC ON ) target_sources(Platform PRIVATE src/main.cpp ) target_include_directories(Platform PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../src ${CMAKE_CURRENT_SOURCE_DIR}/../qutenavlib/src ${CMAKE_CURRENT_SOURCE_DIR}/../geos/src ) target_compile_features(Platform PRIVATE cxx_std_17 ) target_link_libraries(Platform PRIVATE Qt5::Core Qt5::Quick Qt5::Sql Qt5::Positioning Freetype::Freetype ) ``` -------------------------------- ### Configure CMake Static Library for Cm93reader Source: https://github.com/jusirkka/qutenav/blob/master/cm93reader/CMakeLists.txt This snippet defines the 'Cm93reader' as a static library, enables automatic MOC processing for Qt, specifies its private source files, and lists all necessary private include directories. It also enforces C++17 standard, adds a preprocessor definition for static Qt plugins, and links against the Qt5::OpenGL module. ```CMake add_library(Cm93reader STATIC) set_target_properties(Cm93reader PROPERTIES AUTOMOC ON ) target_sources(Cm93reader PRIVATE src/cm93presentation.cpp src/cm93reader.cpp ) target_include_directories(Cm93reader PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../qutenavlib/src ${CMAKE_CURRENT_SOURCE_DIR}/../triangulate/src ) target_compile_features(Cm93reader PRIVATE cxx_std_17 ) target_compile_definitions(Cm93reader PRIVATE QT_STATICPLUGIN ) target_link_libraries(Cm93reader PRIVATE Qt5::OpenGL ) ``` -------------------------------- ### Configure QuteNavLib Static Library in CMake Source: https://github.com/jusirkka/qutenav/blob/master/qutenavlib/CMakeLists.txt This CMake snippet defines the QuteNavLib as a static library. It enables Qt's AUTOMOC feature, lists all private source files, specifies necessary private include directories (including external dependencies like triangulate and geographiclib), links required Qt5 modules (Sql, OpenGL), and sets the C++ standard to C++17 for compilation. ```CMake add_library(QuteNavLib STATIC) set_target_properties(QuteNavLib PROPERTIES AUTOMOC ON ) target_sources(QuteNavLib PRIVATE src/chartdatabase.cpp src/chartfilereader.cpp src/geomutils.cpp src/geoprojection.cpp src/logging.cpp src/osenc.cpp src/ocdevice.cpp src/ochelper.cpp src/platform.cpp src/region.cpp src/s52names.cpp src/s57chartoutline.cpp src/s57object.cpp src/sqlitedatabase.cpp src/translationmanager.cpp src/types.cpp ) target_include_directories(QuteNavLib PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../triangulate/src ${CMAKE_CURRENT_SOURCE_DIR}/../geographiclib/src ) target_link_libraries(QuteNavLib PRIVATE Qt5::Sql Qt5::OpenGL ) target_compile_features(QuteNavLib PRIVATE cxx_std_17 ) ``` -------------------------------- ### Configure Osencreader Static Library with CMake Source: https://github.com/jusirkka/qutenav/blob/master/osencreader/CMakeLists.txt This CMake code defines a static library named 'Osencreader'. It enables AUTOMOC for Qt, specifies the main source file, sets private include directories for its own source and a related library, enforces C++17 standard, adds a static plugin definition, and links against the Qt5::OpenGL library. ```CMake add_library(Osencreader STATIC) set_target_properties(Osencreader PROPERTIES AUTOMOC ON ) target_sources(Osencreader PRIVATE src/osencreader.cpp ) target_include_directories(Osencreader PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../qutenavlib/src ) target_compile_features(Osencreader PRIVATE cxx_std_17 ) target_compile_definitions(Osencreader PRIVATE QT_STATICPLUGIN ) target_link_libraries(Osencreader PRIVATE Qt5::OpenGL ) ``` -------------------------------- ### Set C++ Standard for QuteNav Executable Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Ensures the `qutenav` executable is compiled using the C++17 standard features. ```CMake target_compile_features(qutenav PRIVATE cxx_std_17 ) ``` -------------------------------- ### Configure CMake for Dbupdater Static Library Source: https://github.com/jusirkka/qutenav/blob/master/dbupdater/CMakeLists.txt This CMake configuration defines a static library named 'Dbupdater', enabling automatic MOC processing for Qt, specifying source files, private include directories, C++17 standard compliance, and linking necessary Qt modules like Core, DBus, Sql, and OpenGL. ```CMake add_library(Dbupdater STATIC) set_target_properties(Dbupdater PROPERTIES AUTOMOC ON ) target_sources(Dbupdater PRIVATE src/updater.cpp src/state.cpp ) target_include_directories(Dbupdater PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../qutenavlib/src ${CMAKE_BINARY_DIR} ) target_compile_features(Dbupdater PRIVATE cxx_std_17 ) target_link_libraries(Dbupdater PRIVATE Qt5::Core Qt5::DBus Qt5::Sql Qt5::OpenGL ) ``` -------------------------------- ### Set C++ Standard for QuteNav DB Updater Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Ensures the `qutenav_dbupdater` executable is compiled using the C++17 standard features. ```CMake target_compile_features(qutenav_dbupdater PRIVATE cxx_std_17 ) ``` -------------------------------- ### Configure Translation System Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Sets up the translation system by including a custom CMake module `MyAddTranslation` and then using it to add translations for `QUTENAV_QMS` from `translations/id_en.ts` with an ID-based option. This integrates localization into the build process. ```CMake set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) include(MyAddTranslation) # -- Update: # lupdate -locations relative -target-language en_US . -ts translations/id_en.ts # -- and/or # ./s57totr.py translations/id_en.ts my_add_translation(QUTENAV_QMS translations/id_en.ts OPTIONS -idbased ) ``` -------------------------------- ### Configure S57reader Static Library with CMake Source: https://github.com/jusirkka/qutenav/blob/master/s57reader/CMakeLists.txt This snippet configures the 'S57reader' as a static library in CMake. It enables AUTOMOC for Qt, specifies source files like 'record.cpp' and 's57reader.cpp', defines include directories for both the current source and a related library, sets the C++ standard to C++17, adds the 'QT_STATICPLUGIN' definition, and links against 'Qt5::OpenGL'. ```CMake add_library(S57reader STATIC) set_target_properties(S57reader PROPERTIES AUTOMOC ON ) target_sources(S57reader PRIVATE src/record.cpp src/s57reader.cpp ) target_include_directories(S57reader PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../qutenavlib/src ) target_compile_features(S57reader PRIVATE cxx_std_17 ) target_compile_definitions(S57reader PRIVATE QT_STATICPLUGIN ) target_link_libraries(S57reader PRIVATE Qt5::OpenGL ) ``` -------------------------------- ### Define and Configure Geos Static Library Source: https://github.com/jusirkka/qutenav/blob/master/geos/CMakeLists.txt This CMake code block sets up a static library named 'Geos'. It adds source files from the 'src' directory, specifies private include paths, enforces the C++17 standard for compilation, and links the library with 'Qt5::Core' for its dependencies. ```CMake add_library(Geos STATIC) target_sources(Geos PRIVATE src/LineSegment.cpp src/LineString.cpp src/Distance.cpp ) target_include_directories(Geos PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) target_compile_features(Geos PRIVATE cxx_std_17 ) target_link_libraries(Geos PRIVATE Qt5::Core ) ``` -------------------------------- ### Define and Configure Triangulate Static Library in CMake Source: https://github.com/jusirkka/qutenav/blob/master/triangulate/CMakeLists.txt This CMake snippet defines a static library named 'Triangulate'. It specifies the private source files (`src/triangulator.cpp`, `src/earcuttessellator.cpp`), private include directories (current source and `qutenavlib/src`), private linked libraries (`Qt5::Core`, `Qt5::Gui`, `Qt5::OpenGL`), and sets the C++ standard to C++17 for compilation. ```CMake add_library(Triangulate STATIC) target_sources(Triangulate PRIVATE src/triangulator.cpp src/earcuttessellator.cpp ) target_include_directories(Triangulate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../qutenavlib/src ) target_link_libraries(Triangulate PRIVATE Qt5::Core Qt5::Gui Qt5::OpenGL ) target_compile_features(Triangulate PRIVATE cxx_std_17 ) ``` -------------------------------- ### Include External Project Subdirectories Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Adds various subdirectories to the build, which likely contain external libraries or modules like GeographicLib, Triangulate, and different chart readers (osencreader, oesureader, cm93reader, s57reader, gshhsreader), platform-specific code, GEOS, and QuteNavLib. ```CMake add_subdirectory(geographiclib) add_subdirectory(triangulate) add_subdirectory(osencreader) add_subdirectory(oesureader) add_subdirectory(cm93reader) add_subdirectory(s57reader) add_subdirectory(gshhsreader) add_subdirectory(platform.${PLATFORM}) add_subdirectory(geos) add_subdirectory(qutenavlib) add_subdirectory(dbupdater) ``` -------------------------------- ### Configure CMake Static Library for GSHHSreader Source: https://github.com/jusirkka/qutenav/blob/master/gshhsreader/CMakeLists.txt This CMake snippet configures the 'GSHHSreader' static library. It enables AUTOMOC for Qt, lists private source files, specifies private include directories relative to the current source and a sibling project, sets the C++ standard to C++17, defines 'QT_STATICPLUGIN', and links privately against Qt5::OpenGL. ```CMake add_library(GSHHSreader STATIC) set_target_properties(GSHHSreader PROPERTIES AUTOMOC ON ) target_sources(GSHHSreader PRIVATE src/shapereader.cpp src/gshhsreader.cpp ) target_include_directories(GSHHSreader PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/../qutenavlib/src ) target_compile_features(GSHHSreader PRIVATE cxx_std_17 ) target_compile_definitions(GSHHSreader PRIVATE QT_STATICPLUGIN ) target_link_libraries(GSHHSreader PRIVATE Qt5::OpenGL ) ``` -------------------------------- ### Set Default Build Platform Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Checks if the `PLATFORM` variable is defined and, if not, sets its default value to "qtcontrols". This provides a fallback platform configuration for the build. ```CMake if (NOT DEFINED PLATFORM) set(PLATFORM qtcontrols) endif() ``` -------------------------------- ### Configure GeographicLib Static Library with CMake Source: https://github.com/jusirkka/qutenav/blob/master/geographiclib/CMakeLists.txt This CMake snippet defines a static library named `GeographicLib`. It specifies the private source files, includes the `src` directory, sets the C++ standard to C++17, adds the position-independent code (PIC) flag, and defines a preprocessor macro `GEOGRAPHICLIB_GEODESIC_ORDER` to 4. This configuration is essential for building and linking GeographicLib within a larger CMake project. ```CMake add_library(GeographicLib STATIC) target_sources(GeographicLib PRIVATE src/Geodesic.cpp src/GeodesicLine.cpp src/Math.cpp ) target_include_directories(GeographicLib PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) target_compile_features(GeographicLib PRIVATE cxx_std_17 ) target_compile_options(GeographicLib PRIVATE -fPIC ) target_compile_definitions(GeographicLib PRIVATE GEOGRAPHICLIB_GEODESIC_ORDER=4 ) ``` -------------------------------- ### Conditionally Disable AUTOMOC for QuteNav DB Updater Source: https://github.com/jusirkka/qutenav/blob/master/CMakeLists.txt Disables AUTOMOC for the `qutenav_dbupdater` executable specifically when the platform is 'silica' to avoid duplicate MOC generation issues, otherwise enables it. ```CMake if (PLATFORM STREQUAL silica) set_target_properties(qutenav_dbupdater PROPERTIES AUTOMOC OFF ) else() set_target_properties(qutenav_dbupdater PROPERTIES AUTOMOC ON ) endif() ``` -------------------------------- ### Uninstall QuteNav Sailfish OS Application Source: https://github.com/jusirkka/qutenav/blob/master/README.md Command to remove the QuteNav application from a Sailfish OS device via SSH and developer mode. ```Shell ssh -t nemo@$HOST "devel-su rpm -e \$(rpm -qa|grep qutenav)" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.