From ae1c1a741caf29eb14824234911fc83e7f27acf9 Mon Sep 17 00:00:00 2001 From: Paul I Date: Wed, 10 Apr 2019 22:14:55 +0300 Subject: [PATCH] Add CUTTER_DEPS_DIR option --- .appveyor.yml | 2 +- src/Cutter.pro | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 313a4120..a5883afc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -49,7 +49,7 @@ before_build: # Build config build_script: - - cmd: if defined QMAKE ( call prepare_r2.bat && call build.bat CUTTER_APPVEYOR_R2DEC=true CUTTER_ENABLE_CRASH_REPORTS=true CUTTER_ENABLE_PYTHON=true CUTTER_ENABLE_PYTHON_BINDINGS=true SHIBOKEN_EXECUTABLE="%CUTTER_DEPS_DIR%\pyside\bin\shiboken2.exe" SHIBOKEN_INCLUDEDIR="%CUTTER_DEPS_DIR%/pyside/include/shiboken2" SHIBOKEN_LIBRARY="%CUTTER_DEPS_DIR%/pyside/lib/shiboken2.lib" PYSIDE_INCLUDEDIR="%CUTTER_DEPS_DIR%/pyside/include/PySide2" PYSIDE_LIBRARY="%CUTTER_DEPS_DIR%/pyside/lib/pyside2.lib" PYSIDE_TYPESYSTEMS="%CUTTER_DEPS_DIR%/pyside/share/PySide2/typesystems") + - cmd: if defined QMAKE ( call prepare_r2.bat && call build.bat CUTTER_APPVEYOR_R2DEC=true CUTTER_ENABLE_CRASH_REPORTS=true CUTTER_ENABLE_PYTHON=true CUTTER_ENABLE_PYTHON_BINDINGS=true CUTTER_DEPS_DIR="%CUTTER_DEPS_DIR%" ) - cmd: if defined MESON ( python meson.py --release --dist=%ARTIFACT_PATH% --backend=%BACKEND% --python ) after_build: diff --git a/src/Cutter.pro b/src/Cutter.pro index 1ed8f3d7..a0edd53d 100644 --- a/src/Cutter.pro +++ b/src/Cutter.pro @@ -32,8 +32,9 @@ QT += core gui widgets svg network QT_CONFIG -= no-pkg-config CONFIG += c++11 -!defined(CUTTER_ENABLE_CRASH_REPORTS, var) CUTTER_ENABLE_CRASH_REPORTS=false -equals(CUTTER_ENABLE_CRASH_REPORTS, true) CONFIG += CUTTER_ENABLE_CRASH_REPORTS +!defined(CUTTER_ENABLE_CRASH_REPORTS, var) CUTTER_ENABLE_CRASH_REPORTS=false +equals(CUTTER_ENABLE_CRASH_REPORTS, true) CONFIG += CUTTER_ENABLE_CRASH_REPORTS + !defined(CUTTER_ENABLE_PYTHON, var) CUTTER_ENABLE_PYTHON=false equals(CUTTER_ENABLE_PYTHON, true) CONFIG += CUTTER_ENABLE_PYTHON @@ -71,6 +72,15 @@ CUTTER_ENABLE_PYTHON_BINDINGS { message("Python Bindings disabled. (requires CUTTER_ENABLE_PYTHON=true)") } +win32:defined(CUTTER_DEPS_DIR, var) { + !defined(SHIBOKEN_EXECUTABLE, var) SHIBOKEN_EXECUTABLE="$${CUTTER_DEPS_DIR}/pyside/bin/shiboken2.exe" + !defined(SHIBOKEN_INCLUDEDIR, var) SHIBOKEN_INCLUDEDIR="$${CUTTER_DEPS_DIR}/pyside/include/shiboken2" + !defined(SHIBOKEN_LIBRARY, var) SHIBOKEN_LIBRARY="$${CUTTER_DEPS_DIR}/pyside/lib/shiboken2.lib" + !defined(PYSIDE_INCLUDEDIR, var) PYSIDE_INCLUDEDIR="$${CUTTER_DEPS_DIR}/pyside/include/PySide2" + !defined(PYSIDE_LIBRARY, var) PYSIDE_LIBRARY="$${CUTTER_DEPS_DIR}/pyside/lib/pyside2.lib" + !defined(PYSIDE_TYPESYSTEMS, var) PYSIDE_TYPESYSTEMS="$${CUTTER_DEPS_DIR}/pyside/share/PySide2/typesystems" +} + INCLUDEPATH *= . core widgets dialogs common plugins win32 { @@ -173,7 +183,7 @@ CUTTER_ENABLE_PYTHON { SHIBOKEN_OPTIONS = --project-file="$${BINDINGS_BUILD_DIR}/bindings.txt" win32:SHIBOKEN_OPTIONS += --avoid-protected-hack bindings.target = bindings_target - bindings.commands = "$${SHIBOKEN_EXECUTABLE}" $${SHIBOKEN_OPTIONS} + bindings.commands = $$quote($$system_path($${SHIBOKEN_EXECUTABLE})) $${SHIBOKEN_OPTIONS} QMAKE_EXTRA_TARGETS += bindings PRE_TARGETDEPS += bindings_target GENERATED_SOURCES += $${BINDINGS_SOURCE}