Skip to content

Commit

Permalink
Adjust new qmake project for Linux stuff and OSX releasing
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
navv1234 committed Aug 6, 2016
1 parent e9ac235 commit dddc717
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 13 deletions.
22 changes: 20 additions & 2 deletions cli/cli.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ TEMPLATE = app
TARGET = simc
CONFIG -= qt app_bundle link_prl
QT -= core gui
DESTDIR = ..

# Linux puts binaries to a different place (see simulationcraft.pri)
win32|macx {
DESTDIR = ..
}

CONFIG(release, debug|release): LIBS += -L../lib/release -lsimcengine
CONFIG(debug, debug|release): LIBS += -L../lib/debug -lsimcengine
Expand All @@ -14,6 +18,20 @@ win32 {
QMAKE_PROJECT_NAME = "Simulationcraft CLI"
}

# Deployment for Linux
unix:!mac {
DISTFILES += CHANGES COPYING
INSTALLS += target profiles
# Disable strip
QMAKE_STRIP = echo

target.path = $$DESTDIR$$PREFIX/bin/

profiles.path = $$SHAREPATH/profiles
profiles.files += ../profiles/*
profiles.commands = @echo Installing profiles to $$SHAREPATH/profiles
}

include(../source_files/QT_engine_main.pri)

SOURCES = $$replace(SOURCES, engine, ../engine)
SOURCES = $$replace(SOURCES, engine/, ../engine/)
63 changes: 59 additions & 4 deletions gui/gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,46 @@ include(../simulationcraft.pri)
TEMPLATE = app
TARGET = SimulationCraft
CONFIG += link_prl
QT += network webengine webenginewidgets
DEFINES += SC_USE_WEBENGINE
QT += network widgets
LIBS += -L../lib -lsimcengine
DESTDIR = ..
MOC_DIR = moc
RCC_DIR = resources

# Linux puts binaries to a different place (see simulationcraft.pri)
win32|macx {
DESTDIR = ..
}

CONFIG(release, debug|release): LIBS += -L../lib/release -lsimcengine
CONFIG(debug, debug|release): LIBS += -L../lib/debug -lsimcengine

CONFIG(to_install) {
DEFINES += SC_TO_INSTALL
}

greaterThan( QT_MINOR_VERSION, 3 ) {
QT += webengine webenginewidgets
DEFINES += SC_USE_WEBENGINE
message("Using WebEngine")
}

lessThan( QT_MINOR_VERSION, 4 ) {
QT += webkit webkitwidgets
DEFINES += SC_USE_WEBKIT
message("Using WebKit")
}

# QT 5.4 for MinGW does not yet contain the new Web Engine
win32-mingw {
greaterThan( QT_MINOR_VERSION, 3 ) {
QT -= webengine webenginewidgets
QT += webkit webkitwidgets
DEFINES -= SC_USE_WEBENGINE
DEFINES += SC_USE_WEBKIT
message("MinGW WebKit only")
}
}

macx {
ICON = ../qt/icon/Simcraft2.icns
LIBS += -framework CoreFoundation -framework AppKit
Expand All @@ -43,6 +69,35 @@ win32 {
DEFINES += VS_NEW_BUILD_SYSTEM
}

# Deplopyment for Linux, note, the cli project also copies profiles
unix:!mac {
DISTFILES += CHANGES COPYING
INSTALLS += target profiles data icon locale
# Disable strip
QMAKE_STRIP = echo

target.path = $$DESTDIR$$PREFIX/bin/

profiles.path = $$SHAREPATH/profiles
profiles.files += ../profiles/*
profiles.commands = @echo Installing profiles to $$SHAREPATH/profiles

data.path = $$SHAREPATH
data.files += ../Welcome.html
data.files += ../Welcome.png
data.files += ../READ_ME_FIRST.txt
data.files += ../Error.html
data.commands = @echo Installing global files to $$SHAREPATH

icon.path = $$SHAREPATH
icon.files = ../debian/simulationcraft.xpm
icon.commands = @echo Installing icon to $$SHAREPATH

locale.path = $$SHAREPATH/locale
locale.files += ../locale/*.qm
locale.commands = @echo Installing localizations to $$SHAREPATH/locale
}

RESOURCES = \
qt/simcqt.qrc

Expand All @@ -56,4 +111,4 @@ include(../source_files/QT_gui.pri)
# Fix paths in SOURCES and HEADERS, as they need to refer to parent
# directory for the respective subprojects.
HEADERS = $$replace(HEADERS, qt/, ../qt/)
SOURCES = $$replace(SOURCES, qt/, ../qt/)
SOURCES = $$replace(SOURCES, qt/, ../qt/)
19 changes: 13 additions & 6 deletions lib/lib.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ TARGET = simcengine
CONFIG += staticlib create_prl
QT -= core gui

CONFIG(release, debug|release): DESTDIR = release
CONFIG(debug, debug|release): DESTDIR = debug

win32 {
QMAKE_PROJECT_NAME = "Simulationcraft Engine"
}
Expand All @@ -16,8 +13,18 @@ win32 {
DEFINES += SC_DEFAULT_APIKEY=\"$${SC_DEFAULT_APIKEY}\"
}

!isEmpty(PREFIX)|!isEmpty(DESTDIR) {
DEFINES += SC_SHARED_DATA=\\\"$$PREFIX/share/$$ORG_NAME/$$APP_NAME\\\"
# On Linux compilation, setup the profile search directory
unix:!macx {
!isEmpty(PREFIX)|!isEmpty(DESTDIR) {
DEFINES += SC_SHARED_DATA=\\\"$$PREFIX/share/$$ORG_NAME/$$APP_NAME\\\"
}
}

# Win32/OS X will setup target directory to the source root instead. On linux, this is setup in
# simulationcraft.pri.
win32|macx {
CONFIG(release, debug|release): DESTDIR = release
CONFIG(debug, debug|release): DESTDIR = debug
}

include(../source_files/QT_engine.pri)
Expand All @@ -28,4 +35,4 @@ include(../source_files/QT_engine.pri)
HEADERS -= engine/simulationcraft.hpp
HEADERS = $$replace(HEADERS, engine/, ../engine/)
SOURCES = $$replace(SOURCES, engine/, ../engine/)
PRECOMPILED_HEADER = $$replace(PRECOMPILED_HEADER, engine/, ../engine/)
PRECOMPILED_HEADER = $$replace(PRECOMPILED_HEADER, engine/, ../engine/)
13 changes: 12 additions & 1 deletion simulationcraft.pri
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ CONFIG(release, debug|release): OBJECTS_DIR = build/release

QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7

# Setup some paths if DESTDIR/PREFIX are defined for Linux stuff
unix:!macx {
!isEmpty(DESTDIR): PREFIX=$$DESTDIR/$$PREFIX
isEmpty(PREFIX): PREFIX=/usr/local
isEmpty(DATADIR): DATADIR=$$PREFIX/share
isEmpty(SEARCH): SEARCH=$$DATADIR/$$ORG_NAME/$$APP_NAME
isEmpty(BINDIR): BINDIR=$$PREFIX/bin

SHAREPATH = $$DESTDIR$$PREFIX/share/$$ORG_NAME/$$APP_NAME
}

CONFIG(release, debug|release) {
DEFINES += NDEBUG
}
Expand Down Expand Up @@ -49,7 +60,7 @@ win32 {
QMAKE_LFLAGS_RELEASE += /LTCG
QMAKE_CXXFLAGS_RELEASE += /GL
}

win32-msvc2015 {
QMAKE_CXXFLAGS_RELEASE += /GL
QMAKE_LFLAGS_RELEASE += /LTCG /USEPROFILE /PGD:"..\SimulationCraft64.pgd"
Expand Down
13 changes: 13 additions & 0 deletions simulationcraft.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,16 @@ SUBDIRS = lib cli gui

cli.depends = lib
gui.depends = lib

lessThan( QT_MAJOR_VERSION, 5 ) {
error( "SimulationCraft requires QT 5 or higher." )
}

# OS X release target
macx {
create_release.target = create_release
create_release.depends = all
create_release.commands = $$dirname(QMAKE_QMAKE)/macdeployqt Simulationcraft.app && qt/osx_release.sh

QMAKE_EXTRA_TARGETS += create_release
}

0 comments on commit dddc717

Please sign in to comment.