|
|
@@ -19,6 +19,7 @@
|
|
|
#include <QFileInfo>
|
|
|
#include <QDir>
|
|
|
#include <QTranslator>
|
|
|
+#include <QLocale>
|
|
|
|
|
|
#include "CMakeSetupDialog.h"
|
|
|
#include "cmDocumentation.h"
|
|
|
@@ -65,22 +66,29 @@ static const char * cmDocumentationOptions[][3] =
|
|
|
int main(int argc, char** argv)
|
|
|
{
|
|
|
QApplication app(argc, argv);
|
|
|
-
|
|
|
+
|
|
|
+ // tell the cmake library where cmake is
|
|
|
QDir cmExecDir(QApplication::applicationDirPath());
|
|
|
#if defined(Q_OS_MAC)
|
|
|
cmExecDir.cd("../../../");
|
|
|
#endif
|
|
|
cmSystemTools::FindExecutableDirectory(cmExecDir.filePath("cmake").toAscii().data());
|
|
|
|
|
|
+ // pick up translation files if they exists in the data directory
|
|
|
+ QDir translationsDir = cmExecDir;
|
|
|
+ translationsDir.cd(".." CMAKE_DATA_DIR);
|
|
|
+ translationsDir.cd("i18n");
|
|
|
QTranslator translator;
|
|
|
QString transfile = QString("cmake_%1").arg(QLocale::system().name());
|
|
|
- translator.load(transfile, app.applicationDirPath());
|
|
|
+ translator.load(transfile, translationsDir.path());
|
|
|
app.installTranslator(&translator);
|
|
|
|
|
|
+ // app setup
|
|
|
app.setApplicationName("CMakeSetup");
|
|
|
app.setOrganizationName("Kitware");
|
|
|
app.setWindowIcon(QIcon(":/Icons/CMakeSetup.png"));
|
|
|
|
|
|
+ // do docs, if args were given
|
|
|
cmDocumentation doc;
|
|
|
if(app.arguments().size() > 1 &&
|
|
|
doc.CheckOptions(app.argc(), app.argv()))
|