Skip to content

Commit 03b4095

Browse files
committed
feat: manage copyright with PRODUCT_BRIEF_COPYRIGHT or default text with current system year on Win platform
feat: manage install target and dependencies for app (for qmake and Qt VS tools) 1st level : 'install', recursive : 'install_recurse' manage app install in custom dir (with TARGETDEPLOYDIR) feat: can ignore dependencies with packageignoreinstall.txt fix : 'install' dependencies for conan is only for 1st level dependencies fix: generation of recursve package-dependencis in build directory (avoid duplicates) manage 'shared/sharedlib' or 'static/staticlib' for DEPENDENCIESCONFIG var manage 'recurse' or 'recursive' DEPENDENCIESCONFIG var feat: install 1st level dependencies (manage with DEPENDENCIESCONFIG= install) manage install target and 1st level dependencies for QT VS tools (generates .bat for post build) remove: bcom_package_app.pri and packageappbundle.pri (obsolete dependencies management) feat: nsis - add project root path to script
1 parent d2bfd4c commit 03b4095

11 files changed

+358
-112
lines changed

bcom_arch_define.pri

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,20 @@ isEmpty(REMAKENDEPSFOLDER) {
88
REMAKENDEPSFOLDER = $$clean_path($${REMAKENDEPSROOTFOLDER})
99
}
1010
else { #new remaken behavior
11-
unix {
12-
REMAKENDEPSROOTFOLDER = $$(HOME)
11+
android {
12+
# unix path
13+
REMAKENDEPSROOTFOLDER = $$clean_path($$(HOME))
14+
isEmpty(REMAKENDEPSROOTFOLDER) {
15+
# windows path
16+
REMAKENDEPSROOTFOLDER = $$clean_path($$(USERPROFILE))
17+
isEmpty(REMAKENDEPSROOTFOLDER) {
18+
REMAKENDEPSROOTFOLDER = $$clean_path($$(HOMEDRIVE)$$(HOMEPATH))
19+
}
20+
}
21+
}
22+
23+
unix:!android {
24+
REMAKENDEPSROOTFOLDER = $$clean_path($$(HOME))
1325
}
1426

1527
win32 {
@@ -19,6 +31,10 @@ isEmpty(REMAKENDEPSFOLDER) {
1931
}
2032
}
2133

34+
isEmpty(REMAKENDEPSROOTFOLDER) {
35+
error("[ERROR] REMAKENDEPSROOTFOLDER dependencies folder is empty. Please check your system environment path (HOME for unix, USERPROFILE for windows)")
36+
}
37+
2238
# Read REMAKENDEVPROP qmake property
2339
REMAKENDEPSFOLDER = $$clean_path($$[REMAKENDEPSFOLDERPROP])
2440

bcom_package_app.pri

Lines changed: 0 additions & 8 deletions
This file was deleted.

packagedependencies.pri

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@
66
DEPENDENCIESCONFIG = sharedlib
77
}
88

9+
# Check install_recurse parameters existence
10+
contains(DEPENDENCIESCONFIG,install_recurse) {
11+
# add recurse mode if install_recurse defined
12+
!contains(DEPENDENCIESCONFIG,recurse) {
13+
DEPENDENCIESCONFIG += recurse
14+
}
15+
}
16+
917
#include sub-dependencies recursion function
1018
include(populateSubDependencies.pri)
1119

12-
contains(DEPENDENCIESCONFIG,staticlib) {
20+
contains(DEPENDENCIESCONFIG,staticlib)|contains(DEPENDENCIESCONFIG,static) {
1321
DEPLINKMODE = static
1422
} else {
1523
DEPLINKMODE = shared
@@ -46,7 +54,7 @@ linux {
4654

4755
BCOMPFX = bcom-
4856

49-
contains(DEPENDENCIESCONFIG,recurse) {
57+
contains(DEPENDENCIESCONFIG,recurse)|contains(DEPENDENCIESCONFIG,recursive) {
5058
message("----------------------------------------------------------------")
5159
message("---- Search recurse dependencies for project $${TARGET} :" )
5260
for (depFile, packagedepsfiles) {
@@ -69,7 +77,10 @@ contains(DEPENDENCIESCONFIG,recurse) {
6977
baseDepFile = $$basename(depFile)
7078
dependencies = $$cat($${depFile})
7179
for(dependency, dependencies) {
80+
fileCurrentDependencies = $$cat($$OUT_PWD/$${TARGET}-$${baseDepFile})
81+
!contains(fileCurrentDependencies, $$dependency) {
7282
write_file($$OUT_PWD/$${TARGET}-$${baseDepFile}, dependency, append)
83+
}
7384
}
7485
QMAKE_CLEAN += $$OUT_PWD/$${TARGET}-$${baseDepFile}
7586
}
@@ -188,11 +199,11 @@ for(depfile, packagedepsfiles) {
188199
!equals(pkg.linkMode,na) {
189200
remakenConanOptions += $${pkg.name}:shared=$${sharedLinkMode}
190201
}
191-
conanOptions = $$split(pkg.toolOptions, $$LITERAL_HASH)
192-
for (conanOption, conanOptions) {
193-
remakenConanOptions += $${pkg.name}:$${conanOption}
202+
conanOptions = $$split(pkg.toolOptions, $$LITERAL_HASH)
203+
for (conanOption, conanOptions) {
204+
remakenConanOptions += $${pkg.name}:$${conanOption}
205+
}
194206
}
195-
}
196207
equals(pkg.repoType,"artifactory") | equals(pkg.repoType,"github") | equals(pkg.repoType,"nexus") {
197208
# custom built package handling
198209
deployFolder=$${REMAKENDEPSFOLDER}/$${BCOM_TARGET_PLATFORM}/$${pkg.name}/$${pkg.version}

remaken_install_target.pri

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Author(s) : Loic Touraine, Stephane Leduc
2+
3+
macx{
4+
}
5+
6+
win32 {
7+
include (win32/qtvs_install_target.pri)
8+
contains(DEPENDENCIESCONFIG,install)|contains(DEPENDENCIESCONFIG,install_recurse) {
9+
include (win32/install_dependencies.pri)
10+
}
11+
}

templateappconfig.pri

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
# Author(s) : Loic Touraine, Stephane Leduc
22

3-
TEMPLATE = app
3+
FRAMEWORK = $$TARGET
4+
5+
# Manage install path
6+
include(bcom_installpath_define.pri)
47

5-
# Detect build toolchain and define BCOM_TARGET_ARCH
6-
include(bcom_arch_define.pri)
8+
TEMPLATE = app
79

810
# Include extended compiler rules
911
include (bcom_compiler_specs.prf)
1012

13+
# Check input parameters existence
14+
# Warning : app targetdeploydir depends on DEPENDENCIESCONFIG, and lib depends on CONFIG
15+
!defined(DEPENDENCIESCONFIG,var) {
16+
warning("DEPENDENCIESCONFIG is not defined : defaulting to shared dependencies mode")
17+
DEPENDENCIESCONFIG = sharedlib
18+
}
19+
contains(DEPENDENCIESCONFIG,staticlib)|contains(DEPENDENCIESCONFIG,static) {
20+
LINKMODE = static
21+
} else {
22+
LINKMODE = shared
23+
}
24+
1125
CONFIG(debug,debug|release) {
1226
OUTPUTDIR = debug
1327
}
@@ -16,6 +30,12 @@ CONFIG(release,debug|release) {
1630
OUTPUTDIR = release
1731
}
1832

33+
# manage default/custom install dir
34+
!defined(TARGETDEPLOYDIR,var) {
35+
TARGETDEPLOYDIR = $${PROJECTDEPLOYDIR}/bin/$${BCOM_TARGET_ARCH}/$${LINKMODE}/$$OUTPUTDIR
36+
warning("TARGETDEPLOYDIR may be defined before templateappconfig.pri inclusion => Defaulting TARGETDEPLOYDIR to $${TARGETDEPLOYDIR}. ")
37+
}
38+
1939
unix {
2040
LIBPREFIX = lib
2141
DYNLIBEXT = so
@@ -43,8 +63,10 @@ win32 {
4363
LIBEXT = lib
4464
APPEXT = exe
4565

46-
# qmake processing only 1 time (http://stackoverflow.com/questions/17360553/qmake-processes-my-pro-file-three-times-instead-of-one)
47-
CONFIG -= debug_and_release
66+
!contains(PROJECTCONFIG,QTVS) {
67+
# qmake processing only 1 time (http://stackoverflow.com/questions/17360553/qmake-processes-my-pro-file-three-times-instead-of-one)
68+
CONFIG -= debug_and_release
69+
}
4870

4971
# multiprocessor build
5072
QMAKE_CXXFLAGS += /MP8
@@ -67,15 +89,28 @@ win32 {
6789
# RC informations
6890
QMAKE_TARGET_COMPANY=b<>com
6991
QMAKE_TARGET_DESCRIPTION=$$TARGET
70-
QMAKE_TARGET_COPYRIGHT=Copyright (c) 2016 b-com
7192
QMAKE_TARGET_PRODUCT=$$TARGET
93+
94+
# manage copyright
95+
QMAKE_TARGET_COPYRIGHT = $$PRODUCT_BRIEF_COPYRIGHT
96+
isEmpty(QMAKE_TARGET_COPYRIGHT) {
97+
year = $$system("echo %Date:~6,4%")
98+
yearCheck = $$find(year, ^\d{4}$)
99+
yearCheckSize = $$size(yearCheck)
100+
!equals(yearCheckSize,1) {
101+
YEAR = 2019 # default date
102+
}
103+
QMAKE_TARGET_COPYRIGHT=Copyright (c) $$year b-com
104+
}
72105
}
73106

107+
target.path = $${TARGETDEPLOYDIR}
108+
INSTALLS += target
109+
74110
# Parse dependencies if any and fill CFLAGS,CXXFLAGS and LFLAGS
75111
include (packagedependencies.pri)
76-
77-
# Add post build copy of dependencies with application
78-
include (bcom_package_app.pri)
112+
# remove .pc and packagedependencies.txt copy
113+
INSTALLS -= package_files
79114

80115
# manage setup creation
81116
contains (CONFIG, app_setup) {

templatelibconfig.pri

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ win32 {
9393
QMAKE_TARGET_PRODUCT=$$TARGET
9494
}
9595

96+
android {
97+
# Disable default qmake management for installing android libraries
98+
# cf https://martin.rpdev.net/2019/05/21/qt-for-android-installing-a-library-built-with-qmake-into-the-qt-directory.html
99+
CONFIG -= android_install
100+
}
101+
96102
target.path = $${TARGETDEPLOYDIR}
97103
INSTALLS += target
98104

win32/bcom_component_app_setup.prf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
include (bcom_check_setup.pri)
44

5-
COPYLOGO_CLEAN_CMD = IF EXIST $${OUT_PWD}/logo.ico rm -rf $${OUT_PWD}/logo.ico
5+
COPYLOGO_CLEAN_CMD = IF EXIST $${OUT_PWD}/logo.ico $$QMAKE_DEL_FILE /f $$shell_path($${OUT_PWD}/logo.ico)
66
bcom_copylogo_clean.commands = $${COPYLOGO_CLEAN_CMD}
77

88
bcom_copylogo_prepare.commands = copy $$shell_quote($$shell_path($${SETUP_ICO_FILE})) $$shell_quote($$shell_path($${OUT_PWD}/logo.ico))
@@ -17,6 +17,8 @@ contains (CONFIG, app_setup)
1717
SETUP_INSTALLDIR=$$shell_quote($$shell_path($$(PROGRAMW6432)/))
1818
}
1919

20+
SETUP_PROJECT_PATH=$$shell_quote($$shell_path($$_PRO_FILE_PWD_))
21+
2022
# Nsis management
2123
SETUP_COPYFILEPATH=$$shell_quote($$shell_path($${OUT_PWD}/))
2224
SETUP_COPYFILENAME=$${TARGET}.$${APPEXT}
@@ -26,7 +28,7 @@ contains (CONFIG, app_setup)
2628
/DSETUP_PRODUCTNAME=$${SETUP_PRODUCTNAME_VALUE} /DSETUP_FILENAME=$${SETUP_FILENAME} \
2729
/DSETUP_VERSION=$${SETUP_VERSION} /DSETUP_GUID=$${SETUP_GUID} \
2830
/DSETUP_INSTALLDIR=$${SETUP_INSTALLDIR} /DSETUP_ICO_FILE=$${SETUP_ICO_FILE} \
29-
/DSETUP_MANUFACTURER=$${SETUP_MANUFACTURER}
31+
/DSETUP_MANUFACTURER=$${SETUP_MANUFACTURER} /DSETUP_PROJECT_PATH=$${SETUP_PROJECT_PATH}
3032

3133
if (!isEmpty(SETUP_COPYFILEPATH):!isEmpty(SETUP_COPYFILENAME)){
3234
NSISCOMMAND += /DSETUP_COPYFILEPATH=$${SETUP_COPYFILEPATH} /DSETUP_COPYFILENAME=$${SETUP_COPYFILENAME}

win32/bcom_component_bundle_setup.prf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
include (bcom_check_setup.pri)
44

5-
COPYLOGO_CLEAN_CMD = IF EXIST $${OUT_PWD}/logo.ico rm -rf $${OUT_PWD}/logo.ico
5+
COPYLOGO_CLEAN_CMD = IF EXIST $${OUT_PWD}/logo.ico $$QMAKE_DEL_FILE /f $$shell_path($${OUT_PWD}/logo.ico)
66
bcom_copylogo_clean.commands = $${COPYLOGO_CLEAN_CMD}
77

88
bcom_copylogo_prepare.commands = copy $$shell_quote($$shell_path($${SETUP_ICO_FILE})) $$shell_quote($$shell_path($${OUT_PWD}/logo.ico))

0 commit comments

Comments
 (0)