From f523e1a9264e72372ff5615bf018485bb0c44f36 Mon Sep 17 00:00:00 2001 From: Skycoder42 Date: Sun, 15 Jul 2018 12:14:55 +0200 Subject: [PATCH] fixup tools for win --- mkspecs/features/qsettingsgenerator.prf | 24 ++++-------------------- mkspecs/features/qsettingstranslator.prf | 23 +++++++++++++++++++++++ src/mvvmcore/mvvmcore.pro | 2 +- 3 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 mkspecs/features/qsettingstranslator.prf diff --git a/mkspecs/features/qsettingsgenerator.prf b/mkspecs/features/qsettingsgenerator.prf index 67bbd2a..22a85e2 100644 --- a/mkspecs/features/qsettingsgenerator.prf +++ b/mkspecs/features/qsettingsgenerator.prf @@ -2,27 +2,11 @@ isEmpty(QMAKE_QSETTINGSGENERATOR): qtPrepareTool(QMAKE_QSETTINGSGENERATOR, qsett isEmpty(QSETTINGSGENERATOR_DIR): QSETTINGSGENERATOR_DIR = . isEmpty(MOC_DIR): MOC_DIR = . -isEmpty(QSETTINGSTRANSLATOR_DIR): QSETTINGSTRANSLATOR_DIR = $$_PRO_FILE_PWD_/.ts-dummy - -!ReleaseBuild:!DebugBuild: { - qsettingstranslator_c.name = qsettingsgenerator --translate ${QMAKE_FILE_IN} - qsettingstranslator_c.input = SETTINGS_TRANSLATIONS #TODO compability - qsettingstranslator_c.variable_out = CPP_DUMMIES - qsettingstranslator_c.commands = $$QMAKE_QSETTINGSGENERATOR --translate --in ${QMAKE_FILE_IN} --impl ${QMAKE_FILE_OUT} - qsettingstranslator_c.output = $$QSETTINGSTRANSLATOR_DIR/${QMAKE_FILE_BASE}.tsdummy$${first(QMAKE_EXT_CPP)} - qsettingstranslator_c.CONFIG += no_link - qsettingstranslator_c.depends += $$QMAKE_QSETTINGSGENERATOR_EXE - - QMAKE_EXTRA_COMPILERS += qsettingstranslator_c - - qtmvvm_tsgen_target.target = qtmvvm-tsgen - qtmvvm_tsgen_target.depends += compiler_qsettingstranslator_c_make_all - qtmvvm_tsgen_target.commands += @echo $$shell_quote(>>> Remember to add the line \"_never_true_condition: SOURCES += $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}files($${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/.ts-dummy/*)\" to your pro file) - QMAKE_EXTRA_TARGETS += qtmvvm_tsgen_target -} else { - qtmvvm_tsgen_target.target = qtmvvm-tsgen - QMAKE_EXTRA_TARGETS += qtmvvm_tsgen_target +debug_and_release { + CONFIG(debug, debug|release):SUFFIX = /debug + CONFIG(release, debug|release):SUFFIX = /release } +QSETTINGSGENERATOR_DIR = $$QSETTINGSGENERATOR_DIR$$SUFFIX { qsettingsgenerator_c.name = qsettingsgenerator ${QMAKE_FILE_IN}.h diff --git a/mkspecs/features/qsettingstranslator.prf b/mkspecs/features/qsettingstranslator.prf new file mode 100644 index 0000000..bf470c9 --- /dev/null +++ b/mkspecs/features/qsettingstranslator.prf @@ -0,0 +1,23 @@ +isEmpty(QMAKE_QSETTINGSGENERATOR): qtPrepareTool(QMAKE_QSETTINGSGENERATOR, qsettingsgenerator) + +isEmpty(QSETTINGSTRANSLATOR_DIR): QSETTINGSTRANSLATOR_DIR = $$_PRO_FILE_PWD_/.ts-dummy + +!ReleaseBuild:!DebugBuild: { + qsettingstranslator_c.name = qsettingsgenerator --translate ${QMAKE_FILE_IN} + qsettingstranslator_c.input = SETTINGS_TRANSLATIONS #TODO compability + qsettingstranslator_c.variable_out = CPP_DUMMIES + qsettingstranslator_c.commands = $$QMAKE_QSETTINGSGENERATOR --translate --in ${QMAKE_FILE_IN} --impl ${QMAKE_FILE_OUT} + qsettingstranslator_c.output = $$QSETTINGSTRANSLATOR_DIR/${QMAKE_FILE_BASE}.tsdummy$${first(QMAKE_EXT_CPP)} + qsettingstranslator_c.CONFIG += no_link + qsettingstranslator_c.depends += $$QMAKE_QSETTINGSGENERATOR_EXE + + QMAKE_EXTRA_COMPILERS += qsettingstranslator_c + + qtmvvm_tsgen_target.target = qtmvvm-tsgen + qtmvvm_tsgen_target.depends += compiler_qsettingstranslator_c_make_all + qtmvvm_tsgen_target.commands += @echo $$shell_quote(>>> Remember to add the line \"_never_true_condition: SOURCES += $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}files($${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/.ts-dummy/*)\" to your pro file) + QMAKE_EXTRA_TARGETS += qtmvvm_tsgen_target +} else { + qtmvvm_tsgen_target.target = qtmvvm-tsgen + QMAKE_EXTRA_TARGETS += qtmvvm_tsgen_target +} diff --git a/src/mvvmcore/mvvmcore.pro b/src/mvvmcore/mvvmcore.pro index 1ebaf5f..500abae 100644 --- a/src/mvvmcore/mvvmcore.pro +++ b/src/mvvmcore/mvvmcore.pro @@ -1,7 +1,7 @@ TARGET = QtMvvmCore QT = core gui -MODULE_CONFIG += qsettingsgenerator +MODULE_CONFIG += qsettingsgenerator qsettingstranslator HEADERS += \ viewmodel.h \