From 38ac23486281b90ede6d8eb2c07c57b1910c4334 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 7 May 2018 07:30:29 +0200 Subject: [PATCH] Fixed Windows compile with pre-compiled libraries Added new variable EXTERNAL_LIB_DIR to specify path of external libraries --- plugins/VOIP/VOIP.pro | 2 +- retroshare.pri | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/VOIP/VOIP.pro b/plugins/VOIP/VOIP.pro index c0dc92e7e..a1102b78e 100644 --- a/plugins/VOIP/VOIP.pro +++ b/plugins/VOIP/VOIP.pro @@ -43,7 +43,7 @@ win32 { OPENCV_VERSION = "341" USE_PRECOMPILED_LIBS = - for(lib, LIB_DIR) { + for(lib, RS_LIB_DIR) { #message(Scanning $$lib) exists( $$lib/opencv/libopencv_core$${OPENCV_VERSION}.a) { isEmpty(USE_PRECOMPILED_LIBS) { diff --git a/retroshare.pri b/retroshare.pri index 6f2b371ee..4d36fd088 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -375,6 +375,11 @@ android-* { } win32-g++ { + !isEmpty(EXTERNAL_LIB_DIR) { + message(Use pre-compiled libraries in $${EXTERNAL_LIB_DIR}.) + PREFIX = $$system_path($$EXTERNAL_LIB_DIR) + } + PREFIX_MSYS2 = $$(MINGW_PREFIX) isEmpty(PREFIX_MSYS2) { message("MINGW_PREFIX is not set, attempting MSYS2 autodiscovery.") @@ -389,22 +394,24 @@ win32-g++ { PREFIX_MSYS2=$${TEMPTATIVE_MSYS2} } - isEmpty(PREFIX_MSYS2) { - error(Cannot find MSYS2 please set MINGW_PREFIX) - } else { + !isEmpty(PREFIX_MSYS2) { message(Found MSYS2: $${PREFIX_MSYS2}) + + isEmpty(PREFIX) { + PREFIX = $$system_path($${PREFIX_MSYS2}) + } } } isEmpty(PREFIX) { - PREFIX = $$system_path($${PREFIX_MSYS2}) + error(PREFIX is not set. Set either EXTERNAL_LIB_DIR or PREFIX_MSYS2.) } INCLUDEPATH *= $$system_path($${PREFIX}/include) - INCLUDEPATH *= $$system_path($${PREFIX_MSYS2}/include) + !isEmpty(PREFIX_MSYS2) : INCLUDEPATH *= $$system_path($${PREFIX_MSYS2}/include) QMAKE_LIBDIR *= $$system_path($${PREFIX}/lib) - QMAKE_LIBDIR *= $$system_path($${PREFIX_MSYS2}/lib) + !isEmpty(PREFIX_MSYS2) : QMAKE_LIBDIR *= $$system_path($${PREFIX_MSYS2}/lib) RS_BIN_DIR = $$system_path($${PREFIX}/bin) RS_INCLUDE_DIR = $$system_path($${PREFIX}/include)