summaryrefslogtreecommitdiff
path: root/Source/QtDialog
diff options
context:
space:
mode:
Diffstat (limited to 'Source/QtDialog')
-rw-r--r--Source/QtDialog/CMakeLists.txt218
-rw-r--r--Source/QtDialog/CMakeSetup.cxx18
-rw-r--r--Source/QtDialog/Compilers.h2
-rw-r--r--Source/QtDialog/FirstConfigure.cxx16
-rw-r--r--Source/QtDialog/FirstConfigure.h26
-rw-r--r--Source/QtDialog/QCMake.cxx28
-rw-r--r--Source/QtDialog/QCMake.h12
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx70
-rw-r--r--Source/QtDialog/QCMakeCacheView.h18
-rw-r--r--Source/QtDialog/QCMakeWidgets.cxx2
-rw-r--r--Source/QtDialog/QMacInstallDialog.cxx18
-rw-r--r--Source/QtDialog/QtDialogCPack.cmake.in22
12 files changed, 235 insertions, 215 deletions
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 07ec106..29daffd 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -9,115 +9,131 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-PROJECT(QtDialog)
-SET(QT_MIN_VERSION "4.4.0")
-FIND_PACKAGE(Qt4 REQUIRED)
-IF(NOT QT4_FOUND)
- MESSAGE(SEND_ERROR "Failed to find Qt 4.4 or greater.")
-ELSE(NOT QT4_FOUND)
+project(QtDialog)
+find_package(Qt5Widgets QUIET)
+if (Qt5Widgets_FOUND)
+ include_directories(${Qt5Widgets_INCLUDE_DIRS})
+ add_definitions(${Qt5Widgets_DEFINITONS})
+ macro(qt4_wrap_ui)
+ qt5_wrap_ui(${ARGN})
+ endmacro()
+ macro(qt4_wrap_cpp)
+ qt5_wrap_cpp(${ARGN})
+ endmacro()
+ macro(qt4_add_resources)
+ qt5_add_resources(${ARGN})
+ endmacro()
+ set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ # Remove this when the minimum version of Qt is 4.6.
+ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
+else()
+ set(QT_MIN_VERSION "4.4.0")
+ find_package(Qt4 REQUIRED)
+ if(NOT QT4_FOUND)
+ message(SEND_ERROR "Failed to find Qt 4.4 or greater.")
+ return()
+ endif()
- INCLUDE(${QT_USE_FILE})
- SET(CMAKE_PACKAGE_QTGUI TRUE)
- SET(SRCS
- AddCacheEntry.cxx
- AddCacheEntry.h
- CMakeSetup.cxx
- CMakeSetupDialog.cxx
- CMakeSetupDialog.h
- FirstConfigure.cxx
- FirstConfigure.h
- QCMake.cxx
- QCMake.h
- QCMakeCacheView.cxx
- QCMakeCacheView.h
- QCMakeWidgets.cxx
- QCMakeWidgets.h
- QMacInstallDialog.cxx
- QMacInstallDialog.h
- )
- QT4_WRAP_UI(UI_SRCS
- CMakeSetupDialog.ui
- Compilers.ui
- CrossCompiler.ui
- AddCacheEntry.ui
- MacInstallDialog.ui
- )
- QT4_WRAP_CPP(MOC_SRCS
- AddCacheEntry.h
- Compilers.h
- CMakeSetupDialog.h
- FirstConfigure.h
- QCMake.h
- QCMakeCacheView.h
- QCMakeWidgets.h
- QMacInstallDialog.h
- )
- QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc)
+ include(${QT_USE_FILE})
+endif()
- SET(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS})
- IF(Q_WS_WIN)
- SET(SRCS ${SRCS} CMakeSetup.rc)
- ENDIF(Q_WS_WIN)
- IF(Q_WS_MAC)
- SET(SRCS ${SRCS} CMakeSetup.icns)
- SET(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
- SET_SOURCE_FILES_PROPERTIES(CMakeSetup.icns PROPERTIES
- MACOSX_PACKAGE_LOCATION Resources)
- ENDIF(Q_WS_MAC)
+set(SRCS
+ AddCacheEntry.cxx
+ AddCacheEntry.h
+ CMakeSetup.cxx
+ CMakeSetupDialog.cxx
+ CMakeSetupDialog.h
+ FirstConfigure.cxx
+ FirstConfigure.h
+ QCMake.cxx
+ QCMake.h
+ QCMakeCacheView.cxx
+ QCMakeCacheView.h
+ QCMakeWidgets.cxx
+ QCMakeWidgets.h
+ QMacInstallDialog.cxx
+ QMacInstallDialog.h
+ )
+QT4_WRAP_UI(UI_SRCS
+ CMakeSetupDialog.ui
+ Compilers.ui
+ CrossCompiler.ui
+ AddCacheEntry.ui
+ MacInstallDialog.ui
+ )
+QT4_WRAP_CPP(MOC_SRCS
+ AddCacheEntry.h
+ Compilers.h
+ CMakeSetupDialog.h
+ FirstConfigure.h
+ QCMake.h
+ QCMakeCacheView.h
+ QCMakeWidgets.h
+ QMacInstallDialog.h
+ )
+QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc)
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS})
+if(WIN32)
+ set(SRCS ${SRCS} CMakeSetup.rc)
+endif()
+if(APPLE)
+ set(SRCS ${SRCS} CMakeSetup.icns)
+ set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
+ set_source_files_properties(CMakeSetup.icns PROPERTIES
+ MACOSX_PACKAGE_LOCATION Resources)
+endif()
- ADD_EXECUTABLE(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
- TARGET_LINK_LIBRARIES(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES})
- IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
- IF(APPLE)
- SET_TARGET_PROPERTIES(cmake-gui PROPERTIES
- OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
- ENDIF(APPLE)
- SET(CMAKE_INSTALL_DESTINATION_ARGS
- BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}")
- ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
- INSTALL(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS})
+add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
+target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES})
- IF(UNIX)
- # install a desktop file so CMake appears in the application start menu
- # with an icon
- INSTALL(FILES CMake.desktop DESTINATION share/applications )
- INSTALL(FILES CMakeSetup32.png DESTINATION share/pixmaps )
- INSTALL(FILES cmakecache.xml DESTINATION share/mime/packages )
- ENDIF(UNIX)
+if(APPLE)
+ set_target_properties(cmake-gui PROPERTIES
+ OUTPUT_NAME ${CMAKE_BUNDLE_NAME})
+endif()
+set(CMAKE_INSTALL_DESTINATION_ARGS
+ BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}")
- IF(APPLE)
- SET(CMAKE_POSTFLIGHT_SCRIPT
- "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
- SET(CMAKE_POSTUPGRADE_SCRIPT
- "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
- configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postflight.sh.in"
- "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
- configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in"
- "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
- INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui
- WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
- ENDIF(APPLE)
+install(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS})
- if(APPLE OR WIN32)
- # install rules for including 3rd party libs such as Qt
- # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation
- set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}")
- if(APPLE)
- set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
- endif(APPLE)
- install(CODE "
- include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\")
- set(BU_CHMOD_BUNDLE_ITEMS ON)
- fixup_bundle(\"${fixup_exe}\" \"\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\")
- ")
- endif(APPLE OR WIN32)
+if(UNIX)
+ # install a desktop file so CMake appears in the application start menu
+ # with an icon
+ install(FILES CMake.desktop DESTINATION share/applications )
+ install(FILES CMakeSetup32.png DESTINATION share/pixmaps )
+ install(FILES cmakecache.xml DESTINATION share/mime/packages )
+endif()
- CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in"
- "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY)
-ENDIF(NOT QT4_FOUND)
+if(APPLE)
+ set(CMAKE_POSTFLIGHT_SCRIPT
+ "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
+ set(CMAKE_POSTUPGRADE_SCRIPT
+ "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
+ configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postflight.sh.in"
+ "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh")
+ configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in"
+ "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh")
+ install(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui
+ WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)")
+endif()
+if(APPLE OR WIN32)
+ # install rules for including 3rd party libs such as Qt
+ # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation
+ set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}")
+ if(APPLE)
+ set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
+ endif()
+ install(CODE "
+ include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\")
+ set(BU_CHMOD_BUNDLE_ITEMS ON)
+ fixup_bundle(\"${fixup_exe}\" \"\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\")
+ ")
+endif()
+
+set(CMAKE_PACKAGE_QTGUI TRUE)
+configure_file("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in"
+ "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY)
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index c942bc4..01893f5 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -99,15 +99,15 @@ int main(int argc, char** argv)
}
QApplication app(argc, argv);
-
+
// clean out standard Qt paths for plugins, which we don't use anyway
// when creating Mac bundles, it potentially causes problems
foreach(QString p, QApplication::libraryPaths())
{
QApplication::removeLibraryPath(p);
}
-
- // if arg for install
+
+ // if arg for install
for(int i =0; i < argc; i++)
{
if(strcmp(argv[i], "--mac-install") == 0)
@@ -117,7 +117,7 @@ int main(int argc, char** argv)
return 0;
}
}
- // tell the cmake library where cmake is
+ // tell the cmake library where cmake is
QDir cmExecDir(QApplication::applicationDirPath());
#if defined(Q_OS_MAC)
cmExecDir.cd("../../../");
@@ -131,7 +131,7 @@ int main(int argc, char** argv)
QString transfile = QString("cmake_%1").arg(QLocale::system().name());
translator.load(transfile, translationsDir.path());
app.installTranslator(&translator);
-
+
// app setup
app.setApplicationName("CMakeSetup");
app.setOrganizationName("Kitware");
@@ -139,16 +139,16 @@ int main(int argc, char** argv)
appIcon.addFile(":/Icons/CMakeSetup32.png");
appIcon.addFile(":/Icons/CMakeSetup128.png");
app.setWindowIcon(appIcon);
-
+
CMakeSetupDialog dialog;
dialog.show();
-
+
cmsys::CommandLineArguments arg;
arg.Initialize(argc, argv);
std::string binaryDirectory;
std::string sourceDirectory;
typedef cmsys::CommandLineArguments argT;
- arg.AddArgument("-B", argT::CONCAT_ARGUMENT,
+ arg.AddArgument("-B", argT::CONCAT_ARGUMENT,
&binaryDirectory, "Binary Directory");
arg.AddArgument("-H", argT::CONCAT_ARGUMENT,
&sourceDirectory, "Source Directory");
@@ -199,7 +199,7 @@ int main(int argc, char** argv)
}
}
}
-
+
return app.exec();
}
diff --git a/Source/QtDialog/Compilers.h b/Source/QtDialog/Compilers.h
index e9c90a5..3f7b834 100644
--- a/Source/QtDialog/Compilers.h
+++ b/Source/QtDialog/Compilers.h
@@ -10,7 +10,7 @@ class Compilers : public QWidget, public Ui::Compilers
{
Q_OBJECT
public:
- Compilers(QWidget* p=NULL) :
+ Compilers(QWidget* p=NULL) :
QWidget(p)
{
this->setupUi(this);
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx
index 2a79877..6de9f00 100644
--- a/Source/QtDialog/FirstConfigure.cxx
+++ b/Source/QtDialog/FirstConfigure.cxx
@@ -25,7 +25,7 @@ StartCompilerSetup::StartCompilerSetup(QWidget* p)
l->addWidget(this->CompilerSetupOptions[1]);
l->addWidget(this->CompilerSetupOptions[2]);
l->addWidget(this->CompilerSetupOptions[3]);
-
+
this->CompilerSetupOptions[0]->setChecked(true);
QObject::connect(this->CompilerSetupOptions[0], SIGNAL(toggled(bool)),
@@ -47,7 +47,7 @@ void StartCompilerSetup::setGenerators(const QStringList& gens)
this->GeneratorOptions->clear();
this->GeneratorOptions->addItems(gens);
};
-
+
void StartCompilerSetup::setCurrentGenerator(const QString& gen)
{
int idx = this->GeneratorOptions->findText(gen);
@@ -237,7 +237,7 @@ void CrossCompilerSetup::setProcessor(const QString& t)
{
this->systemProcessor->setText(t);
}
-
+
QString CrossCompilerSetup::getFindRoot() const
{
return this->crossFindRoot->text();
@@ -313,10 +313,10 @@ FirstConfigure::FirstConfigure()
this->mNativeCompilerSetupPage = new NativeCompilerSetup(this);
this->setPage(NativeSetup, this->mNativeCompilerSetupPage);
-
+
this->mCrossCompilerSetupPage = new CrossCompilerSetup(this);
this->setPage(CrossSetup, this->mCrossCompilerSetupPage);
-
+
this->mToolchainCompilerSetupPage = new ToolchainCompilerSetup(this);
this->setPage(ToolchainSetup, this->mToolchainCompilerSetupPage);
}
@@ -370,14 +370,14 @@ void FirstConfigure::loadFromSettings()
void FirstConfigure::saveToSettings()
{
QSettings settings;
-
+
// save generator
settings.beginGroup("Settings/StartPath");
QString lastGen = this->mStartCompilerSetupPage->getGenerator();
settings.setValue("LastGenerator", lastGen);
settings.endGroup();
- // save compiler setup
+ // save compiler setup
settings.beginGroup("Settings/Compiler");
settings.setValue("CCompiler", this->mNativeCompilerSetupPage->getCCompiler());
settings.setValue("CXXCompiler", this->mNativeCompilerSetupPage->getCXXCompiler());
@@ -419,7 +419,7 @@ bool FirstConfigure::crossCompilerToolChainFile() const
{
return this->mStartCompilerSetupPage->crossCompilerToolChainFile();
}
-
+
QString FirstConfigure::getCrossCompilerToolChainFile() const
{
return this->mToolchainCompilerSetupPage->toolchainFile();
diff --git a/Source/QtDialog/FirstConfigure.h b/Source/QtDialog/FirstConfigure.h
index f4e368b..be390b0 100644
--- a/Source/QtDialog/FirstConfigure.h
+++ b/Source/QtDialog/FirstConfigure.h
@@ -30,14 +30,14 @@ class StartCompilerSetup : public QWizardPage
void setGenerators(const QStringList& gens);
void setCurrentGenerator(const QString& gen);
QString getGenerator() const;
-
+
bool defaultSetup() const;
bool compilerSetup() const;
bool crossCompilerSetup() const;
bool crossCompilerToolChainFile() const;
int nextId() const;
-
+
signals:
void selectionChanged();
@@ -56,7 +56,7 @@ class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers
public:
NativeCompilerSetup(QWidget* p);
~NativeCompilerSetup();
-
+
QString getCCompiler() const;
void setCCompiler(const QString&);
@@ -65,7 +65,7 @@ class NativeCompilerSetup : public QWizardPage, protected Ui::Compilers
QString getFortranCompiler() const;
void setFortranCompiler(const QString&);
-
+
int nextId() const { return -1; }
};
@@ -76,13 +76,13 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
public:
CrossCompilerSetup(QWidget* p);
~CrossCompilerSetup();
-
+
QString getSystem() const;
void setSystem(const QString&);
-
+
QString getVersion() const;
void setVersion(const QString&);
-
+
QString getProcessor() const;
void setProcessor(const QString&);
@@ -94,7 +94,7 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
QString getFortranCompiler() const;
void setFortranCompiler(const QString&);
-
+
QString getFindRoot() const;
void setFindRoot(const QString&);
@@ -104,14 +104,14 @@ class CrossCompilerSetup : public QWizardPage, protected Ui::CrossCompiler
ONLY,
NEVER
};
-
+
int getProgramMode() const;
void setProgramMode(int);
int getLibraryMode() const;
void setLibraryMode(int);
int getIncludeMode() const;
void setIncludeMode(int);
-
+
int nextId() const { return -1; }
};
@@ -127,7 +127,7 @@ class ToolchainCompilerSetup : public QWizardPage
void setToolchainFile(const QString&);
int nextId() const { return -1; }
-
+
protected:
QCMakeFilePathEditor* ToolchainFile;
};
@@ -151,7 +151,7 @@ public:
QString getCCompiler() const;
QString getCXXCompiler() const;
QString getFortranCompiler() const;
-
+
QString getSystemName() const;
QString getSystemVersion() const;
QString getSystemProcessor() const;
@@ -159,7 +159,7 @@ public:
QString getCrossProgramMode() const;
QString getCrossLibraryMode() const;
QString getCrossIncludeMode() const;
-
+
QString getCrossCompilerToolChainFile() const;
void loadFromSettings();
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 8554ff8..0d01181 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -32,9 +32,9 @@ QCMake::QCMake(QObject* p)
this->WarnUnusedMode = false;
qRegisterMetaType<QCMakeProperty>();
qRegisterMetaType<QCMakePropertyList>();
-
+
QDir execDir(QCoreApplication::applicationDirPath());
-
+
#if defined(Q_OS_MAC)
if(execDir.exists("../bin/cmake"))
{
@@ -45,7 +45,7 @@ QCMake::QCMake(QObject* p)
execDir.cd("../../../"); // path to cmake in build directory (need to fix for deployment)
}
#endif
-
+
QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension());
cmakeCommand = execDir.filePath(cmakeCommand);
@@ -58,7 +58,7 @@ QCMake::QCMake(QObject* p)
this->CMakeInstance->SetCMakeCommand(cmakeCommand.toLocal8Bit().data());
#if defined(Q_OS_MAC)
this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui");
-#else
+#else
this->CMakeInstance->SetCMakeEditCommand("cmake-gui");
#endif
this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
@@ -96,7 +96,7 @@ void QCMake::loadCache(const QString& dir)
void QCMake::setSourceDirectory(const QString& _dir)
{
- QString dir =
+ QString dir =
QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str());
if(this->SourceDirectory != dir)
{
@@ -107,7 +107,7 @@ void QCMake::setSourceDirectory(const QString& _dir)
void QCMake::setBinaryDirectory(const QString& _dir)
{
- QString dir =
+ QString dir =
QString::fromLocal8Bit(cmSystemTools::GetActualCaseForPath(_dir.toLocal8Bit().data()).c_str());
if(this->BinaryDirectory != dir)
{
@@ -126,7 +126,7 @@ void QCMake::setBinaryDirectory(const QString& _dir)
"Please check the permissions of the directory you are trying to run CMake on.");
}
}
-
+
QCMakePropertyList props = this->properties();
emit this->propertiesChanged(props);
cmCacheManager::CacheIterator itm = cachem->NewIterator();
@@ -202,7 +202,7 @@ void QCMake::generate()
emit this->generateDone(err);
}
-
+
void QCMake::setProperties(const QCMakePropertyList& newProps)
{
QCMakePropertyList props = newProps;
@@ -251,7 +251,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
cachem->RemoveCacheEntry(s.toLocal8Bit().data());
}
-
+
// add some new properites
foreach(QCMakeProperty s, props)
{
@@ -286,7 +286,7 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
cmCacheManager::FILEPATH);
}
}
-
+
cachem->SaveCache(this->BinaryDirectory.toLocal8Bit().data());
}
@@ -339,7 +339,7 @@ QCMakePropertyList QCMake::properties() const
return ret;
}
-
+
void QCMake::interrupt()
{
this->InterruptFlag.ref();
@@ -348,7 +348,11 @@ void QCMake::interrupt()
bool QCMake::interruptCallback(void* cd)
{
QCMake* self = reinterpret_cast<QCMake*>(cd);
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
return self->InterruptFlag;
+#else
+ return self->InterruptFlag.load();
+#endif
}
void QCMake::progressCallback(const char* msg, float percent, void* cd)
@@ -416,7 +420,7 @@ void QCMake::reloadCache()
props = this->properties();
emit this->propertiesChanged(props);
}
-
+
void QCMake::setDebugOutput(bool flag)
{
if(flag != this->CMakeInstance->GetDebugOutput())
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index 0d68586..93ac8ab 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -38,12 +38,12 @@ struct QCMakeProperty
QString Help;
PropertyType Type;
bool Advanced;
- bool operator==(const QCMakeProperty& other) const
- {
+ bool operator==(const QCMakeProperty& other) const
+ {
return this->Key == other.Key;
}
- bool operator<(const QCMakeProperty& other) const
- {
+ bool operator<(const QCMakeProperty& other) const
+ {
return this->Key < other.Key;
}
};
@@ -56,7 +56,7 @@ Q_DECLARE_METATYPE(QCMakeProperty)
Q_DECLARE_METATYPE(QCMakePropertyList)
/// Qt API for CMake library.
-/// Wrapper like class allows for easier integration with
+/// Wrapper like class allows for easier integration with
/// Qt features such as, signal/slot connections, multi-threading, etc..
class QCMake : public QObject
{
@@ -136,7 +136,7 @@ protected:
static bool interruptCallback(void*);
static void progressCallback(const char* msg, float percent, void* cd);
- static void errorCallback(const char* msg, const char* title,
+ static void errorCallback(const char* msg, const char* title,
bool&, void* cd);
bool SuppressDevWarnings;
bool WarnUninitializedMode;
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 72e9b24..1d21d42 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -64,7 +64,7 @@ protected:
return true;
}
}
-
+
return false;
}
};
@@ -73,11 +73,11 @@ protected:
class QCMakeAdvancedFilter : public QSortFilterProxyModel
{
public:
- QCMakeAdvancedFilter(QObject* o)
+ QCMakeAdvancedFilter(QObject* o)
: QSortFilterProxyModel(o), ShowAdvanced(false) {}
- void setShowAdvanced(bool f)
- {
+ void setShowAdvanced(bool f)
+ {
this->ShowAdvanced = f;
this->invalidate();
}
@@ -102,7 +102,7 @@ protected:
}
return false;
}
-
+
// check children
int num = m->rowCount(idx);
for(int i=0; i<num; i++)
@@ -134,9 +134,9 @@ QCMakeCacheView::QCMakeCacheView(QWidget* p)
// our delegate for creating our editors
QCMakeCacheModelDelegate* delegate = new QCMakeCacheModelDelegate(this);
this->setItemDelegate(delegate);
-
+
this->setUniformRowHeights(true);
-
+
this->setEditTriggers(QAbstractItemView::AllEditTriggers);
// tab, backtab doesn't step through items
@@ -153,13 +153,13 @@ bool QCMakeCacheView::event(QEvent* e)
}
return QTreeView::event(e);
}
-
+
QCMakeCacheModel* QCMakeCacheView::cacheModel() const
{
return this->CacheModel;
}
-
-QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
+
+QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
Qt::KeyboardModifiers mod)
{
// want home/end to go to begin/end of rows, not columns
@@ -173,7 +173,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
}
return QTreeView::moveCursor(act, mod);
}
-
+
void QCMakeCacheView::setShowAdvanced(bool s)
{
#if QT_VERSION >= 040300
@@ -224,7 +224,7 @@ void QCMakeCacheModel::clear()
{
this->QStandardItemModel::clear();
this->NewPropertyCount = 0;
-
+
QStringList labels;
labels << tr("Name") << tr("Value");
this->setHorizontalHeaderLabels(labels);
@@ -281,7 +281,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
this->breakProperties(newProps2, newPropsTree2);
QStandardItem* root = this->invisibleRootItem();
-
+
foreach(QString key, newPropsTree.keys())
{
QCMakePropertyList props2 = newPropsTree[key];
@@ -308,12 +308,12 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
this->setPropertyData(this->indexFromItem(items[0]), prop, true);
}
}
-
+
foreach(QString key, newPropsTree2.keys())
{
QCMakePropertyList props2 = newPropsTree2[key];
- QStandardItem* parentItem =
+ QStandardItem* parentItem =
new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key);
root->appendRow(parentItem);
parentItem->setData(1, GroupRole);
@@ -330,7 +330,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
}
}
}
-
+
this->blockSignals(b);
this->reset();
}
@@ -361,7 +361,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t)
this->reset();
}
-void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
+void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
const QCMakeProperty& prop, bool isNew)
{
QModelIndex idx2 = idx1.sibling(idx1.row(), 1);
@@ -370,7 +370,7 @@ void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
this->setData(idx1, prop.Help, QCMakeCacheModel::HelpRole);
this->setData(idx1, prop.Type, QCMakeCacheModel::TypeRole);
this->setData(idx1, prop.Advanced, QCMakeCacheModel::AdvancedRole);
-
+
if(prop.Type == QCMakeProperty::BOOL)
{
int check = prop.Value.toBool() ? Qt::Checked : Qt::Unchecked;
@@ -394,7 +394,7 @@ void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
}
}
-void QCMakeCacheModel::getPropertyData(const QModelIndex& idx1,
+void QCMakeCacheModel::getPropertyData(const QModelIndex& idx1,
QCMakeProperty& prop) const
{
QModelIndex idx2 = idx1.sibling(idx1.row(), 1);
@@ -457,7 +457,7 @@ void QCMakeCacheModel::breakProperties(const QSet<QCMakeProperty>& props,
}
result = tmp;
}
-
+
QCMakePropertyList QCMakeCacheModel::properties() const
{
QCMakePropertyList props;
@@ -488,7 +488,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const
this->getPropertyData(idx, prop);
props.append(prop);
}
-
+
// go to the next in the tree
while(!idxs.isEmpty() && !idxs.last().sibling(idxs.last().row()+1, 0).isValid())
{
@@ -503,7 +503,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const
return props;
}
-
+
bool QCMakeCacheModel::insertProperty(QCMakeProperty::PropertyType t,
const QString& name, const QString& description,
const QVariant& value, bool advanced)
@@ -554,7 +554,7 @@ Qt::ItemFlags QCMakeCacheModel::flags (const QModelIndex& idx) const
QModelIndex QCMakeCacheModel::buddy(const QModelIndex& idx) const
{
- if(!this->hasChildren(idx) &&
+ if(!this->hasChildren(idx) &&
this->data(idx, TypeRole).toInt() != QCMakeProperty::BOOL)
{
return this->index(idx.row(), 1, idx.parent());
@@ -572,7 +572,7 @@ void QCMakeCacheModelDelegate::setFileDialogFlag(bool f)
this->FileDialogFlag = f;
}
-QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
+QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
const QStyleOptionViewItem&, const QModelIndex& idx) const
{
QModelIndex var = idx.sibling(idx.row(), 0);
@@ -584,7 +584,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
else if(type == QCMakeProperty::PATH)
{
QCMakePathEditor* editor =
- new QCMakePathEditor(p,
+ new QCMakePathEditor(p,
var.data(Qt::DisplayRole).toString());
QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this,
SLOT(setFileDialogFlag(bool)));
@@ -593,7 +593,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
else if(type == QCMakeProperty::FILEPATH)
{
QCMakeFilePathEditor* editor =
- new QCMakeFilePathEditor(p,
+ new QCMakeFilePathEditor(p,
var.data(Qt::DisplayRole).toString());
QObject::connect(editor, SIGNAL(fileDialogExists(bool)), this,
SLOT(setFileDialogFlag(bool)));
@@ -602,7 +602,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
else if(type == QCMakeProperty::STRING &&
var.data(QCMakeCacheModel::StringsRole).isValid())
{
- QCMakeComboBox* editor =
+ QCMakeComboBox* editor =
new QCMakeComboBox(p, var.data(QCMakeCacheModel::StringsRole).toStringList());
editor->setFrame(false);
return editor;
@@ -613,7 +613,7 @@ QWidget* QCMakeCacheModelDelegate::createEditor(QWidget* p,
return editor;
}
-bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
+bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
const QStyleOptionViewItem& option, const QModelIndex& index)
{
Qt::ItemFlags flags = model->flags(index);
@@ -637,7 +637,7 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
{
return true;
}
- }
+ }
else if (e->type() == QEvent::KeyPress)
{
if(static_cast<QKeyEvent*>(e)->key() != Qt::Key_Space &&
@@ -645,8 +645,8 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
{
return false;
}
- }
- else
+ }
+ else
{
return false;
}
@@ -660,7 +660,7 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, QAbstractItemModel* model,
}
return success;
}
-
+
// Issue 205903 fixed in Qt 4.5.0.
// Can remove this function and FileDialogFlag when minimum Qt version is 4.5
bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt)
@@ -682,7 +682,7 @@ void QCMakeCacheModelDelegate::setModelData(QWidget* editor,
QItemDelegate::setModelData(editor, model, index);
const_cast<QCMakeCacheModelDelegate*>(this)->recordChange(model, index);
}
-
+
QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QSize sz = QItemDelegate::sizeHint(option, index);
@@ -695,7 +695,7 @@ QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, con
return sz;
}
-
+
QSet<QCMakeProperty> QCMakeCacheModelDelegate::changes() const
{
return mChanges;
@@ -721,7 +721,7 @@ void QCMakeCacheModelDelegate::recordChange(QAbstractItemModel* model, const QMo
QCMakeProperty prop;
idx = idx.sibling(idx.row(), 0);
cache_model->getPropertyData(idx, prop);
-
+
// clean out an old one
QSet<QCMakeProperty>::iterator iter = mChanges.find(prop);
if(iter != mChanges.end())
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index 0a628b9..41f0bd8 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -33,7 +33,7 @@ public:
// retrieve the QCMakeCacheModel storing all the pointers
// this isn't necessarily the model one would get from model()
QCMakeCacheModel* cacheModel() const;
-
+
// get whether to show advanced entries
bool showAdvanced() const;
@@ -65,7 +65,7 @@ public:
// roles used to retrieve extra data such has help strings, types of
// properties, and the advanced flag
enum { HelpRole = Qt::ToolTipRole,
- TypeRole = Qt::UserRole,
+ TypeRole = Qt::UserRole,
AdvancedRole,
StringsRole,
GroupRole
@@ -102,7 +102,7 @@ public slots:
public:
// get the properties
QCMakePropertyList properties() const;
-
+
// editing enabled
bool editEnabled() const;
@@ -112,7 +112,7 @@ public:
// return flags (overloaded to modify flag based on EditEnabled flag)
Qt::ItemFlags flags (const QModelIndex& index) const;
QModelIndex buddy(const QModelIndex& idx) const;
-
+
// get the data in the model for this property
void getPropertyData(const QModelIndex& idx1,
QCMakeProperty& prop) const;
@@ -124,20 +124,20 @@ protected:
ViewType View;
// set the data in the model for this property
- void setPropertyData(const QModelIndex& idx1,
+ void setPropertyData(const QModelIndex& idx1,
const QCMakeProperty& p, bool isNew);
// breaks up he property list into groups
// where each group has the same prefix up to the first underscore
static void breakProperties(const QSet<QCMakeProperty>& props,
QMap<QString, QCMakePropertyList>& result);
-
+
// gets the prefix of a string up to the first _
static QString prefix(const QString& s);
};
-/// Qt delegate class for interaction (or other customization)
+/// Qt delegate class for interaction (or other customization)
/// with cache properties
class QCMakeCacheModelDelegate : public QItemDelegate
{
@@ -145,9 +145,9 @@ class QCMakeCacheModelDelegate : public QItemDelegate
public:
QCMakeCacheModelDelegate(QObject* p);
/// create our own editors for cache properties
- QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option,
+ QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option,
const QModelIndex& index ) const;
- bool editorEvent (QEvent* event, QAbstractItemModel* model,
+ bool editorEvent (QEvent* event, QAbstractItemModel* model,
const QStyleOptionViewItem& option, const QModelIndex& index);
bool eventFilter(QObject* object, QEvent* event);
void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) const;
diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx
index 144e1f3..a0c5e17 100644
--- a/Source/QtDialog/QCMakeWidgets.cxx
+++ b/Source/QtDialog/QCMakeWidgets.cxx
@@ -69,7 +69,7 @@ void QCMakeFilePathEditor::chooseFile()
this->fileDialogExists(true);
path = QFileDialog::getOpenFileName(this, title, info.absolutePath());
this->fileDialogExists(false);
-
+
if(!path.isEmpty())
{
this->setText(QDir::fromNativeSeparators(path));
diff --git a/Source/QtDialog/QMacInstallDialog.cxx b/Source/QtDialog/QMacInstallDialog.cxx
index 6eb053b..8b8c531 100644
--- a/Source/QtDialog/QMacInstallDialog.cxx
+++ b/Source/QtDialog/QMacInstallDialog.cxx
@@ -15,11 +15,11 @@ QMacInstallDialog::QMacInstallDialog(QWidget*w)
{
this->Internals = new QMacInstallDialogInternals;
this->Internals->setupUi(this);
- QObject::connect(this->Internals->choosePathButton, SIGNAL(pressed()),
+ QObject::connect(this->Internals->choosePathButton, SIGNAL(pressed()),
this, SLOT(ShowBrowser()));
- QObject::connect(this->Internals->skipInstallButton, SIGNAL(pressed()),
+ QObject::connect(this->Internals->skipInstallButton, SIGNAL(pressed()),
this, SLOT(SkipInstall()));
- QObject::connect(this->Internals->doInstallButton, SIGNAL(pressed()),
+ QObject::connect(this->Internals->doInstallButton, SIGNAL(pressed()),
this, SLOT(DoInstall()));
this->Internals->InstallPrefix->setText("/usr/bin/");
@@ -31,7 +31,7 @@ QMacInstallDialog::~QMacInstallDialog()
}
void QMacInstallDialog::DoInstall()
-{
+{
QDir installDir(this->Internals->InstallPrefix->text());
QString installTo = installDir.path();
if(!cmSystemTools::FileExists(installTo.toLocal8Bit().data()))
@@ -42,7 +42,7 @@ void QMacInstallDialog::DoInstall()
message += installDir.path();
QString title = tr("Create Directory");
QMessageBox::StandardButton btn;
- btn = QMessageBox::information(this, title, message,
+ btn = QMessageBox::information(this, title, message,
QMessageBox::Yes | QMessageBox::No);
if(btn == QMessageBox::Yes)
{
@@ -52,7 +52,7 @@ void QMacInstallDialog::DoInstall()
QDir cmExecDir(QApplication::applicationDirPath());
cmExecDir.cd("../bin");
QFileInfoList list = cmExecDir.entryInfoList();
- for (int i = 0; i < list.size(); ++i)
+ for (int i = 0; i < list.size(); ++i)
{
QFileInfo fileInfo = list.at(i);
QString filename = fileInfo.fileName();
@@ -75,7 +75,7 @@ void QMacInstallDialog::DoInstall()
message += newName;
QString title = tr("Error Removing file");
QMessageBox::StandardButton btn =
- QMessageBox::critical(this, title, message,
+ QMessageBox::critical(this, title, message,
QMessageBox::Ok|QMessageBox::Abort);
if(btn == QMessageBox::Abort)
{
@@ -93,7 +93,7 @@ void QMacInstallDialog::DoInstall()
message += newName;
QString title = tr("Error Creating Symlink");
QMessageBox::StandardButton btn =
- QMessageBox::critical(this, title, message,
+ QMessageBox::critical(this, title, message,
QMessageBox::Ok|QMessageBox::Abort);
if(btn == QMessageBox::Abort)
{
@@ -112,7 +112,7 @@ void QMacInstallDialog::SkipInstall()
void QMacInstallDialog::ShowBrowser()
{
- QString dir = QFileDialog::getExistingDirectory(this,
+ QString dir = QFileDialog::getExistingDirectory(this,
tr("Enter Install Prefix"), this->Internals->InstallPrefix->text());
if(!dir.isEmpty())
{
diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in
index 701991b..3196471 100644
--- a/Source/QtDialog/QtDialogCPack.cmake.in
+++ b/Source/QtDialog/QtDialogCPack.cmake.in
@@ -1,18 +1,18 @@
-SET(IS_APPLE @APPLE@)
-SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@)
+set(IS_APPLE @APPLE@)
+set(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@)
-IF(CMAKE_PACKAGE_QTGUI)
- SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES})
- SET(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS})
- IF(IS_APPLE)
+if(CMAKE_PACKAGE_QTGUI)
+ set(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES})
+ set(CPACK_CREATE_DESKTOP_LINKS "cmake-gui" ${CPACK_CREATE_DESKTOP_LINKS})
+ if(IS_APPLE)
# for apple install we set the install prefix to
# / and then install
# cmake into the bundle for cmake-gui and must use DESTDIR
- SET(CPACK_SET_DESTDIR TRUE)
+ set(CPACK_SET_DESTDIR TRUE)
# we also want to run post install stuff to setup command line
- SET(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@")
- SET(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@")
- ENDIF(IS_APPLE)
-ENDIF(CMAKE_PACKAGE_QTGUI)
+ set(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@")
+ set(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@")
+ endif()
+endif()