Added Qt5 support ("cmake -DFINDOBJECT_QT_VERSION=5 ..")

This commit is contained in:
matlabbe 2015-11-29 18:39:20 -05:00
parent ae7b79629b
commit 164da72169
31 changed files with 230 additions and 156 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.3) cmake_minimum_required(VERSION 2.8.5)
# Detect if it is called by catkin # Detect if it is called by catkin
SET(CATKIN_BUILD ${CATKIN_TOPLEVEL}) SET(CATKIN_BUILD ${CATKIN_TOPLEVEL})
@ -11,6 +11,14 @@ ELSE()
PROJECT( find_object_2d ) PROJECT( find_object_2d )
ENDIF() ENDIF()
# Catkin doesn't support multiarch library path,
# fix to "lib" if not set by user.
IF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
ENDIF(NOT DEFINED CMAKE_INSTALL_LIBDIR)
INCLUDE(GNUInstallDirs)
####################### #######################
# VERSION # VERSION
####################### #######################
@ -28,7 +36,13 @@ ADD_DEFINITIONS(-DPROJECT_NAME="${PROJECT_NAME}")
####### DEPENDENCIES ####### ####### DEPENDENCIES #######
FIND_PACKAGE(OpenCV REQUIRED) # tested on 2.3.1 FIND_PACKAGE(OpenCV REQUIRED) # tested on 2.3.1
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED)
SET(FINDOBJECT_QT_VERSION 4 CACHE STRING "Which QT version to use")
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED)
ELSE()
FIND_PACKAGE(Qt5 COMPONENTS Widgets Core Gui Network REQUIRED)
ENDIF()
ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # To avoid conflicts with boost signals used in ROS ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # To avoid conflicts with boost signals used in ROS
SET(NONFREE 0) SET(NONFREE 0)
@ -60,24 +74,6 @@ IF(NOT CATKIN_BUILD)
####### Build libraries as shared or static ####### ####### Build libraries as shared or static #######
OPTION( BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON ) OPTION( BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON )
####### SET RPATH #########
# When RPATH is activated (supported on most UNIX systems),
# the user doesn't need to change LD_LIBRARY_PATH
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# the RPATH to be used when installing
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_PREFIX}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
####### OUTPUT DIR ####### ####### OUTPUT DIR #######
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
@ -85,14 +81,12 @@ IF(NOT CATKIN_BUILD)
####### INSTALL DIR ####### ####### INSTALL DIR #######
# Offer the user the choice of overriding the installation directories # Offer the user the choice of overriding the installation directories
set(INSTALL_LIB_DIR lib/${PROJECT_PREFIX}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} CACHE PATH "Installation directory for libraries")
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
set(INSTALL_INCLUDE_DIR include/${PROJECT_PREFIX}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} CACHE PATH set(INSTALL_INCLUDE_DIR include/${PROJECT_PREFIX}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} CACHE PATH
"Installation directory for header files") "Installation directory for header files")
if(WIN32 AND NOT CYGWIN) if(WIN32 AND NOT CYGWIN)
set(DEF_INSTALL_CMAKE_DIR CMake) set(DEF_INSTALL_CMAKE_DIR CMake)
else() else()
set(DEF_INSTALL_CMAKE_DIR lib/${PROJECT_PREFIX}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) set(DEF_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_PREFIX}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
endif() endif()
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH
"Installation directory for CMake files") "Installation directory for CMake files")
@ -139,7 +133,7 @@ IF(NOT CATKIN_BUILD)
####################### #######################
# Create the FindObjectConfig.cmake and FindObjectConfigVersion files # Create the FindObjectConfig.cmake and FindObjectConfigVersion files
file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}") file(RELATIVE_PATH REL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
file(RELATIVE_PATH REL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}") file(RELATIVE_PATH REL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
# ... for the build tree # ... for the build tree
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include") set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include")
@ -248,6 +242,14 @@ IF(NOT CATKIN_BUILD)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(QT4_FOUND)
MESSAGE(STATUS " With Qt = YES (version 4, \"-DFINDOBJECT_QT_VERSION=4\")")
ELSEIF(Qt5_FOUND)
MESSAGE(STATUS " With Qt = YES (version 5, \"-DFINDOBJECT_QT_VERSION=5\")")
ELSE()
MESSAGE(STATUS " With Qt = NO (Qt not found, to use Qt5 you should set -DFINDOBJECT_QT_VERSION=5)")
ENDIF()
IF(APPLE) IF(APPLE)
MESSAGE(STATUS " BUILD_AS_BUNDLE = ${BUILD_AS_BUNDLE}") MESSAGE(STATUS " BUILD_AS_BUNDLE = ${BUILD_AS_BUNDLE}")
ENDIF(APPLE) ENDIF(APPLE)

View File

@ -5,7 +5,9 @@ SET(INCLUDE_DIRS
${OpenCV_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}
) )
INCLUDE(${QT_USE_FILE}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
INCLUDE(${QT_USE_FILE})
ENDIF()
SET(LIBRARIES SET(LIBRARIES
${QT_LIBRARIES} ${QT_LIBRARIES}
@ -50,6 +52,9 @@ ELSE()
ENDIF() ENDIF()
# Linking with Qt libraries # Linking with Qt libraries
TARGET_LINK_LIBRARIES(find_object_app find_object ${LIBRARIES}) TARGET_LINK_LIBRARIES(find_object_app find_object ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
QT5_USE_MODULES(find_object_app Widgets Core Gui Network PrintSupport)
ENDIF()
IF(APPLE AND BUILD_AS_BUNDLE) IF(APPLE AND BUILD_AS_BUNDLE)
SET_TARGET_PROPERTIES(find_object_app PROPERTIES SET_TARGET_PROPERTIES(find_object_app PROPERTIES
@ -66,7 +71,7 @@ ENDIF()
# Installation stuff # Installation stuff
#--------------------------- #---------------------------
INSTALL(TARGETS find_object_app INSTALL(TARGETS find_object_app
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT runtime RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime) BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)
#--------------------------- #---------------------------

View File

@ -25,7 +25,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <QtGui/QApplication> #include <QApplication>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QFile> #include <QtCore/QFile>
#include <iostream> #include <iostream>

View File

@ -9,7 +9,9 @@ SET(INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/../include ${CMAKE_CURRENT_SOURCE_DIR}/../include
) )
INCLUDE(${QT_USE_FILE}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
INCLUDE(${QT_USE_FILE})
ENDIF()
SET(LIBRARIES SET(LIBRARIES
${OpenCV_LIBS} ${OpenCV_LIBS}
@ -23,11 +25,14 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# The extension is automatically found. # The extension is automatically found.
ADD_EXECUTABLE(example ${SRC_FILES}) ADD_EXECUTABLE(example ${SRC_FILES})
TARGET_LINK_LIBRARIES(example find_object ${LIBRARIES}) TARGET_LINK_LIBRARIES(example find_object ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
QT5_USE_MODULES(example Widgets Core Gui Network PrintSupport)
ENDIF()
SET_TARGET_PROPERTIES( example SET_TARGET_PROPERTIES( example
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-example) PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-example)
INSTALL(TARGETS example INSTALL(TARGETS example
RUNTIME DESTINATION bin COMPONENT runtime RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime) BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)

View File

@ -32,7 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "find_object/DetectionInfo.h" #include "find_object/DetectionInfo.h"
#include <QtGui/QMainWindow> #include <QMainWindow>
#include <QtCore/QSet> #include <QtCore/QSet>
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <QtCore/QTime> #include <QtCore/QTime>

View File

@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "find_object/FindObjectExp.h" // DLL export/import defines #include "find_object/FindObjectExp.h" // DLL export/import defines
#include <opencv2/features2d/features2d.hpp> #include <opencv2/features2d/features2d.hpp>
#include <QtGui/QWidget> #include <QWidget>
#include <QtCore/QMultiMap> #include <QtCore/QMultiMap>
class QAction; class QAction;

View File

@ -47,6 +47,7 @@ AboutDialog::AboutDialog(QWidget * parent) :
#endif #endif
ui_->label_version_opencv->setText(cv_version); ui_->label_version_opencv->setText(cv_version);
ui_->label_version_qt->setText(QT_VERSION_STR);
} }
AboutDialog::~AboutDialog() AboutDialog::~AboutDialog()

View File

@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ABOUTDIALOG_H_ #ifndef ABOUTDIALOG_H_
#define ABOUTDIALOG_H_ #define ABOUTDIALOG_H_
#include <QtGui/QDialog> #include <QDialog>
#include <QtCore/QUrl> #include <QtCore/QUrl>
class Ui_aboutDialog; class Ui_aboutDialog;

View File

@ -38,9 +38,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h> #include <stdio.h>
#include <QtGui/QGraphicsScene> #include <QGraphicsScene>
#include <QtGui/QGraphicsPixmapItem> #include <QGraphicsPixmapItem>
#include <QtGui/QMessageBox> #include <QMessageBox>
#include <opencv2/imgproc/imgproc.hpp> #include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp> #include <opencv2/highgui/highgui.hpp>

View File

@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ADDOBJECTDIALOG_H_ #ifndef ADDOBJECTDIALOG_H_
#define ADDOBJECTDIALOG_H_ #define ADDOBJECTDIALOG_H_
#include <QtGui/QDialog> #include <QDialog>
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <opencv2/features2d/features2d.hpp> #include <opencv2/features2d/features2d.hpp>
#include <opencv2/core/core.hpp> #include <opencv2/core/core.hpp>

View File

@ -34,15 +34,21 @@ SET(qrc
./resources.qrc ./resources.qrc
) )
# generate rules for building source files from the resources IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
QT4_ADD_RESOURCES(srcs_qrc ${qrc}) # generate rules for building source files from the resources
QT4_ADD_RESOURCES(srcs_qrc ${qrc})
#Generate .h files from the .ui files #Generate .h files from the .ui files
QT4_WRAP_UI(moc_uis ${uis}) QT4_WRAP_UI(moc_uis ${uis})
#This will generate moc_* for Qt #This will generate moc_* for Qt
QT4_WRAP_CPP(moc_srcs ${headers_ui}) QT4_WRAP_CPP(moc_srcs ${headers_ui})
### Qt Gui stuff end### ### Qt Gui stuff end###
ELSE()
QT5_ADD_RESOURCES(srcs_qrc ${qrc})
QT5_WRAP_UI(moc_uis ${uis})
QT5_WRAP_CPP(moc_srcs ${headers_ui})
ENDIF()
SET(SRC_FILES SET(SRC_FILES
./MainWindow.cpp ./MainWindow.cpp
@ -95,7 +101,9 @@ IF(CATKIN_BUILD)
) )
ENDIF(CATKIN_BUILD) ENDIF(CATKIN_BUILD)
INCLUDE(${QT_USE_FILE}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
INCLUDE(${QT_USE_FILE})
ENDIF()
SET(LIBRARIES SET(LIBRARIES
${QT_LIBRARIES} ${QT_LIBRARIES}
@ -115,29 +123,32 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
ADD_LIBRARY(find_object ${SRC_FILES}) ADD_LIBRARY(find_object ${SRC_FILES})
# Linking with Qt libraries # Linking with Qt libraries
TARGET_LINK_LIBRARIES(find_object ${LIBRARIES}) TARGET_LINK_LIBRARIES(find_object ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
QT5_USE_MODULES(find_object Widgets Core Gui Network PrintSupport)
ENDIF()
IF(CATKIN_BUILD) IF(CATKIN_BUILD)
set_target_properties(find_object PROPERTIES OUTPUT_NAME find_object_2d) set_target_properties(find_object PROPERTIES OUTPUT_NAME find_object_2d)
ENDIF(CATKIN_BUILD) ENDIF(CATKIN_BUILD)
IF(NOT CATKIN_BUILD) IF(NOT CATKIN_BUILD)
INSTALL(TARGETS find_object INSTALL(TARGETS find_object
RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT runtime RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT devel LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT devel) ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../include/ DESTINATION "${INSTALL_INCLUDE_DIR}" COMPONENT devel FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../include/ DESTINATION "${INSTALL_INCLUDE_DIR}" COMPONENT devel FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE)
ELSE() ELSE()
add_executable(find_object_2d ros/find_object_2d_node.cpp) add_executable(find_object_2d ros/find_object_2d_node.cpp)
target_link_libraries(find_object_2d find_object ${LIBRARIES}) target_link_libraries(find_object_2d find_object ${LIBRARIES})
add_dependencies(find_object_2d find_object_2d_generate_messages_cpp) add_dependencies(find_object_2d ${${PROJECT_NAME}_EXPORTED_TARGETS})
add_executable(print_objects_detected ros/print_objects_detected_node.cpp) add_executable(print_objects_detected ros/print_objects_detected_node.cpp)
target_link_libraries(print_objects_detected ${LIBRARIES}) target_link_libraries(print_objects_detected ${LIBRARIES})
add_dependencies(print_objects_detected find_object_2d_generate_messages_cpp) add_dependencies(print_objects_detected ${${PROJECT_NAME}_EXPORTED_TARGETS})
add_executable(tf_example ros/tf_example_node.cpp) add_executable(tf_example ros/tf_example_node.cpp)
target_link_libraries(tf_example ${LIBRARIES}) target_link_libraries(tf_example ${LIBRARIES})
add_dependencies(tf_example find_object_2d_generate_messages_cpp) add_dependencies(tf_example ${${PROJECT_NAME}_EXPORTED_TARGETS})
## Mark executables and/or libraries for installation ## Mark executables and/or libraries for installation
install(TARGETS install(TARGETS

View File

@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QTime> #include <QtCore/QTime>
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtGui/QGraphicsRectItem> #include <QGraphicsRectItem>
#include <stdio.h> #include <stdio.h>
namespace find_object { namespace find_object {
@ -374,7 +374,7 @@ std::vector<cv::KeyPoint> limitKeypoints(const std::vector<cv::KeyPoint> & keypo
void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, cv::Mat & descriptors, int maxKeypoints) void limitKeypoints(std::vector<cv::KeyPoint> & keypoints, cv::Mat & descriptors, int maxKeypoints)
{ {
UASSERT(keypoints.size() == descriptors.rows); UASSERT((int)keypoints.size() == descriptors.rows);
std::vector<cv::KeyPoint> kptsKept; std::vector<cv::KeyPoint> kptsKept;
cv::Mat descriptorsKept; cv::Mat descriptorsKept;
if(maxKeypoints > 0 && (int)keypoints.size() > maxKeypoints) if(maxKeypoints > 0 && (int)keypoints.size() > maxKeypoints)

View File

@ -10,6 +10,7 @@
#include <QtGui/QDragEnterEvent> #include <QtGui/QDragEnterEvent>
#include <QtCore/QRegExp> #include <QtCore/QRegExp>
#include <QtCore/QUrl> #include <QtCore/QUrl>
#include <QMimeData>
namespace find_object { namespace find_object {

View File

@ -8,7 +8,7 @@
#ifndef IMAGEDROPWIDGET_H_ #ifndef IMAGEDROPWIDGET_H_
#define IMAGEDROPWIDGET_H_ #define IMAGEDROPWIDGET_H_
#include <QtGui/QWidget> #include <QWidget>
namespace find_object { namespace find_object {

View File

@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QtGui/QPen> #include <QtGui/QPen>
#include <QtGui/QBrush> #include <QtGui/QBrush>
#include <QtGui/QGraphicsScene> #include <QGraphicsScene>
namespace find_object { namespace find_object {
@ -42,7 +42,7 @@ KeypointItem::KeypointItem(int id, qreal x, qreal y, int r, const cv::KeyPoint &
{ {
this->setPen(QPen(color)); this->setPen(QPen(color));
this->setBrush(QBrush(color)); this->setBrush(QBrush(color));
this->setAcceptsHoverEvents(true); this->setAcceptHoverEvents(true);
this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true);
this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsSelectable, true);
} }
@ -57,7 +57,7 @@ void KeypointItem::setColor(const QColor & color)
this->setBrush(QBrush(color)); this->setBrush(QBrush(color));
if(placeHolder_) if(placeHolder_)
{ {
QList<QGraphicsItem *> items = placeHolder_->children(); QList<QGraphicsItem *> items = placeHolder_->childItems();
if(items.size()) if(items.size())
{ {
((QGraphicsTextItem *)items.front())->setDefaultTextColor(this->pen().color().rgb()); ((QGraphicsTextItem *)items.front())->setDefaultTextColor(this->pen().color().rgb());

View File

@ -28,8 +28,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef KEYPOINTITEM_H_ #ifndef KEYPOINTITEM_H_
#define KEYPOINTITEM_H_ #define KEYPOINTITEM_H_
#include <QtGui/QGraphicsEllipseItem> #include <QGraphicsEllipseItem>
#include <QtGui/QGraphicsTextItem> #include <QGraphicsTextItem>
#include <QtGui/QPen> #include <QtGui/QPen>
#include <QtGui/QBrush> #include <QtGui/QBrush>
#include <opencv2/features2d/features2d.hpp> #include <opencv2/features2d/features2d.hpp>

View File

@ -62,17 +62,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QtCore/QThread> #include <QtCore/QThread>
#include <QtCore/QLineF> #include <QtCore/QLineF>
#include <QtGui/QFileDialog> #include <QFileDialog>
#include <QtGui/QMessageBox> #include <QMessageBox>
#include <QtGui/QGraphicsScene> #include <QGraphicsScene>
#include <QtGui/QGraphicsRectItem> #include <QGraphicsRectItem>
#include <QtGui/QSpinBox> #include <QSpinBox>
#include <QtGui/QStatusBar> #include <QStatusBar>
#include <QtGui/QProgressDialog> #include <QProgressDialog>
#include <QtGui/QCloseEvent> #include <QCloseEvent>
#include <QtGui/QCheckBox> #include <QCheckBox>
#include <QtGui/QScrollBar> #include <QScrollBar>
#include <QtGui/QInputDialog> #include <QInputDialog>
#include "utilite/UDirectory.h" #include "utilite/UDirectory.h"
@ -382,7 +382,7 @@ void MainWindow::loadSession()
this->showObject(obj); this->showObject(obj);
//update object labels //update object labels
QLabel * title = qFindChild<QLabel*>(this, QString("%1title").arg(iter.value()->id())); QLabel * title = this->findChild<QLabel*>(QString("%1title").arg(iter.value()->id()));
title->setText(QString("%1 (%2)").arg(iter.value()->id()).arg(QString::number(iter.value()->keypoints().size()))); title->setText(QString("%1 (%2)").arg(iter.value()->id()).arg(QString::number(iter.value()->keypoints().size())));
} }
@ -973,11 +973,11 @@ void MainWindow::setupCameraFromTcpIp()
else else
{ {
bool ok; bool ok;
int port = QInputDialog::getInteger(this, tr("Server port..."), "Port: ", Settings::getCamera_8port(), 1, USHRT_MAX, 1, &ok); int port = QInputDialog::getInt(this, tr("Server port..."), "Port: ", Settings::getCamera_8port(), 1, USHRT_MAX, 1, &ok);
if(ok) if(ok)
{ {
int queue = QInputDialog::getInteger(this, tr("Queue size..."), "Images buffer size (0 means infinite): ", Settings::getCamera_9queueSize(), 0, 2147483647, 1, &ok); int queue = QInputDialog::getInt(this, tr("Queue size..."), "Images buffer size (0 means infinite): ", Settings::getCamera_9queueSize(), 0, 2147483647, 1, &ok);
if(ok) if(ok)
{ {
Settings::setCamera_6useTcpCamera(true); Settings::setCamera_6useTcpCamera(true);
@ -1073,7 +1073,7 @@ void MainWindow::updateObjects(const QList<int> & ids)
objWidgets_.value(signatures[i]->id())->updateData(signatures[i]->keypoints()); objWidgets_.value(signatures[i]->id())->updateData(signatures[i]->keypoints());
//update object labels //update object labels
QLabel * title = qFindChild<QLabel*>(this, QString("%1title").arg(signatures[i]->id())); QLabel * title = this->findChild<QLabel*>(QString("%1title").arg(signatures[i]->id()));
title->setText(QString("%1 (%2)").arg(signatures[i]->id()).arg(QString::number(signatures[i]->keypoints().size()))); title->setText(QString("%1 (%2)").arg(signatures[i]->id()).arg(QString::number(signatures[i]->keypoints().size())));
} }
} }

View File

@ -34,20 +34,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <opencv2/highgui/highgui.hpp> #include <opencv2/highgui/highgui.hpp>
#include <QtGui/QWidget> #include <QWidget>
#include <QtGui/QContextMenuEvent> #include <QContextMenuEvent>
#include <QtGui/QMenu> #include <QMenu>
#include <QtGui/QMenu> #include <QFileDialog>
#include <QtGui/QFileDialog> #include <QAction>
#include <QtGui/QAction> #include <QGraphicsView>
#include <QtGui/QGraphicsView> #include <QGraphicsScene>
#include <QtGui/QGraphicsScene> #include <QVBoxLayout>
#include <QtGui/QVBoxLayout> #include <QGraphicsRectItem>
#include <QtGui/QGraphicsRectItem> #include <QInputDialog>
#include <QtGui/QInputDialog> #include <QPen>
#include <QtGui/QPen> #include <QLabel>
#include <QtGui/QLabel> #include <QColorDialog>
#include <QtGui/QColorDialog>
#include <QtCore/QDir> #include <QtCore/QDir>

View File

@ -28,14 +28,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "find_object/Settings.h" #include "find_object/Settings.h"
#include "ParametersToolBox.h" #include "ParametersToolBox.h"
#include <QtGui/QComboBox> #include <QComboBox>
#include <QtGui/QDoubleSpinBox> #include <QDoubleSpinBox>
#include <QtGui/QLineEdit> #include <QLineEdit>
#include <QtGui/QLabel> #include <QLabel>
#include <QtGui/QGroupBox> #include <QGroupBox>
#include <QtGui/QCheckBox> #include <QCheckBox>
#include <QtGui/QVBoxLayout> #include <QVBoxLayout>
#include <QtGui/QMessageBox> #include <QMessageBox>
#include <stdio.h> #include <stdio.h>
#include "find_object/utilite/ULogger.h" #include "find_object/utilite/ULogger.h"
#include <opencv2/opencv_modules.hpp> #include <opencv2/opencv_modules.hpp>

View File

@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef PARAMETERSTOOLBOX_H_ #ifndef PARAMETERSTOOLBOX_H_
#define PARAMETERSTOOLBOX_H_ #define PARAMETERSTOOLBOX_H_
#include <QtGui/QToolBox> #include <QToolBox>
class QVBoxLayout; class QVBoxLayout;
class QAbstractButton; class QAbstractButton;

View File

@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QtGui/QPen> #include <QtGui/QPen>
#include <QtGui/QBrush> #include <QtGui/QBrush>
#include <QtGui/QGraphicsScene> #include <QGraphicsScene>
namespace find_object { namespace find_object {
@ -38,7 +38,7 @@ RectItem::RectItem(int id, const QRectF &rect, QGraphicsItem * parent) :
placeHolder_(0), placeHolder_(0),
id_(id) id_(id)
{ {
this->setAcceptsHoverEvents(true); this->setAcceptHoverEvents(true);
this->setFlag(QGraphicsItem::ItemIsFocusable, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true);
this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setFlag(QGraphicsItem::ItemIsSelectable, true);
} }
@ -53,7 +53,7 @@ void RectItem::setColor(const QColor & color)
this->setBrush(QBrush(color)); this->setBrush(QBrush(color));
if(placeHolder_) if(placeHolder_)
{ {
QList<QGraphicsItem *> items = placeHolder_->children(); QList<QGraphicsItem *> items = placeHolder_->childItems();
if(items.size()) if(items.size())
{ {
((QGraphicsTextItem *)items.front())->setDefaultTextColor(this->pen().color().rgb()); ((QGraphicsTextItem *)items.front())->setDefaultTextColor(this->pen().color().rgb());

View File

@ -28,8 +28,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef RECTITEM_H_ #ifndef RECTITEM_H_
#define RECTITEM_H_ #define RECTITEM_H_
#include <QtGui/QGraphicsRectItem> #include <QGraphicsRectItem>
#include <QtGui/QGraphicsTextItem> #include <QGraphicsTextItem>
#include <QtGui/QPen> #include <QtGui/QPen>
#include <QtGui/QBrush> #include <QtGui/QBrush>

View File

@ -125,7 +125,7 @@ void Settings::loadSettings(const QString & fileName)
// (assuming that index < 10... one character for index) // (assuming that index < 10... one character for index)
QChar index = str.at(0); QChar index = str.at(0);
str = getParameter(key).toString(); str = getParameter(key).toString();
str[0] = index.toAscii(); str[0] = index.toLatin1();
value = QVariant(str); value = QVariant(str);
UINFO("Updated list of parameter \"%s\"", key.toStdString().c_str()); UINFO("Updated list of parameter \"%s\"", key.toStdString().c_str());
} }
@ -169,7 +169,7 @@ void Settings::loadSettings(const QString & fileName)
} }
} }
str = getParameter(key).toString(); str = getParameter(key).toString();
str[0] = index.toAscii(); str[0] = index.toLatin1();
value = QVariant(str); value = QVariant(str);
#endif #endif
} }

View File

@ -137,14 +137,7 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="8" column="1">
<widget class="QLabel" name="label_10">
<property name="text">
<string>OpenCV version :</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_version_opencv"> <widget class="QLabel" name="label_version_opencv">
<property name="text"> <property name="text">
<string/> <string/>
@ -154,6 +147,27 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>OpenCV version :</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Qt version :</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_version_qt">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>

View File

@ -22,25 +22,25 @@
#include "utilite/UPlot.h" #include "utilite/UPlot.h"
//#include "utilite/ULogger.h" //#include "utilite/ULogger.h"
#include <QtGui/QGraphicsScene> #include <QGraphicsScene>
#include <QtGui/QGraphicsView> #include <QGraphicsView>
#include <QtGui/QGraphicsItem> #include <QGraphicsItem>
#include <QtGui/QHBoxLayout> #include <QHBoxLayout>
#include <QtGui/QFormLayout> #include <QFormLayout>
#include <QtGui/QResizeEvent> #include <QResizeEvent>
#include <QtCore/QTime> #include <QtCore/QTime>
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <QtGui/QPushButton> #include <QPushButton>
#include <QtGui/QToolButton> #include <QToolButton>
#include <QtGui/QLabel> #include <QLabel>
#include <QtGui/QMenu> #include <QMenu>
#include <QtGui/QInputDialog> #include <QInputDialog>
#include <QtGui/QMessageBox> #include <QMessageBox>
#include <QtGui/QFileDialog> #include <QFileDialog>
#include <QtGui/QClipboard> #include <QClipboard>
#include <QtGui/QApplication> #include <QApplication>
#include <QtGui/QPrinter> #include <QPrinter>
#ifdef QT_SVG_LIB #ifdef QT_SVG_LIB
#include <QtSvg/QSvgGenerator> #include <QtSvg/QSvgGenerator>
#endif #endif
@ -58,7 +58,7 @@ UPlotItem::UPlotItem(qreal dataX, qreal dataY, qreal width) :
_data.setX(dataX); _data.setX(dataX);
_data.setY(dataY); _data.setY(dataY);
this->setZValue(1); this->setZValue(1);
this->setAcceptsHoverEvents(true); this->setAcceptHoverEvents(true);
_text = new QGraphicsTextItem(this); _text = new QGraphicsTextItem(this);
_text->setPlainText(QString("(%1,%2)").arg(_data.x()).arg(_data.y())); _text->setPlainText(QString("(%1,%2)").arg(_data.x()).arg(_data.y()));
_text->setVisible(false); _text->setVisible(false);
@ -72,7 +72,7 @@ UPlotItem::UPlotItem(const QPointF & data, qreal width) :
_nextItem(0) _nextItem(0)
{ {
this->setZValue(1); this->setZValue(1);
this->setAcceptsHoverEvents(true); this->setAcceptHoverEvents(true);
_text = new QGraphicsTextItem(this); _text = new QGraphicsTextItem(this);
_text->setPlainText(QString("(%1,%2)").arg(_data.x()).arg(_data.y())); _text->setPlainText(QString("(%1,%2)").arg(_data.x()).arg(_data.y()));
_text->setVisible(false); _text->setVisible(false);
@ -1593,7 +1593,7 @@ void UPlot::setupUi()
_view->setScene(new QGraphicsScene(0,0,0,0,this)); _view->setScene(new QGraphicsScene(0,0,0,0,this));
_view->setStyleSheet( "QGraphicsView { border-style: none; }" ); _view->setStyleSheet( "QGraphicsView { border-style: none; }" );
_sceneRoot = _view->scene()->addText(""); _sceneRoot = _view->scene()->addText("");
_sceneRoot->translate(0,0); _sceneRoot->setPos(0,0);
_graphicsViewHolder = new QWidget(this); _graphicsViewHolder = new QWidget(this);
_graphicsViewHolder->setMinimumSize(100,100); _graphicsViewHolder->setMinimumSize(100,100);
_verticalAxis = new UPlotAxis(Qt::Vertical, 0, 1, this); _verticalAxis = new UPlotAxis(Qt::Vertical, 0, 1, this);

View File

@ -24,15 +24,15 @@
//#include "utilite/UtiLiteExp.h" // DLL export/import defines //#include "utilite/UtiLiteExp.h" // DLL export/import defines
#include <QtGui/QFrame> #include <QFrame>
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QMap> #include <QtCore/QMap>
#include <QtGui/QPen> #include <QtGui/QPen>
#include <QtGui/QBrush> #include <QtGui/QBrush>
#include <QtGui/QGraphicsEllipseItem> #include <QGraphicsEllipseItem>
#include <QtCore/QMutex> #include <QtCore/QMutex>
#include <QtGui/QLabel> #include <QLabel>
#include <QtGui/QPushButton> #include <QPushButton>
#include <QtCore/QTime> #include <QtCore/QTime>
class QGraphicsView; class QGraphicsView;

View File

@ -24,5 +24,5 @@ SET_TARGET_PROPERTIES( similarity
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-similarity) PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-similarity)
INSTALL(TARGETS similarity INSTALL(TARGETS similarity
RUNTIME DESTINATION bin COMPONENT runtime RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime) BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)

View File

@ -1,10 +1,15 @@
### Qt Gui stuff ###
SET(headers_ui SET(headers_ui
TcpClient.h TcpClient.h
) )
#This will generate moc_* for Qt
QT4_WRAP_CPP(moc_srcs ${headers_ui}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
### Qt Gui stuff end### #This will generate moc_* for Qt
QT4_WRAP_CPP(moc_srcs ${headers_ui})
### Qt Gui stuff end###
ELSE()
QT5_WRAP_CPP(moc_srcs ${headers_ui})
ENDIF()
SET(SRC_FILES SET(SRC_FILES
TcpClient.cpp TcpClient.cpp
@ -18,7 +23,9 @@ SET(INCLUDE_DIRS
${OpenCV_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}
) )
INCLUDE(${QT_USE_FILE}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
INCLUDE(${QT_USE_FILE})
ENDIF()
SET(LIBRARIES SET(LIBRARIES
${OpenCV_LIBS} ${OpenCV_LIBS}
@ -32,10 +39,13 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# The extension is automatically found. # The extension is automatically found.
ADD_EXECUTABLE(tcpClient ${SRC_FILES}) ADD_EXECUTABLE(tcpClient ${SRC_FILES})
TARGET_LINK_LIBRARIES(tcpClient ${LIBRARIES}) TARGET_LINK_LIBRARIES(tcpClient ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
QT5_USE_MODULES(tcpClient Widgets Core Gui Network PrintSupport)
ENDIF()
SET_TARGET_PROPERTIES( tcpClient SET_TARGET_PROPERTIES( tcpClient
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpClient) PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpClient)
INSTALL(TARGETS tcpClient INSTALL(TARGETS tcpClient
RUNTIME DESTINATION bin COMPONENT runtime RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime) BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)

View File

@ -1,10 +1,15 @@
### Qt Gui stuff ###
SET(headers_ui SET(headers_ui
ImagesTcpServer.h ImagesTcpServer.h
) )
#This will generate moc_* for Qt
QT4_WRAP_CPP(moc_srcs ${headers_ui}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
### Qt Gui stuff end### #This will generate moc_* for Qt
QT4_WRAP_CPP(moc_srcs ${headers_ui})
### Qt Gui stuff end###
ELSE()
QT5_WRAP_CPP(moc_srcs ${headers_ui})
ENDIF()
SET(SRC_FILES SET(SRC_FILES
ImagesTcpServer.cpp ImagesTcpServer.cpp
@ -18,7 +23,9 @@ SET(INCLUDE_DIRS
${OpenCV_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}
) )
INCLUDE(${QT_USE_FILE}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
INCLUDE(${QT_USE_FILE})
ENDIF()
SET(LIBRARIES SET(LIBRARIES
${OpenCV_LIBS} ${OpenCV_LIBS}
@ -32,11 +39,14 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# The extension is automatically found. # The extension is automatically found.
ADD_EXECUTABLE(tcpImagesServer ${SRC_FILES}) ADD_EXECUTABLE(tcpImagesServer ${SRC_FILES})
TARGET_LINK_LIBRARIES(tcpImagesServer find_object ${LIBRARIES}) TARGET_LINK_LIBRARIES(tcpImagesServer find_object ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
QT5_USE_MODULES(tcpImagesServer Widgets Core Gui Network PrintSupport)
ENDIF()
SET_TARGET_PROPERTIES( tcpImagesServer SET_TARGET_PROPERTIES( tcpImagesServer
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpImagesServer) PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpImagesServer)
INSTALL(TARGETS tcpImagesServer INSTALL(TARGETS tcpImagesServer
RUNTIME DESTINATION bin COMPONENT runtime RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime) BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)

View File

@ -1,10 +1,15 @@
### Qt Gui stuff ###
SET(headers_ui SET(headers_ui
TcpResponse.h TcpResponse.h
) )
#This will generate moc_* for Qt
QT4_WRAP_CPP(moc_srcs ${headers_ui}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
### Qt Gui stuff end### #This will generate moc_* for Qt
QT4_WRAP_CPP(moc_srcs ${headers_ui})
### Qt Gui stuff end###
ELSE()
QT5_WRAP_CPP(moc_srcs ${headers_ui})
ENDIF()
SET(SRC_FILES SET(SRC_FILES
TcpResponse.cpp TcpResponse.cpp
@ -18,7 +23,10 @@ SET(INCLUDE_DIRS
${OpenCV_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}
) )
INCLUDE(${QT_USE_FILE}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
INCLUDE(${QT_USE_FILE})
ENDIF()
SET(LIBRARIES SET(LIBRARIES
${OpenCV_LIBS} ${OpenCV_LIBS}
@ -32,11 +40,14 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# The extension is automatically found. # The extension is automatically found.
ADD_EXECUTABLE(tcpRequest ${SRC_FILES}) ADD_EXECUTABLE(tcpRequest ${SRC_FILES})
TARGET_LINK_LIBRARIES(tcpRequest find_object ${LIBRARIES}) TARGET_LINK_LIBRARIES(tcpRequest find_object ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
QT5_USE_MODULES(tcpRequest Widgets Core Gui Network PrintSupport)
ENDIF()
SET_TARGET_PROPERTIES( tcpRequest SET_TARGET_PROPERTIES( tcpRequest
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpRequest) PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpRequest)
INSTALL(TARGETS tcpRequest INSTALL(TARGETS tcpRequest
RUNTIME DESTINATION bin COMPONENT runtime RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime) BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)

View File

@ -9,7 +9,9 @@ SET(INCLUDE_DIRS
${OpenCV_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}
) )
INCLUDE(${QT_USE_FILE}) IF("${FINDOBJECT_QT_VERSION}" STREQUAL "4")
INCLUDE(${QT_USE_FILE})
ENDIF()
SET(LIBRARIES SET(LIBRARIES
${OpenCV_LIBS} ${OpenCV_LIBS}
@ -23,11 +25,14 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# The extension is automatically found. # The extension is automatically found.
ADD_EXECUTABLE(tcpService ${SRC_FILES}) ADD_EXECUTABLE(tcpService ${SRC_FILES})
TARGET_LINK_LIBRARIES(tcpService find_object ${LIBRARIES}) TARGET_LINK_LIBRARIES(tcpService find_object ${LIBRARIES})
IF("${FINDOBJECT_QT_VERSION}" STREQUAL "5")
QT5_USE_MODULES(tcpService Widgets Core Gui Network PrintSupport)
ENDIF()
SET_TARGET_PROPERTIES( tcpService SET_TARGET_PROPERTIES( tcpService
PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpService) PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-tcpService)
INSTALL(TARGETS tcpService INSTALL(TARGETS tcpService
RUNTIME DESTINATION bin COMPONENT runtime RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime) BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime)