Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
3ae8ddf1
Commit
3ae8ddf1
authored
Aug 09, 2010
by
Alessandro Portale
Browse files
Outsourcing the dirty bulk into the new "qmlapplication.pri"
parent
d3677abd
Changes
4
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/templates/qmlapp/app.pro
View file @
3ae8ddf1
...
...
@@ -27,82 +27,4 @@ symbian:TARGET.UID3 = 0xE1111234
#
QMLINSPECTOR_PATH
#
QMLINSPECTOR_PATH
=
$$
PWD
/../../
qmljsdebugger
#
Edit
the
code
below
on
your
own
risk
.
QT
+=
declarative
SOURCES
+=
cpp
/
main
.
cpp
cpp
/
qmlapplicationview
.
cpp
HEADERS
+=
cpp
/
qmlapplicationview
.
h
INCLUDEPATH
+=
cpp
contains
(
DEFINES
,
QMLINSPECTOR
)
{
CONFIG
(
debug
,
debug
|
release
)
{
include
(
$$
QMLINSPECTOR_PATH
/
qmljsdebugger
-
lib
.
pri
)
}
else
{
DEFINES
-=
QMLINSPECTOR
}
}
symbian
{
ICON
=
cpp
/
symbianicon
.
svg
contains
(
DEFINES
,
ORIENTATIONLOCK
)
:
LIBS
+=
-
lavkon
-
leikcore
-
leiksrv
-
lcone
contains
(
DEFINES
,
NETWORKACCESS
)
:
TARGET
.
CAPABILITY
+=
NetworkServices
for
(
deploymentfolder
,
DEPLOYMENTFOLDERS
)
{
item
=
item
$$
{
deploymentfolder
}
itemsources
=
$$
{
item
}.
sources
$$
itemsources
=
$$
eval
(
$$
{
deploymentfolder
}.
source
)
itempath
=
$$
{
item
}.
path
$$
itempath
=
$$
eval
(
$$
{
deploymentfolder
}.
target
)
DEPLOYMENT
+=
$$
item
}
}
else
:
win32
{
!
isEqual
(
PWD
,
$$
OUT_PWD
)
{
copyCommand
=
@
echo
Copying
application
data
...
for
(
deploymentfolder
,
DEPLOYMENTFOLDERS
)
{
source
=
$$
eval
(
$$
{
deploymentfolder
}.
source
)
pathSegments
=
$$
split
(
source
,
/
)
sourceAndTarget
=
$$
PWD
/
$$
source
$$
OUT_PWD
/
$$
eval
(
$$
{
deploymentfolder
}.
target
)
/
$$
last
(
pathSegments
)
copyCommand
+=
&&
$
(
COPY_DIR
)
$$
replace
(
sourceAndTarget
,
/,
\\
)
}
copydeploymentfolders
.
commands
=
$$
copyCommand
first
.
depends
=
$
(
first
)
copydeploymentfolders
QMAKE_EXTRA_TARGETS
+=
first
copydeploymentfolders
}
}
else
:
if
(
maemo5
|
maemo6
)
{
for
(
deploymentfolder
,
DEPLOYMENTFOLDERS
)
{
item
=
item
$$
{
deploymentfolder
}
itemfiles
=
$$
{
item
}.
files
$$
itemfiles
=
$$
eval
(
$$
{
deploymentfolder
}.
source
)
itempath
=
$$
{
item
}.
path
$$
itempath
=
/
opt
/
share
/
$$
eval
(
$$
{
deploymentfolder
}.
target
)
INSTALLS
+=
$$
item
}
desktopfile
.
files
=
$$
{
TARGET
}.
desktop
desktopfile
.
path
=
/
usr
/
share
/
applications
/
hildon
target
.
path
=
/
opt
/
bin
INSTALLS
+=
desktopfile
target
}
else
:
macx
{
!
isEqual
(
PWD
,
$$
OUT_PWD
)
{
copyCommand
=
@
echo
Copying
application
data
...
for
(
deploymentfolder
,
DEPLOYMENTFOLDERS
)
{
target
=
$$
OUT_PWD
/
$$
{
TARGET
}.
app
/
Contents
/
Resources
/
$$
eval
(
$$
{
deploymentfolder
}.
target
)
copyCommand
+=
&&
$
(
MKDIR
)
$$
target
copyCommand
+=
&&
$
(
COPY_DIR
)
$$
PWD
/
$$
eval
(
$$
{
deploymentfolder
}.
source
)
$$
target
}
copydeploymentfolders
.
commands
=
$$
copyCommand
first
.
depends
=
$
(
first
)
copydeploymentfolders
QMAKE_EXTRA_TARGETS
+=
first
copydeploymentfolders
}
}
else
{
#
linux
!
isEqual
(
PWD
,
$$
OUT_PWD
)
{
copyCommand
=
@
echo
Copying
application
data
...
for
(
deploymentfolder
,
DEPLOYMENTFOLDERS
)
{
target
=
$$
OUT_PWD
/
$$
eval
(
$$
{
deploymentfolder
}.
target
)
copyCommand
+=
&&
$
(
MKDIR
)
$$
target
copyCommand
+=
&&
$
(
COPY_DIR
)
$$
PWD
/
$$
eval
(
$$
{
deploymentfolder
}.
source
)
$$
target
}
copydeploymentfolders
.
commands
=
$$
copyCommand
first
.
depends
=
$
(
first
)
copydeploymentfolders
QMAKE_EXTRA_TARGETS
+=
first
copydeploymentfolders
}
}
include
(
$$
PWD
/
qmlapplication
.
pri
)
share/qtcreator/templates/qmlapp/qmlapplication.pri
0 → 100644
View file @
3ae8ddf1
# This file should not be edited.
# Following versions of Qt Creator might offer new version.
QT += declarative
SOURCES += cpp/main.cpp cpp/qmlapplicationview.cpp
HEADERS += cpp/qmlapplicationview.h
INCLUDEPATH += cpp
contains(DEFINES, QMLINSPECTOR) {
CONFIG(debug, debug|release) {
include($$QMLINSPECTOR_PATH/qmljsdebugger-lib.pri)
} else {
DEFINES -= QMLINSPECTOR
}
}
symbian {
ICON = cpp/symbianicon.svg
contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone
contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemsources = $${item}.sources
$$itemsources = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath= $$eval($${deploymentfolder}.target)
DEPLOYMENT += $$item
}
} else:win32 {
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$eval($${deploymentfolder}.source)
pathSegments = $$split(source, /)
sourceAndTarget = $$PWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments)
copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\)
}
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
} else:if(maemo5|maemo6) {
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemfiles = $${item}.files
$$itemfiles = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath = /opt/share/$$eval($${deploymentfolder}.target)
INSTALLS += $$item
}
desktopfile.files = $${TARGET}.desktop
desktopfile.path = /usr/share/applications/hildon
target.path = /opt/bin
INSTALLS += desktopfile target
} else:macx {
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
copyCommand += && $(MKDIR) $$target
copyCommand += && $(COPY_DIR) $$PWD/$$eval($${deploymentfolder}.source) $$target
}
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
} else { #linux
!isEqual(PWD,$$OUT_PWD) {
copyCommand = @echo Copying application data...
for(deploymentfolder, DEPLOYMENTFOLDERS) {
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
copyCommand += && $(MKDIR) $$target
copyCommand += && $(COPY_DIR) $$PWD/$$eval($${deploymentfolder}.source) $$target
}
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
}
src/plugins/qmlprojectmanager/wizards/qmlstandaloneapp.cpp
View file @
3ae8ddf1
...
...
@@ -144,6 +144,7 @@ QString QmlStandaloneApp::path(Path path, Location location) const
const
QString
cppSourceSubDir
=
QLatin1String
(
"cpp/"
);
const
QString
cppTargetSubDir
=
cppSourceSubDir
;
const
QString
qmlExtension
=
QLatin1String
(
".qml"
);
const
QString
appPri
=
QLatin1String
(
"qmlapplication.pri"
);
const
QString
mainCpp
=
QLatin1String
(
"main.cpp"
);
const
QString
appViewCpp
=
QLatin1String
(
"qmlapplicationview.cpp"
);
const
QString
appViewH
=
QLatin1String
(
"qmlapplicationview.h"
);
...
...
@@ -155,6 +156,7 @@ QString QmlStandaloneApp::path(Path path, Location location) const
switch
(
path
)
{
case
MainQml
:
return
templatesRoot
+
QLatin1String
(
"qml/app/app.qml"
);
case
AppProfile
:
return
templatesRoot
+
QLatin1String
(
"app.pro"
);
case
AppPri
:
return
templatesRoot
+
appPri
;
case
MainCpp
:
return
templatesRoot
+
cppSourceSubDir
+
mainCpp
;
case
AppViewerCpp
:
return
templatesRoot
+
cppSourceSubDir
+
appViewCpp
;
case
AppViewerH
:
return
templatesRoot
+
cppSourceSubDir
+
appViewH
;
...
...
@@ -170,8 +172,9 @@ QString QmlStandaloneApp::path(Path path, Location location) const
case
MainQml
:
return
useExistingMainQml
()
?
m_mainQmlFile
.
canonicalFilePath
()
:
pathBase
+
qmlRootFolder
+
m_projectName
+
qmlExtension
;
case
AppProfile
:
return
pathBase
+
m_projectName
+
QLatin1String
(
".pro"
);
case
AppPr
ofilePath
:
return
pathBase
;
case
AppPr
i
:
return
pathBase
+
appPri
;
case
MainCpp
:
return
pathBase
+
cppTargetSubDir
+
mainCpp
;
case
AppProfilePath
:
return
pathBase
;
case
AppViewerCpp
:
return
pathBase
+
cppTargetSubDir
+
appViewCpp
;
case
AppViewerH
:
return
pathBase
+
cppTargetSubDir
+
appViewH
;
case
SymbianSvgIcon
:
return
pathBase
+
cppTargetSubDir
+
symbianIcon
;
...
...
@@ -351,6 +354,7 @@ Core::GeneratedFiles QmlStandaloneApp::generateFiles(QString *errorMessage) cons
generatedProFile
.
setContents
(
generateProFile
(
errorMessage
));
generatedProFile
.
setAttributes
(
Core
::
GeneratedFile
::
OpenProjectAttribute
);
files
.
append
(
generatedProFile
);
files
.
append
(
generateFileCopy
(
path
(
AppPri
,
Source
),
path
(
AppPri
,
Target
)));
if
(
!
useExistingMainQml
())
files
.
append
(
generateFileCopy
(
path
(
MainQml
,
Source
),
path
(
MainQml
,
Target
),
true
));
...
...
src/plugins/qmlprojectmanager/wizards/qmlstandaloneapp.h
View file @
3ae8ddf1
...
...
@@ -53,6 +53,7 @@ public:
MainQml
,
MainCpp
,
AppProfile
,
AppPri
,
AppProfilePath
,
AppViewerCpp
,
AppViewerH
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment