diff --git a/.github/workflows/BuildPR.yml b/.github/workflows/BuildPR.yml index fe07f886..03af9d5f 100644 --- a/.github/workflows/BuildPR.yml +++ b/.github/workflows/BuildPR.yml @@ -25,8 +25,6 @@ jobs: run: ls -n /Applications/ | grep Xcode* - name: Set XCode Version run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app - - name: install qt 5 - run: brew install qt@5 - name: install build environment run: scripts/install.sh - name: Build project @@ -55,7 +53,7 @@ jobs: - name: Build project run: scripts/build.sh - name: Make artifact executable - run: chmod -R +x build/release + run: chmod -R +x build/release - name: Archive artifact uses: actions/upload-artifact@v2.3.1 if: ${{ success() }} diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/CMakeLists.txt b/CMakeLists.txt index 72cb3266..d7376674 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: MPL-2.0 # # Copyright (C) 2016, Jack S. Smith # @@ -12,88 +13,114 @@ # # List of changes: # 01.Oct.2016, Jack Smith , Original Author -# -cmake_minimum_required (VERSION 3.1) +cmake_minimum_required (VERSION 3.15) + +project(dlt-viewer) -project (dlt-viewer) +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set(LINUX TRUE) +endif() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_EXPORT_COMPILE_COMMANDS ON) if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() -set(QT_VERSION_REQ "5") - -find_package(Qt5 ${QT_VERSION_REQ} REQUIRED COMPONENTS Core Network Widgets SerialPort PrintSupport) +find_package(Qt5 "5" REQUIRED COMPONENTS Core Network Widgets SerialPort PrintSupport) if(Qt5Core_VERSION VERSION_LESS "5.5.1") # Presumably Qt5Core implies all dependent libs too message(FATAL_ERROR "QT minimum version required: 5.5.1") endif() -set (CMAKE_VERBOSE_MAKEFILE FALSE) - set (CMAKE_AUTOMOC ON) set (CMAKE_AUTOUIC ON) -set (CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) -option(USE_QT_RPATH "Use RPATH for QT_LIBRARY_PATH to support non-standard QT install locations" ON) +get_target_property(DLT_QT5_LIBRARY_PATH Qt5::Core LOCATION) +get_filename_component(DLT_QT5_LIB_DIR ${DLT_QT5_LIBRARY_PATH} DIRECTORY) -if (USE_QT_RPATH) - # Add Qt to the RPATH, so that there is no need to set LD_LIBRARY_PATH at runtime if Qt is installed in a non-standard location - get_target_property(QT_LIBRARY_PATH Qt5::Core LOCATION) - get_filename_component(QT_LIB_DIR ${QT_LIBRARY_PATH} DIRECTORY) - set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${QT_LIB_DIR}") +if(NOT WIN32) + option(DLT_USE_QT_RPATH "Use RPATH for QT_LIBRARY_PATH to support non-standard QT install locations" ON) + if (DLT_USE_QT_RPATH) + # Add Qt to the RPATH, so that there is no need to set LD_LIBRARY_PATH at runtime if Qt is installed in a non-standard location + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${DLT_QT5_LIB_DIR}") + endif() endif() # Injection of the GCC-specific compilation flags -if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") - add_definitions( "-Wall" ) - add_definitions( "-Wextra" ) - add_definitions( "-pedantic" ) - add_definitions( "-Wno-variadic-macros" ) - add_definitions( "-Wno-strict-aliasing" ) +if(CMAKE_COMPILER_IS_GNUCXX) + message(STATUS "GCC detected, adding compile flags") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") + add_definitions("-Wall" "-Wextra" "-pedantic" "-Wno-variadic-macros" "-Wno-strict-aliasing" "-fPIC") endif() -# build executables in build/bin directory -set(BIN_DIR ${CMAKE_BINARY_DIR}/bin) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BIN_DIR}) - -add_definitions(-DQT5) - -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) # set location for all executables in the build folder - -option(USE_STANDARD_INSTALLATION_LOCATION "Use standard GNU installation locations" OFF) - -if (USE_STANDARD_INSTALLATION_LOCATION) - include(GNUInstallDirs) # for standard installation locations - set(PLUGIN_INSTALLATION_PATH ${CMAKE_INSTALL_FULL_LIBDIR}/dlt-viewer/plugins) - set(RESOURCE_INSTALLATION_PATH ${CMAKE_INSTALL_FULL_DATADIR}/dlt-viewer) - set(EXECUTABLE_INSTALLATION_PATH ${CMAKE_INSTALL_FULL_BINDIR}) - set(LIBRARY_INSTALLATION_PATH ${CMAKE_INSTALL_FULL_LIBDIR}) +add_compile_definitions(QT5) + +option(DLT_USE_STANDARD_INSTALLATION_LOCATION "Use standard GNU installation locations" OFF) +if(NOT WIN32) + if(DLT_USE_STANDARD_INSTALLATION_LOCATION) + include(GNUInstallDirs) + set(DLT_PLUGIN_INSTALLATION_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/dlt-viewer/plugins") + set(DLT_RESOURCE_INSTALLATION_PATH "${CMAKE_INSTALL_FULL_DATADIR}/dlt-viewer") + set(DLT_EXECUTABLE_INSTALLATION_PATH "${CMAKE_INSTALL_FULL_BINDIR}") + set(DLT_LIBRARY_INSTALLATION_PATH "${CMAKE_INSTALL_FULL_LIBDIR}") + else() + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "DLTViewer") + endif() + if(NOT DLT_PLUGIN_INSTALLATION_PATH) + set(DLT_PLUGIN_INSTALLATION_PATH "usr/bin/plugins") + endif() + if(NOT DLT_RESOURCE_INSTALLATION_PATH) + set(DLT_RESOURCE_INSTALLATION_PATH "usr/share") + endif() + if(NOT DLT_EXECUTABLE_INSTALLATION_PATH) + set(DLT_EXECUTABLE_INSTALLATION_PATH "usr/bin") + endif() + if(NOT DLT_LIBRARY_INSTALLATION_PATH) + set(DLT_LIBRARY_INSTALLATION_PATH "usr/lib") + endif() + endif() else() - set(PLUGIN_INSTALLATION_PATH deploy/plugins) - set(RESOURCE_INSTALLATION_PATH deploy) - set(EXECUTABLE_INSTALLATION_PATH deploy) - set(LIBRARY_INSTALLATION_PATH deploy) + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + # AppData is a modern install location. No Admin rights required. + file(TO_CMAKE_PATH "$ENV{LOCALAPPDATA}/Programs" CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "..." FORCE) + endif() + + if(NOT DLT_PLUGIN_INSTALLATION_PATH) + set(DLT_PLUGIN_INSTALLATION_PATH "plugins") + endif() + if(NOT DLT_RESOURCE_INSTALLATION_PATH) + set(DLT_RESOURCE_INSTALLATION_PATH ".") + endif() + if(NOT DLT_EXECUTABLE_INSTALLATION_PATH) + set(DLT_EXECUTABLE_INSTALLATION_PATH ".") + endif() + if(NOT DLT_LIBRARY_INSTALLATION_PATH) + set(DLT_LIBRARY_INSTALLATION_PATH ".") + endif() endif() -add_definitions(-DPLUGIN_INSTALLATION_PATH="${PLUGIN_INSTALLATION_PATH}") +option(DLT_PARSER "Build DLT Parser" OFF) + +if(DLT_PARSER) + add_subdirectory(parser) +endif() -add_subdirectory(parser) add_subdirectory(qdlt) add_subdirectory(src) add_subdirectory(plugin) -#add_subdirectory(dlt-console-viewer) -#get_cmake_property(_variableNames VARIABLES) -#foreach (_variableName ${_variableNames}) -# message(STATUS "${_variableName}=${${_variableName}}") -#endforeach() +message(STATUS "\n\t** DLT Viewer Build Summary **") +message(STATUS "\tCMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "\tCMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +message(STATUS "\tCMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") +message(STATUS "\tCMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") +message(STATUS "\tDLT_QT5_LIB_DIR: ${DLT_QT5_LIB_DIR}\n") diff --git a/doc/dlt_viewer_plugins_programming_guide.pdf b/doc/dlt_viewer_plugins_programming_guide.pdf new file mode 100644 index 00000000..45a84424 Binary files /dev/null and b/doc/dlt_viewer_plugins_programming_guide.pdf differ diff --git a/doc/images/genivi_chrome_1_transparent.png b/doc/images/genivi_chrome_1_transparent.png old mode 100755 new mode 100644 diff --git a/doc/images/genivi_transparent.png b/doc/images/genivi_transparent.png old mode 100755 new mode 100644 diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt index 45b3a790..d2004440 100644 --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -13,17 +13,29 @@ # 01.Oct.2016, Jack Smith , Original Author # -# cmake 2.8.12 doesn't have AUTOUIC ?? -QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.ui ) +add_executable(dlt-parser main.cpp + mainwindow.cpp + mainwindow.ui + qdltparser.cpp) -#message( STATUS "UI_HEADERS=[${UI_HEADERS}]") +target_link_libraries(dlt-parser Qt5::Widgets) -add_executable(dlt-parser main.cpp - mainwindow.cpp - mainwindow.ui - qdltparser.cpp - ${UI_HEADERS}) +set_target_properties(dlt-parser PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + INSTALL_RPATH "$ORIGIN/../lib;$<$:${DLT_QT5_LIB_DIR}>") + + if(CMAKE_COMPILER_IS_GNUCXX) + # https://stackoverflow.com/questions/45329372/ubuntu-recognizes-executable-as-shared-library-and-wont-run-it-by-clicking + # https://forum.juce.com/t/cmake-executable-build-shows-up-as-shared-library-on-linux-mint/45503/6 + target_link_options(dlt-parser PRIVATE "-no-pie") +endif() -target_link_libraries(dlt-parser Qt5::Widgets -lstdc++) +install(TARGETS dlt-parser + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}" + # Underscore for NSIS compatibility https://gitlab.kitware.com/cmake/cmake/-/issues/19982 + COMPONENT dlt_parser) -install(TARGETS dlt-parser DESTINATION ${EXECUTABLE_INSTALLATION_PATH}) +install(FILES + ../ReleaseNotes_Parser.txt + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}" + COMPONENT dlt_parser) diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index 26828d0e..2d500ba8 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (C) 2016, Jack S. Smith -# +# # This file is part of GENIVI DLT-Viewer project. -# +# # This Source Code Form is subject to the terms of the # Mozilla Public License (MPL), v. 2.0. # If a copy of the MPL was not distributed with this file, @@ -13,36 +13,34 @@ # 01.Oct.2016, Jack Smith , Original Author # -# build plugins in build/bin/plugins directory -set(PLUGIN_DIR ${BIN_DIR}/plugins) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PLUGIN_DIR}) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}) - +set (CMAKE_AUTOMOC ON) +set (CMAKE_AUTOUIC ON) function(add_plugin NAME) - target_link_libraries(${NAME} qdlt Qt5::Widgets) - install(TARGETS ${NAME} DESTINATION ${PLUGIN_INSTALLATION_PATH}) - # set the location of the plugins in such a way that they can be located by the dlt-viewer executable when running in - # directly from the build folder (without "make install") set_target_properties(${NAME} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - ) + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/plugins + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/plugins + INSTALL_RPATH "$ORIGIN/../../lib;$<$:${DLT_QT5_LIB_DIR}>") + install(TARGETS ${NAME} + DESTINATION "${DLT_PLUGIN_INSTALLATION_PATH}" + COMPONENT ${NAME}) endfunction() - -add_subdirectory(dltviewerplugin) -add_subdirectory(nonverboseplugin) -add_subdirectory(filetransferplugin) -add_subdirectory(dltsystemviewerplugin) -add_subdirectory(dummycontrolplugin) -add_subdirectory(dummyviewerplugin) -add_subdirectory(dummycommandplugin) -add_subdirectory(dummydecoderplugin) add_subdirectory(dltdbusplugin) add_subdirectory(dltlogstorageplugin) +add_subdirectory(dltsystemviewerplugin) add_subdirectory(dlttestrobotplugin) +add_subdirectory(dltviewerplugin) +add_subdirectory(filetransferplugin) +add_subdirectory(nonverboseplugin) + +option(DLT_DUMMY_PLUGINS "Build Dummy plugins" OFF) +if(DLT_DUMMY_PLUGINS) + add_subdirectory(dummycontrolplugin) + add_subdirectory(dummyviewerplugin) + add_subdirectory(dummycommandplugin) + add_subdirectory(dummydecoderplugin) +endif() diff --git a/plugin/dltdbusplugin/CMakeLists.txt b/plugin/dltdbusplugin/CMakeLists.txt index 53da9f1f..ba61268f 100644 --- a/plugin/dltdbusplugin/CMakeLists.txt +++ b/plugin/dltdbusplugin/CMakeLists.txt @@ -13,13 +13,10 @@ # 01.Oct.2016, Jack Smith , Original Author # -# cmake 2.8.12 doesn't have AUTOUIC ?? -QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui ) - add_library(dltdbusplugin MODULE dltdbusplugin.cpp - form.cpp - dbus.cpp - ${UI_HEADERS}) + form.cpp + dbus.cpp + ${UI_HEADERS}) target_link_libraries(dltdbusplugin qdlt Qt5::Widgets ) diff --git a/plugin/dltlogstorageplugin/CMakeLists.txt b/plugin/dltlogstorageplugin/CMakeLists.txt index 436d0bb1..1a07fcb9 100644 --- a/plugin/dltlogstorageplugin/CMakeLists.txt +++ b/plugin/dltlogstorageplugin/CMakeLists.txt @@ -13,9 +13,6 @@ # 01.Oct.2016, Jack Smith , Original Author # -# cmake 2.8.12 doesn't have AUTOUIC ?? -QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/logstorageconfigcreatorform.ui ) - add_library(dltlogstorageplugin MODULE dltlogstorageconfigcreatorplugin.cpp logstorageconfigcreatorform.cpp logstoragefilter.cpp diff --git a/plugin/dltsystemviewerplugin/CMakeLists.txt b/plugin/dltsystemviewerplugin/CMakeLists.txt index feae1a23..5fa0fab0 100644 --- a/plugin/dltsystemviewerplugin/CMakeLists.txt +++ b/plugin/dltsystemviewerplugin/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (C) 2016, Jack S. Smith -# +# # This file is part of GENIVI DLT-Viewer project. -# +# # This Source Code Form is subject to the terms of the # Mozilla Public License (MPL), v. 2.0. # If a copy of the MPL was not distributed with this file, @@ -13,12 +13,10 @@ # 01.Oct.2016, Jack Smith , Original Author # -# cmake 2.8.12 doesn't have AUTOUIC ?? -QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui ) - -add_library(dltsystemviewerplugin MODULE dltsystemviewerplugin.cpp - form.cpp - ${UI_HEADERS}) +add_library(dltsystemviewerplugin MODULE + dltsystemviewerplugin.cpp + form.cpp + ${UI_HEADERS}) target_link_libraries(dltsystemviewerplugin qdlt Qt5::Widgets ) diff --git a/plugin/dlttestrobotplugin/CMakeLists.txt b/plugin/dlttestrobotplugin/CMakeLists.txt index f21a9884..4205f29d 100644 --- a/plugin/dlttestrobotplugin/CMakeLists.txt +++ b/plugin/dlttestrobotplugin/CMakeLists.txt @@ -14,10 +14,6 @@ # 01.Oct.2016, Jack Smith , Original Author # - -#cmake 2.8.12 doesn't have AUTOUIC ?? -QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui ) - add_library(dlttestrobotplugin MODULE dlttestrobotplugin.cpp form.cpp ${UI_HEADERS}) diff --git a/plugin/dltviewerplugin/CMakeLists.txt b/plugin/dltviewerplugin/CMakeLists.txt index d7e547d0..b3ff7160 100644 --- a/plugin/dltviewerplugin/CMakeLists.txt +++ b/plugin/dltviewerplugin/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (C) 2016, Jack S. Smith -# +# # This file is part of GENIVI DLT-Viewer project. -# +# # This Source Code Form is subject to the terms of the # Mozilla Public License (MPL), v. 2.0. # If a copy of the MPL was not distributed with this file, @@ -13,17 +13,9 @@ # 01.Oct.2016, Jack Smith , Original Author # -set (CMAKE_AUTOMOC ON) - -# cmake 2.8.12 doesn't have AUTOUIC ?? -QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui ) - -#message( STATUS "UI_HEADERS=[${UI_HEADERS}]") - -add_library(dltviewerplugin MODULE dltviewerplugin.cpp - form.cpp - ${UI_HEADERS}) - -target_link_libraries(dltviewerplugin qdlt Qt5::Widgets ) +add_library(dltviewerplugin MODULE + dltviewerplugin.cpp + form.cpp +) add_plugin(dltviewerplugin) diff --git a/plugin/dummycommandplugin/CMakeLists.txt b/plugin/dummycommandplugin/CMakeLists.txt index b3638581..4145a93e 100644 --- a/plugin/dummycommandplugin/CMakeLists.txt +++ b/plugin/dummycommandplugin/CMakeLists.txt @@ -1,8 +1,8 @@ # # Copyright (C) 2016, Jack S. Smith -# +# # This file is part of GENIVI DLT-Viewer project. -# +# # This Source Code Form is subject to the terms of the # Mozilla Public License (MPL), v. 2.0. # If a copy of the MPL was not distributed with this file, @@ -15,13 +15,10 @@ # # -# cmake 2.8.12 doesn't have AUTOUIC ?? -# QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui ) - -#message( STATUS "UI_HEADERS=[${UI_HEADERS}]") - -add_library(dummycommandplugin MODULE dummycommandplugin.cpp - ${UI_HEADERS}) +add_library(dummycommandplugin MODULE + dummycommandplugin.cpp + ${UI_HEADERS}) target_link_libraries(dummycommandplugin qdlt Qt5::Widgets ) + add_plugin(dummycommandplugin) diff --git a/plugin/dummycontrolplugin/CMakeLists.txt b/plugin/dummycontrolplugin/CMakeLists.txt index 1fff8981..8bb55523 100644 --- a/plugin/dummycontrolplugin/CMakeLists.txt +++ b/plugin/dummycontrolplugin/CMakeLists.txt @@ -14,13 +14,10 @@ # 01.Oct.2016, Jack Smith , Original Author # - -#cmake 2.8.12 doesn't have AUTOUIC ?? -QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui ) - add_library(dummycontrolplugin MODULE dummycontrolplugin.cpp form.cpp ${UI_HEADERS}) target_link_libraries(dummycontrolplugin qdlt Qt5::Widgets ) + add_plugin(dummycontrolplugin) diff --git a/plugin/dummydecoderplugin/CMakeLists.txt b/plugin/dummydecoderplugin/CMakeLists.txt index e6721664..4c121ba5 100644 --- a/plugin/dummydecoderplugin/CMakeLists.txt +++ b/plugin/dummydecoderplugin/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (C) 2016, Jack S. Smith -# +# # This file is part of GENIVI DLT-Viewer project. -# +# # This Source Code Form is subject to the terms of the # Mozilla Public License (MPL), v. 2.0. # If a copy of the MPL was not distributed with this file, @@ -13,11 +13,10 @@ # 01.Oct.2016, Jack Smith , Original Author # -# cmake 2.8.12 doesn't have AUTOUIC ?? -# QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui ) - -add_library(dummydecoderplugin MODULE dummydecoderplugin.cpp - ${UI_HEADERS}) +add_library(dummydecoderplugin MODULE + dummydecoderplugin.cpp + ${UI_HEADERS}) target_link_libraries(dummydecoderplugin qdlt Qt5::Widgets ) + add_plugin(dummydecoderplugin) diff --git a/plugin/dummyviewerplugin/CMakeLists.txt b/plugin/dummyviewerplugin/CMakeLists.txt index df90451e..954fee33 100644 --- a/plugin/dummyviewerplugin/CMakeLists.txt +++ b/plugin/dummyviewerplugin/CMakeLists.txt @@ -13,12 +13,11 @@ # 01.Oct.2016, Jack Smith , Original Author # -# cmake 2.8.12 doesn't have AUTOUIC ?? -QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui ) - -add_library(dummyviewerplugin MODULE dummyviewerplugin.cpp - form.cpp - ${UI_HEADERS}) +add_library(dummyviewerplugin MODULE + dummyviewerplugin.cpp + form.cpp + ${UI_HEADERS}) target_link_libraries(dummyviewerplugin qdlt Qt5::Widgets ) + add_plugin(dummyviewerplugin) diff --git a/plugin/filetransferplugin/CMakeLists.txt b/plugin/filetransferplugin/CMakeLists.txt index 016adc47..ef6ba8bf 100644 --- a/plugin/filetransferplugin/CMakeLists.txt +++ b/plugin/filetransferplugin/CMakeLists.txt @@ -13,18 +13,14 @@ # 01.Oct.2016, Jack Smith , Original Author # -# cmake 2.8.12 doesn't have AUTOUIC ?? -QT5_WRAP_UI( UI_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/form.ui - ${CMAKE_CURRENT_SOURCE_DIR}/imagepreviewdialog.ui - ${CMAKE_CURRENT_SOURCE_DIR}/textviewdialog.ui ) - -add_library(filetransferplugin MODULE filetransferplugin.cpp - form.cpp - file.cpp - imagepreviewdialog.cpp - textviewdialog.cpp - configuration.cpp - ${UI_HEADERS}) +add_library(filetransferplugin MODULE + filetransferplugin.cpp + form.cpp + file.cpp + imagepreviewdialog.cpp + textviewdialog.cpp + configuration.cpp + ${UI_HEADERS}) target_link_libraries(filetransferplugin qdlt Qt5::Widgets Qt5::PrintSupport ) diff --git a/plugin/nonverboseplugin/CMakeLists.txt b/plugin/nonverboseplugin/CMakeLists.txt index f23e5d0e..09ed874f 100644 --- a/plugin/nonverboseplugin/CMakeLists.txt +++ b/plugin/nonverboseplugin/CMakeLists.txt @@ -14,10 +14,9 @@ # 01.Oct.2016, Jack Smith , Original Author # -# cmake 2.8.12 doesn't have AUTOUIC ?? - -add_library(nonverboseplugin MODULE nonverboseplugin.cpp - ${UI_HEADERS}) +add_library(nonverboseplugin MODULE + nonverboseplugin.cpp + ${UI_HEADERS}) target_link_libraries(nonverboseplugin qdlt Qt5::Widgets ) diff --git a/qdlt/CMakeLists.txt b/qdlt/CMakeLists.txt index 0d5cf3e5..42a1d4f9 100644 --- a/qdlt/CMakeLists.txt +++ b/qdlt/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MPL-2.0 +# # Copyright (C) 2016, Jack S. Smith # # This file is part of GENIVI DLT-Viewer project. @@ -13,45 +15,81 @@ # 01.Oct.2016, Jack Smith , Original Author # -set(QDLT_LIBRARY_TYPE STATIC) +add_library(qdlt SHARED + dlt_common.c + qdltipconnection.cpp + qdlttcpconnection.cpp + qdltudpconnection.cpp + qdltserialconnection.cpp + qdltmsg.cpp + qdltfilter.cpp + qdltfile.cpp + qdltcontrol.cpp + qdltconnection.cpp + qdltbase.cpp + qdltargument.cpp + qdltfilterlist.cpp + qdltfilterindex.cpp + qdltdefaultfilter.cpp + qdltmessagedecoder.cpp + qdltpluginmanager.cpp + qdltplugin.cpp + qdltsegmentedmsg.cpp + qdltoptmanager.cpp + qdltsettingsmanager.cpp) + +target_compile_definitions(qdlt PRIVATE + BYTE_ORDER=LITTLE_ENDIAN + PLUGIN_INSTALLATION_PATH="${DLT_PLUGIN_INSTALLATION_PATH}") if(WIN32) -add_definitions(-DQDLT_LIBRARY) -set(QDLT_LIBRARY_TYPE SHARED) + target_compile_definitions(qdlt PRIVATE QDLT_LIBRARY QT_VIEWER) +else() + target_compile_definitions(qdlt PRIVATE _TTY_POSIX_ QT_VIEWER) endif() -add_library (qdlt ${QDLT_LIBRARY_TYPE} dlt_common.c - qdltipconnection.cpp - qdlttcpconnection.cpp - qdltudpconnection.cpp - qdltserialconnection.cpp - qdltmsg.cpp - qdltfilter.cpp - qdltfile.cpp - qdltcontrol.cpp - qdltconnection.cpp - qdltbase.cpp - qdltargument.cpp - qdltfilterlist.cpp - qdltfilterindex.cpp - qdltdefaultfilter.cpp - qdltmessagedecoder.cpp - qdltpluginmanager.cpp - qdltplugin.cpp - qdltsegmentedmsg.cpp - qdltoptmanager.cpp - qdltsettingsmanager.cpp) - -target_include_directories (qdlt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../src) - -#target_link_libraries(qdlt Qt5::Core Qt5::Network Qt5::SerialPort) -target_link_libraries(qdlt Qt5::Core Qt5::Network Qt5::Widgets Qt5::SerialPort -lstdc++) +target_include_directories(qdlt PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../src) + +target_link_libraries(qdlt PUBLIC + Qt5::Core + Qt5::Network + Qt5::Widgets + Qt5::SerialPort) if(WIN32) -set(QDLT_LINK_LIBS ${QDLT_LINK_LIBS} ws2_32) + target_link_libraries(qdlt PUBLIC ws2_32) endif() -target_link_libraries(qdlt ${QDLT_LINK_LIBS}) +set_target_properties(qdlt PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + INSTALL_RPATH "$ORIGIN;$<$:${DLT_QT5_LIB_DIR}>") + +install(TARGETS qdlt + LIBRARY DESTINATION "${DLT_LIBRARY_INSTALLATION_PATH}" + RUNTIME DESTINATION "${DLT_LIBRARY_INSTALLATION_PATH}" + COMPONENT qdlt) + +# Install QDLT SDK +install(TARGETS qdlt + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/sdk/lib" + COMPONENT qdlt_sdk) + +install(DIRECTORY "." + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/sdk/include" + COMPONENT qdlt_sdk + FILES_MATCHING PATTERN "*.h") + +set(SDK_EXAMPLES + dummycommandplugin + dummycontrolplugin + dummydecoderplugin + dummyviewerplugin) -install(TARGETS qdlt DESTINATION ${LIBRARY_INSTALLATION_PATH}) +foreach(SDK_EXAMPLE IN ITEMS ${SDK_EXAMPLES}) + install(DIRECTORY "../plugin/${SDK_EXAMPLE}" + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/sdk/src" + COMPONENT qdlt_sdk) +endforeach() diff --git a/qdlt/qdltpluginmanager.cpp b/qdlt/qdltpluginmanager.cpp index 90040bf9..6098e62f 100644 --- a/qdlt/qdltpluginmanager.cpp +++ b/qdlt/qdltpluginmanager.cpp @@ -34,35 +34,39 @@ int QDltPluginManager::sizeEnabled() const } QStringList QDltPluginManager::loadPlugins(const QString &settingsPluginPath) { - QDir pluginsDir; + QDir pluginsDir1; + QDir pluginsDir2; + QDir pluginsDir3; QStringList errorStrings; QString defaultPluginPath = PLUGIN_INSTALLATION_PATH; - /* The viewer looks in the relativ to the executable in the ./plugins directory */ - pluginsDir.setPath(QCoreApplication::applicationDirPath()); - if(pluginsDir.cd("plugins")) + /* The viewer always looks in the relative to the executable in the ./plugins directory */ + pluginsDir1.setPath(QCoreApplication::applicationDirPath()); + if(pluginsDir1.cd("plugins")) { - errorStrings << loadPluginsPath(pluginsDir); + errorStrings << loadPluginsPath(pluginsDir1); } /* Check system plugins path */ if(!defaultPluginPath.isEmpty()) { - pluginsDir.setPath(defaultPluginPath); - if(pluginsDir.exists()) + pluginsDir2.setPath(defaultPluginPath); + if(pluginsDir2.exists() && pluginsDir2.canonicalPath() != pluginsDir1.canonicalPath()) { - errorStrings << loadPluginsPath(pluginsDir); + errorStrings << loadPluginsPath(pluginsDir2); } } /* load plugins form settings path if set */ if(!settingsPluginPath.isEmpty()) { - pluginsDir.setPath(settingsPluginPath); - if(pluginsDir.exists() && pluginsDir.isReadable()) + pluginsDir3.setPath(settingsPluginPath); + if(pluginsDir3.exists() && pluginsDir3.isReadable() + && pluginsDir3.canonicalPath() != pluginsDir1.canonicalPath() + && pluginsDir3.canonicalPath() != pluginsDir2.canonicalPath()) { - errorStrings << loadPluginsPath(pluginsDir); + errorStrings << loadPluginsPath(pluginsDir3); } } diff --git a/scripts/build.sh b/scripts/build.sh index 0afa5679..f7c7e828 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,15 +1,30 @@ -#!/bin/bash +#!/usr/bin/env bash +set -ex -if [[ "$(uname -s)" == 'Darwin' ]]; then +PLATFORM=$(uname -s) +if [[ "${PLATFORM}" == "Darwin" ]]; then readonly Qt5_DIR="/usr/local/opt/qt" +elif [[ "${PLATFORM}" == "Linux" ]]; then + # https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.12.10-bionic + source /opt/qt512/bin/qt512-env.sh || true fi mkdir build cd build # Building with CMake -cmake ../ -make +cmake -G Ninja \ + -DCMAKE_INSTALL_PREFIX=DLTViewer \ + -DCMAKE_PREFIX_PATH=/opt/qt512/lib/cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DDLT_USE_QT_RPATH=ON \ + -DDLT_PARSER=OFF \ + -DDLT_LIBRARY_INSTALLATION_PATH="usr/lib" \ + -DDLT_EXECUTABLE_INSTALLATION_PATH="usr/bin" \ + -DDLT_RESOURCE_INSTALLATION_PATH="usr/share" \ + -DDLT_PLUGIN_INSTALLATION_PATH="usr/bin/plugins" .. +cmake --build . -v +cmake --install . --prefix "./DLTViewer" # Cleanup rm -rf * diff --git a/scripts/install.sh b/scripts/install.sh index a3d627c2..998a001c 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,8 +1,47 @@ -#!/bin/bash +#!/usr/bin/env bash +set -ex + +id +env +pwd if [[ "$(uname -s)" == 'Darwin' ]]; then + brew install qt@5 brew link qt@5 --force + # https://github.com/Homebrew/homebrew-core/issues/8392 + # https://github.com/Homebrew/legacy-homebrew/issues/29938 + QT_VERSION=$(brew list --versions qt@5 | sed -n '/qt@5/s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*.*\).*$/\1/p') + sudo ln -s "/usr/local/Cellar/qt@5/${QT_VERSION}/mkspecs" /usr/local/mkspecs + sudo ln -s "/usr/local/Cellar/qt@5/${QT_VERSION}/plugins" /usr/local/plugins + + brew install ninja else - sudo apt-get update - sudo apt-get install -y build-essential qt5-default libqt5serialport5-dev + sudo apt update + sudo apt-get install -y --no-install-recommends apt-utils + sudo apt install -y wget unzip software-properties-common lsb-release openssh-client curl + + # QT 5.12.10, is installed into /opt/qt512/ + sudo touch /etc/apt/sources.list + sudo add-apt-repository -y ppa:beineri/opt-qt-5.12.10-$(lsb_release -cs) + + # Latest cmake for current platform + sudo wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null + sudo apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" + + # GCC 11 + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + + sudo apt update + sudo apt install -y git cmake build-essential ninja-build \ + qt512declarative qt512serialport qt512charts-no-lgpl qt512svg \ + libgtk2.0-dev libgl-dev gcc-11 g++-11 + + sudo update-alternatives --remove-all cpp + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 --slave /usr/bin/cpp cpp /usr/bin/cpp-11; + + sudo gcc --version && g++ --version && gcov --version + sudo update-alternatives --config gcc + + # https://askubuntu.com/questions/616065/the-imported-target-qt5gui-references-the-file-usr-lib-x86-64-linux-gnu-li + sudo ln -f /usr/lib/x86_64-linux-gnu/libEGL.so.1 /usr/lib/x86_64-linux-gnu/libEGL.so fi diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4321b02e..0c15acff 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (C) 2016, Jack S. Smith -# +# # This file is part of GENIVI DLT-Viewer project. -# +# # This Source Code Form is subject to the terms of the # Mozilla Public License (MPL), v. 2.0. # If a copy of the MPL was not distributed with this file, @@ -11,19 +11,10 @@ # # List of changes: # 01.Oct.2016, Jack Smith , Original Author -# - -cmake_minimum_required (VERSION 2.8.12) -set (TARGET_NAME dlt-viewer) +QT5_ADD_RESOURCES(UI_RESOURCES_RCC resources/resource.qrc) -# cmake 2.8.12 doesn't have AUTOUIC ?? -FILE(GLOB ALL_UIS ${CMAKE_CURRENT_SOURCE_DIR}/*.ui) -QT5_WRAP_UI( UI_HEADERS ${ALL_UIS} ) - -QT5_ADD_RESOURCES(UI_RESOURCES_RCC resource.qrc) - -add_executable (${TARGET_NAME} +add_executable(dlt-viewer main.cpp mainwindow.cpp project.cpp @@ -54,21 +45,49 @@ add_executable (${TARGET_NAME} dltfileindexerthread.cpp dltfileindexerdefaultfilterthread.cpp mcudpsocket.cpp - resource.qrc - ${UI_HEADERS} ${UI_RESOURCES_RCC} -) + resources/dlt_viewer.rc) -target_link_libraries (${TARGET_NAME} +target_link_libraries(dlt-viewer qdlt Qt5::Core Qt5::Network Qt5::Widgets - Qt5::SerialPort -) + Qt5::SerialPort) + +if(CMAKE_COMPILER_IS_GNUCXX) + # https://stackoverflow.com/questions/45329372/ubuntu-recognizes-executable-as-shared-library-and-wont-run-it-by-clicking + # https://forum.juce.com/t/cmake-executable-build-shows-up-as-shared-library-on-linux-mint/45503/6 + target_link_options(dlt-viewer PRIVATE "-no-pie") +endif() + +set_target_properties(dlt-viewer PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + INSTALL_RPATH "$ORIGIN/../lib;$<$:${DLT_QT5_LIB_DIR}>") -install(TARGETS ${TARGET_NAME} DESTINATION ${EXECUTABLE_INSTALLATION_PATH}) -install(DIRECTORY icon png svg DESTINATION ${RESOURCE_INSTALLATION_PATH} - PATTERN icon/*.rc EXCLUDE ) +install(TARGETS dlt-viewer + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}" + # Underscore for NSIS compatibility https://gitlab.kitware.com/cmake/cmake/-/issues/19982 + COMPONENT dlt_viewer) -include (${CMAKE_SYSTEM_NAME}.cmake OPTIONAL) +install(FILES + ../LICENSE.txt + ../MPL.txt + ../README.md + ../ReleaseNotes_Viewer.txt + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}" + COMPONENT dlt_viewer) +install(FILES + ../doc/dlt_viewer_user_manual.pdf + ../doc/dlt_viewer_plugins_programming_guide.pdf + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/doc" + COMPONENT documentation) +install(DIRECTORY + ../filters + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}" + COMPONENT dlt_viewer) +install(DIRECTORY + ../plugin/examples + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/plugins" + COMPONENT dlt_viewer) +include(cmake/${CMAKE_SYSTEM_NAME}.cmake OPTIONAL) diff --git a/src/Darwin.cmake b/src/cmake/Darwin.cmake similarity index 59% rename from src/Darwin.cmake rename to src/cmake/Darwin.cmake index 8acc2ecf..a06da2d3 100644 --- a/src/Darwin.cmake +++ b/src/cmake/Darwin.cmake @@ -1,31 +1,28 @@ # set some properties for the bundle Info.plist file set (MACOSX_BUNDLE_BUNDLE_NAME "DLT Viewer" ) -set (MACOSX_BUNDLE_SHORT_VERSION_STRING "2.19.0" ) +set (MACOSX_BUNDLE_SHORT_VERSION_STRING ${PACKAGE_VERSION} ) set (MACOSX_BUNDLE_GUI_IDENTIFIER "org.genivi.dlt-viewer") set (MACOSX_BUNDLE_ICON_FILE icon) # configure the bundle icon file -set (ICON icon/icon.icns) +set (ICON resources/icon/icon.icns) set_property (SOURCE ${ICON} PROPERTY MACOSX_PACKAGE_LOCATION Resources) -target_sources (${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${ICON}) +target_sources (dlt-viewer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${ICON}) # set the executable target to be built as macOS app bundle -set_target_properties (${TARGET_NAME} PROPERTIES +set_target_properties (dlt-viewer PROPERTIES MACOSX_BUNDLE True - OUTPUT_NAME "DLT Viewer" -) + OUTPUT_NAME "DLT Viewer") # get the path for the macdeployqt tool get_target_property(MOC_LOCATION Qt5::moc LOCATION) get_filename_component(MAC_DEPLOY_TOOL ${MOC_LOCATION}/../macdeployqt ABSOLUTE) # convert the target into a self contained app bundle -add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND ${MAC_DEPLOY_TOOL} $/../.. -always-overwrite -) +add_custom_command(TARGET dlt-viewer POST_BUILD + COMMAND ${MAC_DEPLOY_TOOL} $/../.. -always-overwrite) # enable high-DPI displays support -add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND plutil -replace NSPrincipalClass -string NSApplication $/../Info.plist - COMMAND plutil -replace NSHighResolutionCapable -bool true $/../Info.plist -) +add_custom_command(TARGET dlt-viewer POST_BUILD + COMMAND plutil -replace NSPrincipalClass -string NSApplication $/../Info.plist + COMMAND plutil -replace NSHighResolutionCapable -bool true $/../Info.plist) diff --git a/src/cmake/Linux.cmake b/src/cmake/Linux.cmake new file mode 100644 index 00000000..5a34d975 --- /dev/null +++ b/src/cmake/Linux.cmake @@ -0,0 +1,32 @@ +# install(DIRECTORY +# resources/icon/ +# COMPONENT dlt_viewer +# DESTINATION "${DLT_RESOURCE_INSTALLATION_PATH}/icons" +# PATTERN resources/icon/*.rc EXCLUDE) + +# https://docs.appimage.org/reference/appdir.html#root-icon +install(FILES + "resources/icon/256x256/org.genivi.DLTViewer.png" + DESTINATION "${DLT_RESOURCE_INSTALLATION_PATH}/icons/hicolor/256x256/apps/" + RENAME "dlt-viewer.png" + COMPONENT dlt_viewer) +install(FILES + "resources/icon/256x256/org.genivi.DLTViewer.png" + DESTINATION "." + RENAME ".DirIcon" + COMPONENT dlt_viewer) +install(FILES + "resources/icon/256x256/org.genivi.DLTViewer.png" + DESTINATION "." + RENAME "dlt-viewer.png" + COMPONENT dlt_viewer) + + +install(PROGRAMS + "resources/dlt-viewer.desktop" + DESTINATION "${DLT_RESOURCE_INSTALLATION_PATH}/applications" + COMPONENT dlt_viewer) +install(PROGRAMS + "resources/dlt-viewer.desktop" + DESTINATION "." + COMPONENT dlt_viewer) diff --git a/src/cmake/Windows.cmake b/src/cmake/Windows.cmake new file mode 100644 index 00000000..0460d52a --- /dev/null +++ b/src/cmake/Windows.cmake @@ -0,0 +1,50 @@ +set(QT_LIBS + Qt5::Core + Qt5::Gui + Qt5::Network + Qt5::PrintSupport + Qt5::SerialPort + Qt5::Widgets) + +foreach(QT_LIB IN ITEMS ${QT_LIBS}) + get_target_property(LIBRARY_PATH ${QT_LIB} LOCATION) + install(FILES + "${LIBRARY_PATH}" + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}" + COMPONENT qt_libraries) +endforeach() + +install(FILES + "${DLT_QT5_LIB_DIR}/../plugins/bearer/qgenericbearer.dll" + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/bearer" + COMPONENT qt_libraries) +install(FILES + "${DLT_QT5_LIB_DIR}/../plugins/iconengines/qsvgicon.dll" + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/iconengines" + COMPONENT qt_libraries) +install(FILES + "${DLT_QT5_LIB_DIR}/../plugins/platforms/qwindows.dll" + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/platforms" + COMPONENT qt_libraries) +install(FILES + "${DLT_QT5_LIB_DIR}/../plugins/imageformats/qico.dll" + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/imageformats" + COMPONENT qt_libraries) +install(FILES + "${DLT_QT5_LIB_DIR}/../plugins/printsupport/windowsprintersupport.dll" + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/printsupport" + COMPONENT qt_libraries) +install(FILES + "${DLT_QT5_LIB_DIR}/../plugins/styles/qwindowsvistastyle.dll" + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}/styles" + COMPONENT qt_libraries) + +option(INCLUDE_VC_REDIST "Add vc_redist.x64.exe cmake install command" OFF) +if(INCLUDE_VC_REDIST) + get_filename_component(MSVC_COMPILER_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY ) + set(VC_REDIST_PATH "${MSVC_COMPILER_DIR}/../../../../../../Redist/MSVC/v${MSVC_TOOLSET_VERSION}/vc_redist.x64.exe") + install(FILES + "${VC_REDIST_PATH}" + DESTINATION "${DLT_EXECUTABLE_INSTALLATION_PATH}" + COMPONENT vc_redist_x64) +endif() \ No newline at end of file diff --git a/src/icon/dlt_viewer.rc b/src/icon/dlt_viewer.rc deleted file mode 100755 index 835a867d..00000000 --- a/src/icon/dlt_viewer.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "org.genivi.DLTViewer.ico" diff --git a/src/main.cpp b/src/main.cpp old mode 100755 new mode 100644 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp old mode 100755 new mode 100644 index 9f9cc97f..a6d06fd4 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1628,7 +1628,7 @@ void MainWindow::contextLoadingFile(QDltMsg &msg) void MainWindow::reloadLogFileStop() { - + } void MainWindow::reloadLogFileProgressMax(int num) @@ -2174,7 +2174,7 @@ QStringList MainWindow::getAvailableSerialPorts() QList ports = QSerialPortInfo::availablePorts(); QStringList portList; - for (int i = 0; i < ports.size(); i++) + for (int i = 0; i < ports.size(); i++) { portList << ports.at(i).portName(); } @@ -3794,7 +3794,7 @@ void MainWindow::updateIndex() item = activeViewerPlugins.at(i); item->updateMsg(num,qmsg); } - } + } if ( true == pluginsEnabled ) // we check the general plugin enabled/disabled switch { @@ -3813,7 +3813,7 @@ void MainWindow::updateIndex() item = activeViewerPlugins[i]; item->updateMsgDecoded(num,qmsg); } - } + } } if (!draw_timer.isActive()) diff --git a/src/resources/dlt-viewer.desktop b/src/resources/dlt-viewer.desktop new file mode 100644 index 00000000..c67dfe83 --- /dev/null +++ b/src/resources/dlt-viewer.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=DLT Viewer +Comment=DLT Viewer with plugins +Terminal=false +Exec=dlt-viewer +Icon=dlt-viewer +Categories=Office; \ No newline at end of file diff --git a/src/resources/dlt_viewer.rc b/src/resources/dlt_viewer.rc new file mode 100644 index 00000000..516946c7 --- /dev/null +++ b/src/resources/dlt_viewer.rc @@ -0,0 +1,48 @@ +// MSVC, Windows SDK +#if defined(_WIN32) + +IDI_ICON1 ICON DISCARDABLE "icon\org.genivi.DLTViewer.ico" + +#include "../version.h" + +#define STRINGIFY(x) #x +#define TOSTRING(x) STRINGIFY(x) + +#include + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +VS_VERSION_INFO VERSIONINFO + FILEVERSION PACKAGE_MAJOR_VERSION,PACKAGE_MINOR_VERSION,PACKAGE_PATCH_LEVEL,0 + PRODUCTVERSION PACKAGE_MAJOR_VERSION,PACKAGE_MINOR_VERSION,PACKAGE_PATCH_LEVEL,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000904b0" + BEGIN + VALUE "FileDescription", PACKAGE_DESCRIPTION + VALUE "LegalCopyright", "Copyright (c) BMW AG" + VALUE "FileVersion", TOSTRING(PACKAGE_MAJOR_VERSION) "." TOSTRING(PACKAGE_MINOR_VERSION) "." TOSTRING(PACKAGE_PATCH_LEVEL) ".0" +/* + VALUE "InternalName", PRODUCT_INTERNAL_NAME + VALUE "OriginalFilename", PRODUCT_ORIGINAL_FILENAME +*/ + VALUE "ProductName", PACKAGE_DESCRIPTION + VALUE "ProductVersion", TOSTRING(PACKAGE_MAJOR_VERSION) "." TOSTRING(PACKAGE_MINOR_VERSION) "." TOSTRING(PACKAGE_PATCH_LEVEL) ".0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END +#endif diff --git a/src/icon/16x16/org.genivi.DLTViewer.png b/src/resources/icon/16x16/org.genivi.DLTViewer.png similarity index 100% rename from src/icon/16x16/org.genivi.DLTViewer.png rename to src/resources/icon/16x16/org.genivi.DLTViewer.png diff --git a/src/icon/22x22/org.genivi.DLTViewer.png b/src/resources/icon/22x22/org.genivi.DLTViewer.png similarity index 100% rename from src/icon/22x22/org.genivi.DLTViewer.png rename to src/resources/icon/22x22/org.genivi.DLTViewer.png diff --git a/src/icon/24x24/org.genivi.DLTViewer.png b/src/resources/icon/24x24/org.genivi.DLTViewer.png similarity index 100% rename from src/icon/24x24/org.genivi.DLTViewer.png rename to src/resources/icon/24x24/org.genivi.DLTViewer.png diff --git a/src/icon/256x256/org.genivi.DLTViewer.png b/src/resources/icon/256x256/org.genivi.DLTViewer.png similarity index 100% rename from src/icon/256x256/org.genivi.DLTViewer.png rename to src/resources/icon/256x256/org.genivi.DLTViewer.png diff --git a/src/icon/32x32/org.genivi.DLTViewer.png b/src/resources/icon/32x32/org.genivi.DLTViewer.png similarity index 100% rename from src/icon/32x32/org.genivi.DLTViewer.png rename to src/resources/icon/32x32/org.genivi.DLTViewer.png diff --git a/src/icon/48x48/org.genivi.DLTViewer.png b/src/resources/icon/48x48/org.genivi.DLTViewer.png similarity index 100% rename from src/icon/48x48/org.genivi.DLTViewer.png rename to src/resources/icon/48x48/org.genivi.DLTViewer.png diff --git a/src/icon/icon.icns b/src/resources/icon/icon.icns similarity index 100% rename from src/icon/icon.icns rename to src/resources/icon/icon.icns diff --git a/src/icon/org.genivi.DLTViewer.ico b/src/resources/icon/org.genivi.DLTViewer.ico old mode 100755 new mode 100644 similarity index 100% rename from src/icon/org.genivi.DLTViewer.ico rename to src/resources/icon/org.genivi.DLTViewer.ico diff --git a/src/icon/symbolic/org.genivi.DLTViewer-symbolic.svg b/src/resources/icon/symbolic/org.genivi.DLTViewer-symbolic.svg similarity index 100% rename from src/icon/symbolic/org.genivi.DLTViewer-symbolic.svg rename to src/resources/icon/symbolic/org.genivi.DLTViewer-symbolic.svg diff --git a/src/png/action-regexp.png b/src/resources/png/action-regexp.png similarity index 100% rename from src/png/action-regexp.png rename to src/resources/png/action-regexp.png diff --git a/src/png/action-searchlist.png b/src/resources/png/action-searchlist.png similarity index 100% rename from src/png/action-searchlist.png rename to src/resources/png/action-searchlist.png diff --git a/src/png/bookmark-new.png b/src/resources/png/bookmark-new.png similarity index 100% rename from src/png/bookmark-new.png rename to src/resources/png/bookmark-new.png diff --git a/src/png/colorize-2.png b/src/resources/png/colorize-2.png similarity index 100% rename from src/png/colorize-2.png rename to src/resources/png/colorize-2.png diff --git a/src/png/colorize-2_g.png b/src/resources/png/colorize-2_g.png similarity index 100% rename from src/png/colorize-2_g.png rename to src/resources/png/colorize-2_g.png diff --git a/src/png/dialog-error-3.png b/src/resources/png/dialog-error-3.png similarity index 100% rename from src/png/dialog-error-3.png rename to src/resources/png/dialog-error-3.png diff --git a/src/png/dialog-error-3_g.png b/src/resources/png/dialog-error-3_g.png similarity index 100% rename from src/png/dialog-error-3_g.png rename to src/resources/png/dialog-error-3_g.png diff --git a/src/png/document-new.png b/src/resources/png/document-new.png similarity index 100% rename from src/png/document-new.png rename to src/resources/png/document-new.png diff --git a/src/png/document-open-recent-2.png b/src/resources/png/document-open-recent-2.png similarity index 100% rename from src/png/document-open-recent-2.png rename to src/resources/png/document-open-recent-2.png diff --git a/src/png/document-open-recent-2_gray.png b/src/resources/png/document-open-recent-2_gray.png similarity index 100% rename from src/png/document-open-recent-2_gray.png rename to src/resources/png/document-open-recent-2_gray.png diff --git a/src/png/document-open.png b/src/resources/png/document-open.png similarity index 100% rename from src/png/document-open.png rename to src/resources/png/document-open.png diff --git a/src/png/document-save-as.png b/src/resources/png/document-save-as.png similarity index 100% rename from src/png/document-save-as.png rename to src/resources/png/document-save-as.png diff --git a/src/png/document-save-as2.png b/src/resources/png/document-save-as2.png similarity index 100% rename from src/png/document-save-as2.png rename to src/resources/png/document-save-as2.png diff --git a/src/png/document-save-as3.png b/src/resources/png/document-save-as3.png similarity index 100% rename from src/png/document-save-as3.png rename to src/resources/png/document-save-as3.png diff --git a/src/png/edit-clear.png b/src/resources/png/edit-clear.png similarity index 100% rename from src/png/edit-clear.png rename to src/resources/png/edit-clear.png diff --git a/src/png/edit-cut.png b/src/resources/png/edit-cut.png similarity index 100% rename from src/png/edit-cut.png rename to src/resources/png/edit-cut.png diff --git a/src/png/go-bottom.png b/src/resources/png/go-bottom.png similarity index 100% rename from src/png/go-bottom.png rename to src/resources/png/go-bottom.png diff --git a/src/png/go-next.png b/src/resources/png/go-next.png similarity index 100% rename from src/png/go-next.png rename to src/resources/png/go-next.png diff --git a/src/png/go-previous.png b/src/resources/png/go-previous.png similarity index 100% rename from src/png/go-previous.png rename to src/resources/png/go-previous.png diff --git a/src/png/network-offline.png b/src/resources/png/network-offline.png similarity index 100% rename from src/png/network-offline.png rename to src/resources/png/network-offline.png diff --git a/src/png/network-transmit-receive.png b/src/resources/png/network-transmit-receive.png similarity index 100% rename from src/png/network-transmit-receive.png rename to src/resources/png/network-transmit-receive.png diff --git a/src/png/network-transmit-receive_connected.png b/src/resources/png/network-transmit-receive_connected.png similarity index 100% rename from src/png/network-transmit-receive_connected.png rename to src/resources/png/network-transmit-receive_connected.png diff --git a/src/png/network-transmit-receive_disconnected.png b/src/resources/png/network-transmit-receive_disconnected.png similarity index 100% rename from src/png/network-transmit-receive_disconnected.png rename to src/resources/png/network-transmit-receive_disconnected.png diff --git a/src/png/preferences-desktop.png b/src/resources/png/preferences-desktop.png similarity index 100% rename from src/png/preferences-desktop.png rename to src/resources/png/preferences-desktop.png diff --git a/src/png/system-search.png b/src/resources/png/system-search.png similarity index 100% rename from src/png/system-search.png rename to src/resources/png/system-search.png diff --git a/src/png/view-filter_32_off.png b/src/resources/png/view-filter_32_off.png similarity index 100% rename from src/png/view-filter_32_off.png rename to src/resources/png/view-filter_32_off.png diff --git a/src/png/view-filter_32_on.png b/src/resources/png/view-filter_32_on.png similarity index 100% rename from src/png/view-filter_32_on.png rename to src/resources/png/view-filter_32_on.png diff --git a/src/png/view-filter_32_on_g.png b/src/resources/png/view-filter_32_on_g.png similarity index 100% rename from src/png/view-filter_32_on_g.png rename to src/resources/png/view-filter_32_on_g.png diff --git a/src/png/weather-clear.png b/src/resources/png/weather-clear.png similarity index 100% rename from src/png/weather-clear.png rename to src/resources/png/weather-clear.png diff --git a/src/png/weather-overcast.png b/src/resources/png/weather-overcast.png similarity index 100% rename from src/png/weather-overcast.png rename to src/resources/png/weather-overcast.png diff --git a/src/png/weather-storm.png b/src/resources/png/weather-storm.png similarity index 100% rename from src/png/weather-storm.png rename to src/resources/png/weather-storm.png diff --git a/src/png/x-kde-nsplugin-generated.png b/src/resources/png/x-kde-nsplugin-generated.png similarity index 100% rename from src/png/x-kde-nsplugin-generated.png rename to src/resources/png/x-kde-nsplugin-generated.png diff --git a/src/png/x-kde-nsplugin-generated_gray.png b/src/resources/png/x-kde-nsplugin-generated_gray.png similarity index 100% rename from src/png/x-kde-nsplugin-generated_gray.png rename to src/resources/png/x-kde-nsplugin-generated_gray.png diff --git a/src/resource.qrc b/src/resources/resource.qrc similarity index 100% rename from src/resource.qrc rename to src/resources/resource.qrc diff --git a/src/svg/action_regexp.svg b/src/resources/svg/action_regexp.svg similarity index 100% rename from src/svg/action_regexp.svg rename to src/resources/svg/action_regexp.svg diff --git a/src/resources/version.rc b/src/resources/version.rc new file mode 100644 index 00000000..930fae61 --- /dev/null +++ b/src/resources/version.rc @@ -0,0 +1,46 @@ +// MSVC, Windows SDK +#if defined(_WIN32) + +#include "../version.h" + +#define STRINGIFY(x) #x +#define TOSTRING(x) STRINGIFY(x) + +#include + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +VS_VERSION_INFO VERSIONINFO + FILEVERSION PACKAGE_MAJOR_VERSION,PACKAGE_MINOR_VERSION,PACKAGE_PATCH_LEVEL,0 + PRODUCTVERSION PACKAGE_MAJOR_VERSION,PACKAGE_MINOR_VERSION,PACKAGE_PATCH_LEVEL,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000904b0" + BEGIN + VALUE "FileDescription", PACKAGE_DESCRIPTION + VALUE "LegalCopyright", "Copyright (c) BMW AG" + VALUE "FileVersion", TOSTRING(PACKAGE_MAJOR_VERSION) "." TOSTRING(PACKAGE_MINOR_VERSION) "." TOSTRING(PACKAGE_PATCH_LEVEL) ".0" +/* + VALUE "InternalName", PRODUCT_INTERNAL_NAME + VALUE "OriginalFilename", PRODUCT_ORIGINAL_FILENAME +*/ + VALUE "ProductName", PACKAGE_DESCRIPTION + VALUE "ProductVersion", TOSTRING(PACKAGE_MAJOR_VERSION) "." TOSTRING(PACKAGE_MINOR_VERSION) "." TOSTRING(PACKAGE_PATCH_LEVEL) ".0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END +#endif diff --git a/src/src.pro b/src/src.pro index 372b5e23..e03aa375 100644 --- a/src/src.pro +++ b/src/src.pro @@ -209,10 +209,10 @@ OTHER_FILES += \ ../ReleaseNotes_Viewer.txt \ # This contains all the button graphics for toolbar -RESOURCES += resource.qrc +RESOURCES += resources/resource.qrc -# Instructions to compile the icon. -RC_FILE = icon/dlt_viewer.rc +# Instructions to compile resources. +RC_FILE = resources/dlt_viewer.rc DISTFILES += \ ../build_qwt_windows_qt5_MSVC.bat diff --git a/src/version.h b/src/version.h index af172f45..989c734d 100644 --- a/src/version.h +++ b/src/version.h @@ -24,11 +24,12 @@ /* this kind of change is tracked in the settings dialogr */ /* for other bugfixes and not major feature enhancement just use patch level */ #define PACKAGE_VERSION_STATE "release" -#define PACKAGE_MAJOR_VERSION "2" -#define PACKAGE_MINOR_VERSION "21" -#define PACKAGE_PATCH_LEVEL "3" +#define PACKAGE_MAJOR_VERSION 2 +#define PACKAGE_MINOR_VERSION 21 +#define PACKAGE_PATCH_LEVEL 3 #define PACKAGE_VERSION "2.21.3" #define PACKAGE_REVISION "" +#define PACKAGE_DESCRIPTION "DLT Viewer" #define DLT_SUPPORT_MAIL_ADDRESS "genivi-diagnostic-log-and-trace@lists.genivi.org" #define DLT_SUPPORT_NAME "GENIVI" #endif