Commit d59e64c8ef4ec2f20aac6777306952efc6c454b8
1 parent
eec3aa3f
Master branch uses cmake now for building
Showing
8 changed files
with
269 additions
and
220 deletions
.travis.yml
| 1 | 1 | language: cpp |
| 2 | 2 | |
| 3 | -compiler: | |
| 4 | - - clang | |
| 5 | - - gcc | |
| 6 | - | |
| 7 | 3 | sudo: required |
| 4 | +dist: trusty | |
| 8 | 5 | |
| 9 | -services: | |
| 10 | - - docker | |
| 6 | +compiler: | |
| 7 | + - gcc | |
| 8 | + - clang | |
| 11 | 9 | |
| 12 | 10 | os: |
| 13 | - - linux | |
| 14 | 11 | - osx |
| 15 | - | |
| 16 | -matrix: | |
| 17 | - allow_failures: | |
| 18 | - - os: osx | |
| 12 | + - linux | |
| 19 | 13 | |
| 20 | 14 | addons: |
| 21 | 15 | apt: |
| 22 | - packages: | |
| 16 | + sources: | |
| 17 | + - ubuntu-toolchain-r-test | |
| 18 | + - llvm-toolchain-trusty-3.6 | |
| 19 | + packages: &native_deps | |
| 23 | 20 | - cmake |
| 24 | 21 | - qttools5-dev |
| 22 | + - qttools5-dev-tools | |
| 25 | 23 | - libusb-1.0-0-dev |
| 26 | 24 | - libfftw3-dev |
| 27 | 25 | - libqt5qml5 |
| 28 | 26 | - doxygen |
| 27 | + - gcc-5 | |
| 28 | + - g++-5 | |
| 29 | + - clang-3.6 | |
| 30 | + | |
| 31 | +# We construct a build matrix for two operating systems (linux, osx) and two compilers (gcc, clang) | |
| 32 | +matrix: | |
| 33 | + exclude: | |
| 34 | + - os: osx | |
| 35 | + compiler: | |
| 36 | + - gcc | |
| 37 | +# fast_finish: true | |
| 38 | + allow_failures: | |
| 39 | + - os: osx | |
| 29 | 40 | |
| 30 | 41 | before_install: |
| 31 | - - sudo apt-get install -qq qt5-default qttools5-dev-tools libqt5opengl5-dev | |
| 42 | + - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo apt-get install -qq libqt5opengl5-dev; fi | |
| 43 | + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew install libusb fftw qt5; fi | |
| 32 | 44 | |
| 33 | 45 | before_script: |
| 46 | + - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "gcc" ]]; then export CXX="g++-5" CC="gcc-5"; fi | |
| 47 | + - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then export CXX="clang++-3.6" CC="clang-3.6"; fi | |
| 34 | 48 | - mkdir build |
| 35 | 49 | - cd build |
| 36 | 50 | - cmake ../ |
| 37 | 51 | |
| 38 | 52 | script: |
| 39 | - - if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$CC" = "gcc" ]; then export CC=gcc-4.8; fi | |
| 40 | 53 | - make |
| 41 | 54 | |
| 42 | 55 | before_deploy: |
| ... | ... | @@ -54,4 +67,4 @@ deploy: |
| 54 | 67 | - packages/OpenHantek-Release.sh |
| 55 | 68 | - packages/OpenHantek-Release.zip |
| 56 | 69 | on: |
| 57 | 70 | - repo: OpenHantek/openhantek |
| 71 | + repo: OpenHantek/openhantek | |
| 58 | 72 | \ No newline at end of file | ... | ... |
CMakeLists.txt
0 → 100644
| 1 | +# We need cmake 3.0 for Qt AUTORCC | |
| 2 | +cmake_minimum_required(VERSION 3.0 FATAL_ERROR) | |
| 3 | +project(OpenHantekProject) | |
| 4 | + | |
| 5 | +# Default build type | |
| 6 | +IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) | |
| 7 | + SET(CMAKE_BUILD_TYPE RelWithDebInfo) | |
| 8 | +ENDIF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) | |
| 9 | + | |
| 10 | +# Select flags | |
| 11 | +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") # -Wfatal-errors | |
| 12 | +SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-rtti") | |
| 13 | +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -O0") | |
| 14 | +SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDEBUG -O0") | |
| 15 | + | |
| 16 | +# C++11: Workaround for cmake < 3.1 with no target_compile_features support. | |
| 17 | +if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |
| 18 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
| 19 | +endif() | |
| 20 | + | |
| 21 | +# Find external libraries | |
| 22 | +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/") | |
| 23 | + | |
| 24 | +INCLUDE_DIRECTORIES(.) | |
| 25 | + | |
| 26 | +# Qt Widgets based Gui with OpenGL canvas | |
| 27 | +add_subdirectory(openhantek) | |
| 28 | + | |
| 29 | +# Use CPack to make deb/rpm/zip/exe installer packages | |
| 30 | +include(cmake/CPackInfos.cmake) | |
| 31 | + | |
| 32 | +install(FILES ChangeLog COPYING readme.md DESTINATION ".") | |
| 33 | + | |
| 34 | +# Add auxiliary files to the project, so that these files appear in VisualStudio/QtCreator | |
| 35 | +add_custom_target(readme SOURCES readme.md) | |
| 36 | + | |
| 37 | +# Add "cppcheck" command | |
| 38 | +add_custom_target(cppcheck COMMAND "cppcheck --enable=all -I \"${CMAKE_CURRENT_LIST_DIR}/libusbDSO\" -I \"${CMAKE_CURRENT_LIST_DIR}/libPostprocessingDSO\" -I \"${CMAKE_CURRENT_LIST_DIR}/openhantek/src\" -q ${SRC} --template=\"{file}:{line}: {severity}: {message}\"") | |
| 39 | + | |
| 40 | +# Add "doc" target to build the documentation. | |
| 41 | +find_package(Doxygen QUIET) | |
| 42 | +if (DOXYGEN_FOUND) | |
| 43 | + add_custom_target(doc | |
| 44 | + COMMAND "${CMAKE_COMMAND} -E remove_directory html" | |
| 45 | + COMMAND "${DOXYGEN_EXECUTABLE} Doxyfile" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}") | |
| 46 | +endif() | |
| 0 | 47 | \ No newline at end of file | ... | ... |
cmake/CPackInfos.cmake
0 → 100644
| 1 | +# This file configures CPack. We setup a version number that contains | |
| 2 | +# the current git revision if git is found. A zip file is created on | |
| 3 | +# all platforms. Additionally an NSIS Installer exe is created on windows | |
| 4 | +# and a .sh installer file for linux. | |
| 5 | + | |
| 6 | +find_package(Git QUIET) | |
| 7 | + | |
| 8 | +execute_process( | |
| 9 | + COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD | |
| 10 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | |
| 11 | + RESULT_VARIABLE CMD_RESULT | |
| 12 | + OUTPUT_VARIABLE VCS_REVISION | |
| 13 | + OUTPUT_STRIP_TRAILING_WHITESPACE | |
| 14 | + ) | |
| 15 | + | |
| 16 | +if(NOT DEFINED CMD_RESULT) | |
| 17 | + message(WARNING "GIT executable not found. Make your PATH environment variable point to git") | |
| 18 | + return() | |
| 19 | +else() | |
| 20 | + execute_process( | |
| 21 | + COMMAND ${GIT_EXECUTABLE} status | |
| 22 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | |
| 23 | + RESULT_VARIABLE CMD_RESULT | |
| 24 | + OUTPUT_VARIABLE DESCRIBE_STATUS | |
| 25 | + OUTPUT_STRIP_TRAILING_WHITESPACE | |
| 26 | + ) | |
| 27 | + | |
| 28 | + string(REPLACE "\n" " " DESCRIBE_STATUS ${DESCRIBE_STATUS}) | |
| 29 | + string(REPLACE "\r" " " DESCRIBE_STATUS ${DESCRIBE_STATUS}) | |
| 30 | + string(REPLACE "\rn" " " DESCRIBE_STATUS ${DESCRIBE_STATUS}) | |
| 31 | + string(REPLACE " " ";" DESCRIBE_STATUS ${DESCRIBE_STATUS}) | |
| 32 | + list(GET DESCRIBE_STATUS 2 VCS_BRANCH) | |
| 33 | + | |
| 34 | +execute_process( | |
| 35 | + COMMAND ${GIT_EXECUTABLE} config --get remote.origin.url | |
| 36 | + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | |
| 37 | + RESULT_VARIABLE CMD_RESULT | |
| 38 | + OUTPUT_VARIABLE VCS_URL | |
| 39 | + OUTPUT_STRIP_TRAILING_WHITESPACE | |
| 40 | + ) | |
| 41 | +endif() | |
| 42 | + | |
| 43 | +string(TIMESTAMP DATE_VERSION "%d.%m.%Y") | |
| 44 | +string(TIMESTAMP CURRENT_TIME "%d.%m.%Y %H:%M") | |
| 45 | + | |
| 46 | +if (UNIX) | |
| 47 | + set(CPACK_GENERATOR ZIP STGZ) | |
| 48 | +elseif(WIN32) | |
| 49 | + set(CPACK_GENERATOR ZIP NSIS) | |
| 50 | +endif() | |
| 51 | + | |
| 52 | +set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") | |
| 53 | +set(CPACK_PACKAGE_VERSION "${DATE_VERSION}-${VCS_BRANCH}-${VCS_REVISION}") | |
| 54 | +set(CPACK_PACKAGE_CONTACT "contact@openhantek.org") | |
| 55 | +set(CPACK_PACKAGE_VENDOR "OpenHantek Community") | |
| 56 | +set(CPACK_PACKAGE_DESCRIPTION "Digitial Oscilloscope for Hantek USB DSO hardware.") | |
| 57 | +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenHantek is a free software for Hantek (Voltcraft/Darkwire/Protek/Acetech) USB DSOs based on HantekDSO. Build on ${CURRENT_TIME} from ${VCS_URL}. Branch ${VCS_BRANCH} has been used at commit ${VCS_REVISION}") | |
| 58 | +set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/readme.md") | |
| 59 | +if (EXISTS "${CMAKE_SOURCE_DIR}/COPYING") | |
| 60 | + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") | |
| 61 | +endif() | |
| 62 | +set(CPACK_DEBIAN_PACKAGE_SECTION "net") | |
| 63 | +IF ((MSVC AND CMAKE_GENERATOR MATCHES "Win64+") OR (CMAKE_SIZEOF_VOID_P EQUAL 8)) | |
| 64 | + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") | |
| 65 | +else() | |
| 66 | + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i586") | |
| 67 | +endif() | |
| 68 | +set(CPACK_STRIP_FILES 1) | |
| 69 | + | |
| 70 | +include(CMakeDetermineSystem) | |
| 71 | + | |
| 72 | +set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") | |
| 73 | + | |
| 74 | +set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) | |
| 75 | +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CMAKE_SYSTEM_NAME}") | |
| 76 | +set(CPACK_PACKAGE_INSTALL_DIRECTORY ".") | |
| 77 | +SET(CPACK_OUTPUT_FILE_PREFIX packages) | |
| 78 | + | |
| 79 | +include(CPack) | |
| 80 | +set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".") | |
| 81 | +include(InstallRequiredSystemLibraries) | |
| 82 | + | |
| 83 | +cpack_add_install_type(Full DISPLAY_NAME "All") | |
| 84 | + | |
| 85 | +set(VERSION ${CPACK_PACKAGE_VERSION}) | |
| 0 | 86 | \ No newline at end of file | ... | ... |
cmake/FindFFTW.cmake
0 → 100644
| 1 | +# - Find FFTW | |
| 2 | +# Find the native FFTW includes and library | |
| 3 | +# | |
| 4 | +# FFTW_INCLUDES - where to find fftw3.h | |
| 5 | +# FFTW_LIBRARIES - List of libraries when using FFTW. | |
| 6 | +# FFTW_FOUND - True if FFTW found. | |
| 7 | + | |
| 8 | +if (FFTW_INCLUDES) | |
| 9 | + # Already in cache, be silent | |
| 10 | + set (FFTW_FIND_QUIETLY TRUE) | |
| 11 | +endif (FFTW_INCLUDES) | |
| 12 | + | |
| 13 | +find_path (FFTW_INCLUDES fftw3.h) | |
| 14 | + | |
| 15 | +find_library (FFTW_LIBRARIES NAMES fftw3) | |
| 16 | + | |
| 17 | +# handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if | |
| 18 | +# all listed variables are TRUE | |
| 19 | +include (FindPackageHandleStandardArgs) | |
| 20 | +find_package_handle_standard_args (FFTW DEFAULT_MSG FFTW_LIBRARIES FFTW_INCLUDES) | |
| 21 | + | |
| 22 | +mark_as_advanced (FFTW_LIBRARIES FFTW_INCLUDES) | |
| 0 | 23 | \ No newline at end of file | ... | ... |
cmake/Findlibusb.cmake
0 → 100644
| 1 | +find_path(LIBUSB_INCLUDE_DIR | |
| 2 | + NAMES | |
| 3 | + libusb.h | |
| 4 | + PATHS | |
| 5 | + /usr/local/include | |
| 6 | + /opt/local/include | |
| 7 | + /usr/include | |
| 8 | + PATH_SUFFIXES | |
| 9 | + libusb-1.0 | |
| 10 | +) | |
| 11 | + | |
| 12 | +if (libusb_USE_STATIC_LIBS AND NOT MSVC) | |
| 13 | + set (LIBUSB_LIB_PREFIX "lib" CACHE INTERNAL "libusb library name prefox passed to find_library") | |
| 14 | + set (LIBUSB_LIB_SUFFIX ".a" CACHE INTERNAL "libusb library name suffix passed to find_library") | |
| 15 | +else () | |
| 16 | + set (LIBUSB_LIB_PREFIX "" CACHE INTERNAL "libusb library name prefox passed to find_library") | |
| 17 | + set (LIBUSB_LIB_SUFFIX "" CACHE INTERNAL "libusb library name suffix passed to find_library") | |
| 18 | +endif () | |
| 19 | + | |
| 20 | +find_library(LIBUSB_LIBRARY | |
| 21 | + NAMES | |
| 22 | + ${LIBUSB_LIB_PREFIX}usb-1.0${LIBUSB_LIB_SUFFIX} ${LIBUSB_LIB_PREFIX}usb${LIBUSB_LIB_SUFFIX} | |
| 23 | + PATHS | |
| 24 | + /usr/local/lib | |
| 25 | + /opt/local/lib | |
| 26 | + /usr/lib | |
| 27 | + /lib64/ | |
| 28 | + /usr/lib/i386-linux-gnu/ | |
| 29 | + /usr/lib/x86_64-linux-gnu/ | |
| 30 | +) | |
| 31 | + | |
| 32 | +include(FindPackageHandleStandardArgs) | |
| 33 | +find_package_handle_standard_args(libusb REQUIRED_VARS LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR) | |
| 34 | + | |
| 35 | +if (LIBUSB_FOUND) | |
| 36 | + set(LIBUSB_INCLUDE_DIRS ${LIBUSB_INCLUDE_DIR}) | |
| 37 | + set(LIBUSB_LIBRARIES ${LIBUSB_LIBRARY}) | |
| 38 | + mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY) | |
| 39 | +endif (LIBUSB_FOUND) | |
| 0 | 40 | \ No newline at end of file | ... | ... |
cmake/copy_qt5_dlls_to_bin_dir.cmake
0 → 100644
| 1 | +# install Qt Dlls into the binary dir on windows platforms | |
| 2 | +get_target_property(QT5_BIN_DIR Qt5::Core LOCATION) | |
| 3 | +get_filename_component(QT5_BIN_DIR "${QT5_BIN_DIR}" DIRECTORY) | |
| 4 | +if (MSVC AND EXISTS "${QT5_BIN_DIR}/windeployqt.exe") | |
| 5 | + add_custom_command(TARGET ${PROJECT_NAME} | |
| 6 | + POST_BUILD | |
| 7 | + COMMAND "${QT5_BIN_DIR}/qtenv2.bat" | |
| 8 | + COMMAND "${QT5_BIN_DIR}/windeployqt" --no-translations "${CMAKE_BINARY_DIR}/$<CONFIGURATION>/${PROJECT_NAME}.exe" | |
| 9 | + WORKING_DIRECTORY "${QT5_BIN_DIR}" | |
| 10 | + COMMENT "Copy Qt5 dlls for ${PROJECT_NAME}" | |
| 11 | + ) | |
| 12 | + | |
| 13 | + SET(EXE "\${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.exe") | |
| 14 | + configure_file(installQt.cmake.in "${CMAKE_BINARY_DIR}/installQt.cmake") | |
| 15 | + install(SCRIPT "${CMAKE_BINARY_DIR}/installQt.cmake") | |
| 16 | +endif() | ... | ... |
openhantek/CMakeLists.txt
0 → 100644
| 1 | +project(OpenHantek CXX C) | |
| 2 | + | |
| 3 | +find_package(Qt5Widgets REQUIRED) | |
| 4 | +find_package(Qt5PrintSupport REQUIRED) | |
| 5 | +find_package(Qt5OpenGL REQUIRED) | |
| 6 | +find_package(OpenGL) | |
| 7 | +set(CMAKE_AUTOMOC ON) | |
| 8 | +set(CMAKE_AUTOUIC ON) | |
| 9 | +set(CMAKE_AUTORCC ON) | |
| 10 | + | |
| 11 | +# include directories | |
| 12 | +set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
| 13 | +include_directories(src/ src/hantek) | |
| 14 | + | |
| 15 | +# collect sources and other files | |
| 16 | +file(GLOB_RECURSE SRC "src/*.cpp") | |
| 17 | +file(GLOB_RECURSE HEADERS "src/*.h") | |
| 18 | +file(GLOB_RECURSE QRC "res/*.qrc") | |
| 19 | + | |
| 20 | +add_definitions(-DVERSION="${VERSION}") | |
| 21 | + | |
| 22 | +add_subdirectory(translations) | |
| 23 | +add_subdirectory(res) | |
| 24 | + | |
| 25 | +# make executable | |
| 26 | +add_executable(${PROJECT_NAME} ${SRC} ${HEADERS} ${QRC}) | |
| 27 | +target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::PrintSupport Qt5::OpenGL ${OPENGL_LIBRARIES} ) | |
| 28 | +#target_compile_features(${PROJECT_NAME} PRIVATE cxx_range_for) | |
| 29 | + | |
| 30 | +# install commands | |
| 31 | +install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ".") | |
| 32 | + | |
| 33 | +include(../cmake/copy_qt5_dlls_to_bin_dir.cmake) | |
| 0 | 34 | \ No newline at end of file | ... | ... |
openhantek/OpenHantek.pro deleted
| 1 | -# Helper functions | |
| 2 | -defineReplace(surround) { | |
| 3 | - elements = $$1 | |
| 4 | - prefix = $$2 | |
| 5 | - postfix = $$3 | |
| 6 | - result = | |
| 7 | - for(element, elements) { | |
| 8 | - result += "$${prefix}$${element}$${postfix}" | |
| 9 | - } | |
| 10 | - return($${result}) | |
| 11 | -} | |
| 12 | - | |
| 13 | -TEMPLATE = app | |
| 14 | - | |
| 15 | -# Configuration | |
| 16 | -CONFIG += \ | |
| 17 | - warn_on \ | |
| 18 | - qt | |
| 19 | -QT += opengl | |
| 20 | -QT += printsupport | |
| 21 | -LIBS += -lfftw3 | |
| 22 | - | |
| 23 | -# Source files | |
| 24 | -SOURCES += \ | |
| 25 | - src/colorbox.cpp \ | |
| 26 | - src/configdialog.cpp \ | |
| 27 | - src/configpages.cpp \ | |
| 28 | - src/dataanalyzer.cpp \ | |
| 29 | - src/dockwindows.cpp \ | |
| 30 | - src/dso.cpp \ | |
| 31 | - src/dsocontrol.cpp \ | |
| 32 | - src/dsowidget.cpp \ | |
| 33 | - src/exporter.cpp \ | |
| 34 | - src/glgenerator.cpp \ | |
| 35 | - src/glscope.cpp \ | |
| 36 | - src/helper.cpp \ | |
| 37 | - src/levelslider.cpp \ | |
| 38 | - src/main.cpp \ | |
| 39 | - src/openhantek.cpp \ | |
| 40 | - src/settings.cpp \ | |
| 41 | - src/sispinbox.cpp \ | |
| 42 | - src/hantek/control.cpp \ | |
| 43 | - src/hantek/device.cpp \ | |
| 44 | - src/hantek/types.cpp | |
| 45 | -HEADERS += \ | |
| 46 | - src/colorbox.h \ | |
| 47 | - src/configdialog.h \ | |
| 48 | - src/configpages.h \ | |
| 49 | - src/dataanalyzer.h \ | |
| 50 | - src/dockwindows.h \ | |
| 51 | - src/dso.h \ | |
| 52 | - src/dsocontrol.h \ | |
| 53 | - src/dsowidget.h \ | |
| 54 | - src/exporter.h \ | |
| 55 | - src/glscope.h \ | |
| 56 | - src/glgenerator.h \ | |
| 57 | - src/helper.h \ | |
| 58 | - src/levelslider.h \ | |
| 59 | - src/openhantek.h \ | |
| 60 | - src/settings.h \ | |
| 61 | - src/sispinbox.h \ | |
| 62 | - src/hantek/control.h \ | |
| 63 | - src/hantek/device.h \ | |
| 64 | - src/hantek/types.h | |
| 65 | - | |
| 66 | -# Ressource files | |
| 67 | -RESOURCES += \ | |
| 68 | - res/application.qrc \ | |
| 69 | - res/configdialog.qrc | |
| 70 | - | |
| 71 | -# Doxygen files | |
| 72 | -DOXYFILES += \ | |
| 73 | - Doxyfile \ | |
| 74 | - mainpage.dox \ | |
| 75 | - roadmap.dox | |
| 76 | - | |
| 77 | -# Files copied into the distribution package | |
| 78 | -DISTFILES += \ | |
| 79 | - ChangeLog \ | |
| 80 | - COPYING \ | |
| 81 | - INSTALL \ | |
| 82 | - res/images/*.png \ | |
| 83 | - res/images/*.icns \ | |
| 84 | - res/images/*.svg \ | |
| 85 | - translations/*.qm \ | |
| 86 | - translations/*.ts \ | |
| 87 | - $${DOXYFILES} | |
| 88 | - | |
| 89 | -# Translations | |
| 90 | -TRANSLATIONS += \ | |
| 91 | - translations/openhantek_de.ts \ | |
| 92 | - translations/openhantek_pt.ts | |
| 93 | - | |
| 94 | -# Program version | |
| 95 | -VERSION = 0.2.0 | |
| 96 | - | |
| 97 | -# Destination directory for built binaries | |
| 98 | -DESTDIR = bin | |
| 99 | - | |
| 100 | -# Prefix for installation | |
| 101 | -PREFIX = $$(PREFIX) | |
| 102 | - | |
| 103 | -# Build directories | |
| 104 | -OBJECTS_DIR = build/obj | |
| 105 | -UI_DIR = build/ui | |
| 106 | -MOC_DIR = build/moc | |
| 107 | - | |
| 108 | -# libusb version | |
| 109 | -LIBUSB_VERSION = $$(LIBUSB_VERSION) | |
| 110 | -contains(LIBUSB_VERSION, 0) { | |
| 111 | - LIBS += -lusb | |
| 112 | -} | |
| 113 | -else { | |
| 114 | - LIBUSB_VERSION = 1 | |
| 115 | - LIBS += -lusb-1.0 | |
| 116 | -} | |
| 117 | -DEFINES += LIBUSB_VERSION=$${LIBUSB_VERSION} | |
| 118 | - | |
| 119 | -# Debug output | |
| 120 | -CONFIG(debug, debug|release): DEFINES += DEBUG | |
| 121 | -else: DEFINES += QT_NO_DEBUG_OUTPUT | |
| 122 | - | |
| 123 | -# Quoted include directories | |
| 124 | -INCLUDEPATH_QUOTE = "$${IN_PWD}/src" | |
| 125 | - | |
| 126 | -# Include directory | |
| 127 | -QMAKE_CXXFLAGS += "-iquote $${INCLUDEPATH_QUOTE}" | |
| 128 | - | |
| 129 | -# Settings for different operating systems | |
| 130 | -unix:!macx { | |
| 131 | - isEmpty(PREFIX): PREFIX = /usr/local | |
| 132 | - TARGET = openhantek | |
| 133 | - | |
| 134 | - # Installation directories | |
| 135 | - target.path = $${PREFIX}/bin | |
| 136 | - translations.path = $${PREFIX}/share/apps/openhantek/translations | |
| 137 | - contains(LIBUSB_VERSION, 0) { | |
| 138 | - INCLUDEPATH += /usr/include/libusb | |
| 139 | - } | |
| 140 | - else { | |
| 141 | - INCLUDEPATH += /usr/include/libusb-1.0 | |
| 142 | - } | |
| 143 | - DEFINES += \ | |
| 144 | - QMAKE_TRANSLATIONS_PATH=\\\"$${translations.path}\\\" \ | |
| 145 | - OS_UNIX VERSION=\\\"$${VERSION}\\\" | |
| 146 | -} | |
| 147 | -macx { | |
| 148 | - isEmpty(PREFIX): PREFIX = OpenHantek.app | |
| 149 | - TARGET = OpenHantek | |
| 150 | - | |
| 151 | - # Installation directories | |
| 152 | - target.path = $${PREFIX}/Contents/MacOS | |
| 153 | - translations.path = $${PREFIX}/Contents/Resources/translations | |
| 154 | - INCLUDEPATH += $${INCLUDEPATH_QUOTE} | |
| 155 | - LIBS += -framework IOKit -framework CoreFoundation | |
| 156 | - ICON = res/images/openhantek.icns | |
| 157 | - DEFINES += \ | |
| 158 | - QMAKE_TRANSLATIONS_PATH=\\\"Contents/Resources/translations\\\" \ | |
| 159 | - OS_DARWIN VERSION=\\\"$${VERSION}\\\" | |
| 160 | -} | |
| 161 | -win32 { | |
| 162 | - isEmpty(PREFIX): PREFIX = OpenHantek | |
| 163 | - TARGET = OpenHantek | |
| 164 | - | |
| 165 | - # Installation directories | |
| 166 | - target.path = $${PREFIX} | |
| 167 | - translations.path = $${PREFIX}/translations | |
| 168 | - INCLUDEPATH += $${INCLUDEPATH_QUOTE} | |
| 169 | - DEFINES += \ | |
| 170 | - QMAKE_TRANSLATIONS_PATH=\\\"translations\\\" \ | |
| 171 | - OS_WINDOWS VERSION=\\\"$${VERSION}\\\" | |
| 172 | -} | |
| 173 | -translations.files += translations/*.qm | |
| 174 | -INSTALLS += \ | |
| 175 | - target \ | |
| 176 | - translations | |
| 177 | - | |
| 178 | -# Custom compiler "lrelease" for qm generation | |
| 179 | -isEmpty(QMAKE_LRELEASE) { | |
| 180 | - win32: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe | |
| 181 | - else: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease | |
| 182 | -} | |
| 183 | -lrelease.input = TRANSLATIONS | |
| 184 | -lrelease.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm | |
| 185 | -lrelease.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm | |
| 186 | -lrelease.CONFIG += no_link | |
| 187 | -QMAKE_EXTRA_COMPILERS += lrelease | |
| 188 | -PRE_TARGETDEPS += compiler_lrelease_make_all | |
| 189 | - | |
| 190 | -# Custom target "cppcheck" for Cppcheck | |
| 191 | -INCLUDEPARAMETERS = $$surround($${INCLUDEPATH} $${INCLUDEPATH_QUOTE}, "-I \"", "\"") | |
| 192 | -cppcheck.commands = "cppcheck --enable=all $${INCLUDEPARAMETERS} -q $${SOURCES} --template=\"{file}:{line}: {severity}: {message}\"" | |
| 193 | -cppcheck.depends = $${SOURCES} | |
| 194 | - | |
| 195 | -# Custom target "doc" for Doxygen | |
| 196 | -doxygen.target = "doc" | |
| 197 | -doxygen.commands = "rm -r doc/; env DEFINES=\"$${DEFINES}\" doxygen Doxyfile" | |
| 198 | -doxygen.depends = \ | |
| 199 | - $${SOURCES} \ | |
| 200 | - $${HEADERS} \ | |
| 201 | - $${DOXYFILES} | |
| 202 | - | |
| 203 | -QMAKE_EXTRA_TARGETS += \ | |
| 204 | - cppcheck \ | |
| 205 | - doxygen |