diff options
-rw-r--r-- | CMakeLists.txt | 43 | ||||
-rw-r--r-- | src/ui/speedcheck.ui | 26 |
2 files changed, 47 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a642836..599979c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) # cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug .. @@ -9,37 +9,38 @@ set(CMAKE_BUILD_TYPE Debug) set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -Wextra -pedantic -Werror -Wno-multichar") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wno-multichar") +set(CMAKE_CXX_STANDARD 11) +# Some cmake versions can't understand the CMAKE_CXX_STANDARD option above? +SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" ) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) + file(GLOB_RECURSE SPEEDCHECK_SOURCES src/*.cpp) -file(GLOB_RECURSE SPEEDCHECK_MOC_HEADERS src/*.h) file(GLOB_RECURSE SPEEDCHECK_UIS src/ui/*.ui) file(GLOB_RECURSE SPEEDCHECK_RESOURCES src/*.qrc) file(GLOB_RECURSE SPEEDCHECK_TSS src/i18n/*.ts) -include_directories(${CMAKE_CURRENT_BINARY_DIR} ./src) +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_BINARY_DIR} +) # -# Qt4 +# Qt5 # -find_package(Qt4 4.7.0 REQUIRED) -if(QT4_FOUND) - message(STATUS "Qt4 found") -else(QT4_FOUND) - message(FATAL_ERROR "Qt4 not found") -endif(QT4_FOUND) +find_package(Qt5 COMPONENTS Widgets Network LinguistTools REQUIRED) -set(QT_USE_QTSVG TRUE) -set(QT_USE_QTNETWORK TRUE) - -include(${QT_USE_FILE}) +QT5_WRAP_UI(SPEEDCHECK_UI_HEADERS ${SPEEDCHECK_UIS}) option(UPDATE_TRANSLATIONS "Update .ts files (WARNING: make clean will delete the .ts files!)") if(SPEEDCHECK_TSS) if (UPDATE_TRANSLATIONS) set (FILES_TO_TRANSLATE ${FILES_TO_TRANSLATE} ${SPEEDCHECK_SOURCES} ${SPEEDCHECK_UIS}) - QT4_CREATE_TRANSLATION(SPEEDCHECK_QMS ${FILES_TO_TRANSLATE} ${SPEEDCHECK_TSS} OPTIONS -noobsolete) + QT5_CREATE_TRANSLATION(SPEEDCHECK_QMS ${FILES_TO_TRANSLATE} ${SPEEDCHECK_TSS} OPTIONS -noobsolete) message(STATUS ".tr files have been updated") else (UPDATE_TRANSLATIONS) - QT4_ADD_TRANSLATION(SPEEDCHECK_QMS ${SPEEDCHECK_TSS}) + QT5_ADD_TRANSLATION(SPEEDCHECK_QMS ${SPEEDCHECK_TSS}) endif (UPDATE_TRANSLATIONS) # write a resource file for qm files @@ -55,23 +56,21 @@ if(SPEEDCHECK_TSS) #add_custom_target(translations_target DEPENDS ${SPEEDCHECK_QMS}) endif(SPEEDCHECK_TSS) -QT4_ADD_RESOURCES(SPEEDCHECK_RC_SOURCES ${SPEEDCHECK_RESOURCES}) -QT4_WRAP_UI(SPEEDCHECK_UI_HEADERS ${SPEEDCHECK_UIS}) -QT4_WRAP_CPP(SPEEDCHECK_MOC_SOURCES ${SPEEDCHECK_MOC_HEADERS}) +QT5_ADD_RESOURCES(SPEEDCHECK_RC_SOURCES ${SPEEDCHECK_RESOURCES}) # # build speedcheck # add_executable(speedcheck ${SPEEDCHECK_SOURCES} - ${SPEEDCHECK_MOC_SOURCES} ${SPEEDCHECK_UI_HEADERS} ${SPEEDCHECK_RC_SOURCES} ${SPEEDCHECK_QMS} ) target_link_libraries(speedcheck - ${QT_LIBRARIES} + Qt5::Widgets + Qt5::Network ) - + install(TARGETS speedcheck RUNTIME DESTINATION bin) diff --git a/src/ui/speedcheck.ui b/src/ui/speedcheck.ui index 2f98f3b..4e59fc1 100644 --- a/src/ui/speedcheck.ui +++ b/src/ui/speedcheck.ui @@ -16,9 +16,35 @@ <widget class="QWidget" name="centralwidget"> <layout class="QVBoxLayout" name="verticalLayout"> <item> + <widget class="QLabel" name="lblNetwork"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Network (100MBit / 1000GBit)</string> + </property> + </widget> + </item> + <item> <widget class="GraphWidget" name="picSpeed" native="true"/> </item> <item> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>CPU usage</string> + </property> + </widget> + </item> + <item> <widget class="GraphWidget" name="picCpu" native="true"/> </item> <item> |