Skip to content

Commit

Permalink
win32 and win64 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
irascible committed May 10, 2014
1 parent 2bbf6c5 commit 3612091
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 38 deletions.
Binary file removed SetupAPI.Lib
Binary file not shown.
29 changes: 27 additions & 2 deletions phoenix.pro
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,38 @@ win32 {
DEFINES += _CRT_SECURE_NO_DEPRECATE
DEFINES += _WINDOWS
RELEASE_SCRIPT = $$(RELEASE_SCRIPT) # environment variable set from release script

isEmpty(RELEASE_SCRIPT) {
LIBS += $${PWD}/SetupAPI.Lib
}
!isEmpty(RELEASE_SCRIPT) {
LIBS += advapi32.lib
LIBS += SetupAPI.lib
}
#message("target arch: $${QMAKE_TARGET.arch}")
contains(QMAKE_TARGET.arch, x86_64) {
SETUPLIBPATH = "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/x64"
RELDIR = ../../release64
DEBDIR = ../../debug64
DEFINES += WIN64
}
!contains(QMAKE_TARGET.arch, x86_64) {
SETUPLIBPATH = "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib"
RELDIR = ../../release32
DEBDIR = ../../debug32
}
message("check your SetupAPI.lib path: $${SETUPLIBPATH}/SetupAPI.Lib")
LIBS += $${SETUPLIBPATH}/SetupAPI.Lib

Release:DESTDIR = $${RELDIR}
Release:OBJECTS_DIR = $${RELDIR}
Release:MOC_DIR = $${RELDIR}
Release:RCC_DIR = $${RELDIR}
Release:UI_DIR = $${RELDIR}

Debug:DESTDIR = $${DEBDIR}
Debug:OBJECTS_DIR = $${DEBDIR}
Debug:MOC_DIR = $${DEBDIR}
Debug:RCC_DIR = $${DEBDIR}
Debug:UI_DIR = $${DEBDIR}
}
macx {
MOC_DIR = build/moc
Expand Down
30 changes: 19 additions & 11 deletions src/fapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
#include "sketch/sketchwidget.h"
#include "sketch/pcbsketchwidget.h"
#include "help/firsttimehelpdialog.h"
#include "help/aboutbox.h"

// dependency injection :P
#include "referencemodel/sqlitereferencemodel.h"
Expand Down Expand Up @@ -93,10 +94,14 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
#define PLATFORM_NAME "linux-64bit"
#endif
#ifdef Q_OS_WIN
#ifdef WIN64
#define PLATFORM_NAME "windows-64bit"
#else
#define PLATFORM_NAME "windows"
#endif
#endif
#ifdef Q_OS_MAC
#if (QT_VERSION > 0x050000) || defined(QT_MAC_USE_COCOA)
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) || defined(QT_MAC_USE_COCOA)
#define PLATFORM_NAME "mac-os-x-105"
#else
#define PLATFORM_NAME "mac-os-x-104"
Expand Down Expand Up @@ -514,6 +519,17 @@ bool FApplication::init() {
PinHeader::initNames();
CursorMaster::initCursors();

#ifdef Q_OS_MAC
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) || defined(QT_MAC_USE_COCOA)
m_buildType = " Cocoa";
#else
m_buildType = " Carbon";
#endif
#else
m_buildType = QString(PLATFORM_NAME).contains("64") ? "64" : "32";
#endif
AboutBox::initBuildType(m_buildType);

return true;
}

Expand Down Expand Up @@ -1290,23 +1306,15 @@ void FApplication::initSplash(FSplashScreen & splash) {
.arg(Version::year());
splash.showMessage(msg1, "fhpText", Qt::AlignLeft | Qt::AlignTop);

QString macBuildType;
#ifdef Q_OS_MAC
#if (QT_VERSION > 0x050000) || defined(QT_MAC_USE_COCOA)
macBuildType = " Cocoa";
#else
macBuildType = " Carbon";
#endif
#endif
QString msg2 = QObject::tr("<font face='Lucida Grande, Tahoma, Sans Serif' size='2' color='#eaf4ed'>"
"Version %1.%2.%3 (%4%5)%6"
"Version %1.%2.%3 (%4%5) %6"
"</font>")
.arg(Version::majorVersion())
.arg(Version::minorVersion())
.arg(Version::minorSubVersion())
.arg(Version::modifier())
.arg(Version::shortDate())
.arg(macBuildType);
.arg(m_buildType);
splash.showMessage(msg2, "versionText", Qt::AlignRight | Qt::AlignTop);
splash.show();
}
Expand Down
1 change: 1 addition & 0 deletions src/fapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ public slots:
bool m_panelizerCustom;
int m_portNumber;
FServer * m_fServer;
QString m_buildType;
};


Expand Down
36 changes: 16 additions & 20 deletions src/help/aboutbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
#include "../version/version.h"
#include "../utils/expandinglabel.h"

AboutBox* AboutBox::singleton = NULL;
AboutBox* AboutBox::Singleton = NULL;

static const int AboutWidth = 390;
static const int AboutText = 210;
QString AboutBox::BuildType;

AboutBox::AboutBox(QWidget *parent)
: QWidget(parent)
{
singleton = this;
Singleton = this;
// To make the application not quit when the window closes
this->setAttribute(Qt::WA_QuitOnClose, false);

Expand All @@ -66,23 +67,14 @@ AboutBox::AboutBox(QWidget *parent)

// Version String
QLabel *versionMain = new QLabel(this);
QString macBuildType;

#ifdef Q_OS_MAC
#if (QT_VERSION > 0x050000) || defined(QT_MAC_USE_COCOA)
macBuildType = " Cocoa";
#else
macBuildType = " Carbon";
#endif
#endif
versionMain->setText(tr("Version %1.%2.%3 <small>(%4%5 %6)%7 [Qt %8]</small>")
versionMain->setText(tr("Version %1.%2.%3 <small>(%4%5 %6) %7 [Qt %8]</small>")
.arg(Version::majorVersion())
.arg(Version::minorVersion())
.arg(Version::minorSubVersion())
.arg(Version::modifier())
.arg(Version::revision())
.arg(Version::date())
.arg(macBuildType)
.arg(BuildType)
.arg(QT_VERSION_STR) );
versionMain->setFont(smallFont);
versionMain->setGeometry(45, 150, 300, 20);
Expand Down Expand Up @@ -249,30 +241,34 @@ void AboutBox::scrollCredits() {
}
}

void AboutBox::initBuildType(const QString & buildType) {
BuildType = buildType;
}

void AboutBox::hideAbout() {
//DebugDialog::debug("the AboutBox gets a hide action triggered");
if (singleton != NULL) {
singleton->hide();
if (Singleton != NULL) {
Singleton->hide();
}
}

void AboutBox::showAbout() {
//DebugDialog::debug("the AboutBox gets a show action triggered");
if (singleton == NULL) {
if (Singleton == NULL) {
new AboutBox();
}

// scroll text now to prevent a flash of text if text was visible the last time the about box was open
singleton->m_expandingLabel->verticalScrollBar()->setValue(0);
Singleton->m_expandingLabel->verticalScrollBar()->setValue(0);

singleton->show();
Singleton->show();
}

void AboutBox::closeAbout() {
//DebugDialog::debug("the AboutBox gets a close action triggered");
// Note: not every close triggers this function. we better listen to closeEvent
if (singleton != NULL) {
singleton->close();
if (Singleton != NULL) {
Singleton->close();
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/help/aboutbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ class AboutBox : public QWidget {
static void hideAbout();
static void showAbout();
static void closeAbout(); // Maybe we don't need close as a public method (we only want to hide)
static void initBuildType(const QString &);

public slots:
void scrollCredits();

protected:
static AboutBox* singleton;
static AboutBox* Singleton;
static QString BuildType;

protected:
void closeEvent ( QCloseEvent * event );
Expand Down
4 changes: 2 additions & 2 deletions src/mainwindow/mainwindow_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
static QString eagleActionType = ".eagle";
static QString gerberActionType = ".gerber";
static QString jpgActionType = ".jpg";
#if (QT_VERSION < 0x050000)
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
static QString psActionType = ".ps";
#endif
static QString pdfActionType = ".pdf";
Expand Down Expand Up @@ -140,7 +140,7 @@ void MainWindow::initNames()
fileExtFormats[svgActionType] = tr("SVG Image (*.svg)");
fileExtFormats[bomActionType] = tr("BoM Text File (*.html)");

#if (QT_VERSION < 0x050000)
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
OtherKnownExtensions << psActionType;
filePrintFormats[psActionType] = QPrinter::PostScriptFormat;
fileExtFormats[psActionType] = tr("PostScript (*.ps)");
Expand Down
2 changes: 1 addition & 1 deletion src/svg/svg2gerber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ int SVG2gerber::allPaths2gerber(ForWhy forWhy) {
QDomElement polygon = polyList.item(p).toElement();
doPoly(polygon, forWhy, true, apertureMap, current_dcode, dcode_index);
}
for(uint p = 0; p < polyLineList.length(); p++) {
for(int p = 0; p < polyLineList.length(); p++) {
QDomElement polygon = polyLineList.item(p).toElement();
doPoly(polygon, forWhy, false, apertureMap, current_dcode, dcode_index);
}
Expand Down
3 changes: 3 additions & 0 deletions src/utils/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
#include <QHash>
#include <QVector>

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
// TODO: this debugging hack seems to break in Qt 5; needs investigation
#ifdef Q_OS_WIN
#ifndef QT_NO_DEBUG

Expand All @@ -43,6 +45,7 @@ along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
#define new DEBUG_NEW
#endif

#endif
#endif
#endif

Expand Down
4 changes: 3 additions & 1 deletion tools/make.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cd /d %~dp0
cd ..
C:\Qt\qt-everywhere-opensource-src-4.8.5\bin\qmake.exe -t vcapp -spec win32-msvc2012 phoenix.pro
rem C:\Qt\qt-everywhere-opensource-src-4.8.5\bin\qmake.exe -t vcapp -spec win32-msvc2012 phoenix.pro
C:\Qt\qt-everywhere-opensource-src-5.2.1-32\qtbase\bin\qmake.exe "DESTDIR=../../32/" -t vcapp -spec win32-msvc2012 phoenix.pro -o Fritzing32.vcxproj
C:\Qt\qt-everywhere-opensource-src-5.2.1-64\qtbase\bin\qmake.exe "DESTDIR=../../64/" "QMAKE_TARGET.arch=x86_64" -t vcapp -spec win32-msvc2012 phoenix.pro -o Fritzing64.vcxproj

0 comments on commit 3612091

Please sign in to comment.