From Kristofer Tingdahl, with additions from Riccardo Corsi and Robert Milharcic, support for Qt5 build
This commit is contained in:
@@ -81,14 +81,14 @@ IF(CMAKE_SYSTEM MATCHES IRIX)
|
||||
ENDIF(CMAKE_SYSTEM MATCHES IRIX)
|
||||
|
||||
# Add support for using Qt threads
|
||||
IF(QT4_FOUND)
|
||||
IF(QT4_FOUND OR Qt5Widgets_FOUND)
|
||||
OPTION(BUILD_OPENTHREADS_WITH_QT "Build OpenThreads with Qt threading support." OFF)
|
||||
ENDIF()
|
||||
|
||||
# Maybe we should be using the FindThreads.cmake module?
|
||||
IF(ANDROID)
|
||||
SUBDIRS(pthreads)
|
||||
ELSEIF(QT4_FOUND AND BUILD_OPENTHREADS_WITH_QT)
|
||||
ELSEIF((QT4_FOUND OR Qt5Widgets_FOUND) AND BUILD_OPENTHREADS_WITH_QT)
|
||||
SUBDIRS(qt)
|
||||
ELSEIF(WIN32)
|
||||
# So I think Cygwin wants to use pthreads
|
||||
|
||||
@@ -39,8 +39,15 @@ IF(OPENTHREADS_SONAMES)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${OPENTHREADS_VERSION} SOVERSION ${OPENTHREADS_SOVERSION})
|
||||
ENDIF()
|
||||
|
||||
TARGET_LINK_LIBRARIES(${LIB_NAME} ${QT_QTCORE_LIBRARY})
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||
if ( QT4_FOUND )
|
||||
TARGET_LINK_LIBRARIES(${LIB_NAME} ${QT_QTCORE_LIBRARY})
|
||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||
else( QT4_FOUND )
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
qt5_use_modules( ${LIB_NAME} Core )
|
||||
ENDIF ( Qt5Widgets_FOUND )
|
||||
|
||||
endif( QT4_FOUND )
|
||||
|
||||
# Since we're building different platforms binaries in
|
||||
# their respective directories, we need to set the
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#define _QTCONDITIONPRIVATEDATA_H_
|
||||
|
||||
#include <OpenThreads/Condition>
|
||||
#include <QtCore/QWaitCondition>
|
||||
#include <QWaitCondition>
|
||||
|
||||
class QtConditionPrivateData : public QWaitCondition
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#define _QTMUTEXPRIVATEDATA_H_
|
||||
|
||||
#include <OpenThreads/Mutex>
|
||||
#include <QtCore/QMutex>
|
||||
#include <QMutex>
|
||||
|
||||
class QtMutexPrivateData : public QMutex
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// ~~~~~~~~~~~
|
||||
|
||||
#include "QtThreadPrivateData.h"
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QCoreApplication>
|
||||
#include <iostream>
|
||||
|
||||
using namespace OpenThreads;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <OpenThreads/Thread>
|
||||
#include <OpenThreads/Block>
|
||||
#include <QtCore/QThread>
|
||||
#include <QThread>
|
||||
|
||||
struct QtThreadCanceled {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user