Bladeren bron

Merge pull request #68 from paulsapps/master

Fix release/debug issue, set windows defaults
paulsapps 11 jaren geleden
bovenliggende
commit
a771f63b8e
2 gewijzigde bestanden met toevoegingen van 24 en 22 verwijderingen
  1. 2 4
      CMakeLists.txt
  2. 22 18
      utilities/q-gears-launcher/src/mainwindow.cpp

+ 2 - 4
CMakeLists.txt

@@ -16,8 +16,6 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
   message("CMAKE_BUILD_TYPE was empty defaulting to RELEASE")
 endif ()
 
-string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
-
 message("CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE} CMAKE_BINARY_DIR is ${CMAKE_BINARY_DIR}")
 
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin_release)
@@ -245,7 +243,7 @@ if(WIN32)
     #set the name of the installer default formating is name-version-os
 
     # If empty assume release
-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
+    if ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
         message("RELEASE installer build")
         install(FILES ${PROJECT_SOURCE_DIR}/output/resources.cfg DESTINATION ./)
         install(FILES ${PROJECT_SOURCE_DIR}/output/plugins.cfg DESTINATION ./)
@@ -269,7 +267,7 @@ if(WIN32)
 elseif(APPLE)
     # APPLE is also UNIX, so must check for APPLE before UNIX
     SET(CPACK_GENERATOR "DragNDrop")
-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
+    if ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
        set(OSX_BIN_DIR "${CMAKE_BINARY_DIR}/bin_release")
        message("DEBUG installer build, CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} OSX_BIN_DIR=${OSX_BIN_DIR}")
     else()

+ 22 - 18
utilities/q-gears-launcher/src/mainwindow.cpp

@@ -5,25 +5,29 @@
 #include <QFileDialog>
 #include <QDir>
 #include <QMessageBox>
-MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow)
+
+MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainWindow)
 {
-	ui->setupUi(this);
-	//set default paths.
-	// TODO add code for platform detect.
-	//on linux
-	ui->lineConfigDir->setText(QString("%1/.q-gears").arg(QDir::homePath()));
-	ui->lineQGearsExe->setText(QString("/usr/games/q-gears"));
-	ui->lineOutput->setText(QString("%1/.q-gears/data").arg(QDir::homePath()));
-
-	//on windows
-	//	ui->lineConfigDir->setText(QString("%1/q-gears").arg(QDir::homePath()));
-	//	ui->lineQGearsExe->setText(QString("/usr/games/q-gears"));
-	//	ui->lineOutput->setText(QString("%1/q-gears/data").arg(QDir::homePath()));
-  #ifdef _DEBUG
-	  // Hard coded prebaked paths for debugging to save time
-	  ui->lineInput->setText("C:\\Games\\FF7\\data");
-	  ui->lineOutput->setText("C:\\Users\\paul\\Desktop\\q-gears\\output\\_data");
-  #endif
+    ui->setupUi(this);
+    //set default paths.
+#ifdef Q_OS_WIN
+    //on windows
+    ui->lineConfigDir->setText(QString("%1/q-gears").arg(QDir::homePath()));
+    ui->lineQGearsExe->setText(QDir::currentPath() + "/q-gears.exe");
+    ui->lineOutput->setText(QString("%1/q-gears/data").arg(QDir::homePath()));
+#else
+    //on linux
+    ui->lineConfigDir->setText(QString("%1/.q-gears").arg(QDir::homePath()));
+    ui->lineQGearsExe->setText(QString("/usr/games/q-gears"));
+    ui->lineOutput->setText(QString("%1/.q-gears/data").arg(QDir::homePath()));
+
+#endif
+
+#ifdef _DEBUG
+    // Hard coded prebaked paths for debugging to save time
+    ui->lineInput->setText("C:\\Games\\FF7\\data");
+    ui->lineOutput->setText("C:\\Users\\paul\\Desktop\\q-gears\\output\\_data");
+#endif
 
 }