Skip to content

Commit

Permalink
Merge pull request ganzziani#29 from rzr/sandbox/pcoval/on/master/for…
Browse files Browse the repository at this point in the history
…/upstream

Upgrade to qt5 and cleanup
  • Loading branch information
ganzziani authored Nov 4, 2016
2 parents 6c60d54 + 01dcd32 commit e836750
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 11 deletions.
Binary file removed .DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
~
debian/*.debhelper
debian/files
debian/*.log
debian/*.substvars
debian/xscopes-qt/
obj*
55 changes: 46 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ set(CMAKE_VERBOSE_MAKEFILE true)
# PIC and c++11
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++11")

set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# target
set(TARGET xscope)

Expand Down Expand Up @@ -37,11 +44,26 @@ endif( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
#add_definitions(-DQT_NO_KEYWORDS)

# Add the appropriate components to the component list here
find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui)
include(${QT_USE_FILE})
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets PrintSupport SerialPort)

#$include(${QT_USE_FILE})
include_directories(${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR})

include_directories(${Qt5_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5PrintSupport_INCLUDE_DIRS}
${Qt5SerialPort_INCLUDE_DIRS})

set(QT_LIBRARIES ${Qt5_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5PrintSupport_LIBRARIES}
${Qt5SerialPort_LIBRARIES})

# Qwt module
#set(QWT_LIBRARIES qwt)

Expand All @@ -50,19 +72,21 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}
##############################################################################
set(FORMS_SRC xprotolabinterface.ui
customtheme.ui)
QT5_WRAP_UI(FORMS_HEADERS ${FORMS_SRC})
set(MOC_HEADERS customtheme.h libusbdevice.h
qcustomplot.h xprotolabinterface.h)
set(RESOURCES_SRC xprotolabinterface.qrc)
file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${FORMS_SRC})
file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${RESOURCES_SRC})
file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${MOC_HEADERS})

QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES})
QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS})

QT5_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES})
#QT5_WRAP_UI(QT_FORMS_HPP ${QT_FORMS})
# Prevents moc from failing on Parse error at "BOOST_JOIN"
QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC}
#QT5_WRAP_CPP(QT_MOC_HPP ${QT_MOC}
# OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED
)
# )
##############################################################################
# App Sources
############################################################################## )
Expand All @@ -75,18 +99,28 @@ set(HEADER_SRC
fft.h
complex.h
sniffer.h
customtheme.h)
customcolors.h
customtheme.h
serialportconnection.h)
set(CPP_SRC main.cpp
qcustomplot.cpp
libusbdevice.cpp
xprotolabinterface.cpp
fft.cpp
complex.cpp
customtheme.cpp)
customcolors.cpp
customtheme.cpp
serialportconnection.cpp)

file(GLOB_RECURSE CPP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS ${CPP_SRC})
#file(GLOB_RECURSE INC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.hpp)

##############################################################################
# extserialport
##############################################################################

add_subdirectory(extserialport)

##############################################################################
# Binaries
##############################################################################
Expand All @@ -95,10 +129,13 @@ add_executable(${TARGET}
${CPP_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP}
# display files in the Qt creator's navigator
${HEADER_SRC}
${FORMS_HEADERS}
)

target_link_libraries(${TARGET} ${QT_LIBRARIES}
target_link_libraries(${TARGET}
${LIBUSB_LIBRARIES}
${QT_LIBRARIES}
extserialport
# ${Boost_LIBRARIES}
# ${QWT_LIBRARIES}
)
Expand Down
14 changes: 14 additions & 0 deletions extserialport/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 2.8.0)
project(extserialport)

# todo fix for win
set (EXTSERIALPORT_SRCS
qextserialport.cpp
qextserialport_unix.cpp
qextserialenumerator.cpp
qextserialenumerator_unix.cpp
)

include_directories(${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR})

add_library(${PROJECT_NAME} STATIC ${EXTSERIALPORT_SRCS})
2 changes: 1 addition & 1 deletion libusbdevice.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "libusbdevice.h"
#include "libusbdeviceinfo.h"

#include "qextserialport.h"
#include "extserialport/qextserialport.h"

LibUsbDevice::LibUsbDevice(QObject *parent) :
QObject(parent)
Expand Down
2 changes: 1 addition & 1 deletion serialportconnection.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "serialportconnection.h"
#include <QThread>
#include "qextserialport.h"
#include "extserialport/qextserialport.h"

SerialPortConnection::SerialPortConnection(QObject *parent) :
QObject(parent)
Expand Down

0 comments on commit e836750

Please sign in to comment.