From d093942330e393bb5569ddf05728f0bc44ff871d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Thu, 16 Apr 2020 07:24:03 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@1018 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- cmake/DeployMacros.cmake | 15 +++++++++++---- utils/deploy_tool/main.cpp | 20 +++++++++++--------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cmake/DeployMacros.cmake b/cmake/DeployMacros.cmake index b02eef18..55a98138 100644 --- a/cmake/DeployMacros.cmake +++ b/cmake/DeployMacros.cmake @@ -133,6 +133,7 @@ set(_modules_dir "${CMAKE_ROOT}/Modules") if (LIBPROJECT) set(_modules_dir ${PIP_CMAKE_MODULE_PATH}) endif() +set(_dt_delim "::") macro(set_version _T) @@ -491,7 +492,7 @@ macro(deploy_target _T) #message("depend on ${_L}") get_target_property(_LT ${_L} TYPE) if ("x${_LT}" STREQUAL "xSHARED_LIBRARY") - set(_DEP_LIBPATH "${_DEP_LIBPATH}!$") + set(_DEP_LIBPATH "${_DEP_LIBPATH}${_dt_delim}$") set(_DEP_LIBS_CS "${_DEP_LIBS_CS};$/$") set(_DEP_LIBS "${_DEP_LIBS}" "$/$") endif() @@ -601,7 +602,7 @@ macro(deploy_target _T) # gather dir ${_CMD_} - COMMAND deploy_tool ${_VERB} ${_OPTIONS} -W "\"${CMAKE_OBJDUMP}\"" -P windows,minimal -S windows -q "\"${Qt5_ROOT}\"" -s "\"${CMAKE_PREFIX_PATH}/bin!${MINGW_BIN}!${DEPLOY_ADD_LIBPATH}${_DEP_LIBPATH}\"" -o ${_AGD} -p ${_AGD} "\"${_AGD}${_T}.exe\"" ${_ADD_DEPS} + COMMAND deploy_tool ${_VERB} ${_OPTIONS} -W "\"${CMAKE_OBJDUMP}\"" -P windows,minimal -S windows -q "\"${Qt5_ROOT}\"" -s "\"${CMAKE_PREFIX_PATH}/bin${_dt_delim}${MINGW_BIN}${_dt_delim}${DEPLOY_ADD_LIBPATH}${_DEP_LIBPATH}\"" -o ${_AGD} -p ${_AGD} "\"${_AGD}${_T}.exe\"" ${_ADD_DEPS} # zip COMMAND cd "\"${_DEPLOY_DIR}\"" "&&" zip -q -r "\"${_DESTINATION}/${_TV}.zip\"" "\"${_TV}_win_${MY_ARCH}\"" COMMENT "Generating ${_TV}.zip" @@ -627,6 +628,12 @@ macro(deploy_target _T) if (_ICON_NAME) set(_CMD_ ${_CMD_} COMMAND cp ${_VERB} -f ${_ICON_FN} ${_AGD}/Contents/Resources) endif() + if (NOT CMAKE_OTOOL) + set(CMAKE_OTOOL "otool") + endif() + if (NOT CMAKE_PREFIX_PATH) + set(CMAKE_PREFIX_PATH "/usr/local") + endif() add_custom_target(deploy_${_T} # gather .app dir COMMAND mkdir ${_VERB} -p ${_AGD}/Contents/Resources @@ -635,7 +642,7 @@ macro(deploy_target _T) ${_CMD_} #COMMAND cp ${_ICON_FN} ${_AGD}/Contents/Resources #COMMAND cp -r ${_DEPLOY_DIR}/lang ${_AGD}/Contents/Resources - COMMAND deploy_tool ${_VERB} ${_OPTIONS} -M "${CMAKE_OTOOL}" -P cocoa,minimal -S mac -q ${Qt5_ROOT} -s "\"${CMAKE_PREFIX_PATH}/lib!${DEPLOY_ADD_LIBPATH}${_DEP_LIBPATH}\"" -o ${_AGD}/Contents/Frameworks -p ${_AGD}/Contents/PlugIns ${_AGD}/Contents/MacOS/${_T} ${_ADD_DEPS} + COMMAND deploy_tool ${_VERB} ${_OPTIONS} -M "${CMAKE_OTOOL}" -P cocoa,minimal -S mac -q ${Qt5_ROOT} -s "\"${CMAKE_PREFIX_PATH}/lib${_dt_delim}${DEPLOY_ADD_LIBPATH}${_DEP_LIBPATH}\"" -o ${_AGD}/Contents/Frameworks -p ${_AGD}/Contents/PlugIns ${_AGD}/Contents/MacOS/${_T} ${_ADD_DEPS} # prepare dmg dir COMMAND rm -rf ${_DMG} COMMAND mkdir ${_VERB} -p ${_DMG} @@ -721,7 +728,7 @@ macro(deploy_target _T) string(REPLACE "${ANDROID_SYSROOT_${ANDROID_ABI}}" "${ANDROID_SYSROOT_${_a}}" _lib_${_a} "${_lib_}") #message("search = ${_a_prefix}/lib") __make_copy(_CMD_ _empty _lib_${_a} "${_AGD}/libs/${_a}") - set(_CMD_ ${_CMD_} COMMAND deploy_tool ${_VERB} ${_OPTIONS} -W "\"${CMAKE_OBJDUMP}\"" -s "${_a_prefix}/lib!${Qt5_ROOT}/lib" -o "\"${_AGD}/libs/${_a}\"" --ignore "\"c!m!dl\"" "\"${_AGD}/libs/${_a}/lib${_AT}_${_a}.so\"" ${_ADD_DEPS}) + set(_CMD_ ${_CMD_} COMMAND deploy_tool ${_VERB} ${_OPTIONS} -W "\"${CMAKE_OBJDUMP}\"" -s "${_a_prefix}/lib${_dt_delim}${Qt5_ROOT}/lib" -o "\"${_AGD}/libs/${_a}\"" --ignore "\"c${_dt_delim}m${_dt_delim}z${_dt_delim}dl${_dt_delim}log\"" "\"${_AGD}/libs/${_a}/lib${_AT}_${_a}.so\"" ${_ADD_DEPS}) #message("c++_${_a} -> ${_lib_${_a}}") endif() endforeach() diff --git a/utils/deploy_tool/main.cpp b/utils/deploy_tool/main.cpp index b24f3e37..448c177f 100644 --- a/utils/deploy_tool/main.cpp +++ b/utils/deploy_tool/main.cpp @@ -2,6 +2,8 @@ #include #include +#define DELIM "::" + using namespace PICoutManipulators; PIString cmd_copy, cmd_copydir, cmd_suffix; @@ -36,8 +38,8 @@ void usage() { piCout << "If some Qt dependency found, copy corresponding Qt plugins."; piCout << "Styles and platforms selected by -S and -P flags,"; piCout << "any other plugins described by --qt-plugins flag in next format:"; - piCout << "\"[*=!]=,!=,\", e.g."; - piCout << "\"sqldrivers=lite,mysql!geoservices=!position=nmea\"."; + piCout << "\"[*="DELIM"]=,"DELIM"=,\", e.g."; + piCout << "\"sqldrivers=lite,mysql"DELIM"geoservices="DELIM"position=nmea\"."; piCout << "If no regexp specified for plugins, nothing will be copied."; piCout << "Default regexp set by \"*=\"."; piCout << "\"*=\" disable optional plugins."; @@ -54,8 +56,8 @@ void usage() { piCout << ""; piCout << Bold << "Processing control"; piCout << "-f, --fake " << Green << "- don`t copy, only print"; - piCout << "-s " << Green << "- set search pathes for system libraries, may be separated by \"!\", default \"/usr/lib\""; - piCout << "--ignore " << Green << "- ignore libraries names, may be separated by \"!\", default \"\""; + piCout << "-s " << Green << "- set search pathes for system libraries, may be separated by \""DELIM"\", default \"/usr/lib\""; + piCout << "--ignore " << Green << "- ignore libraries names, may be separated by \""DELIM"\", default \"\""; piCout << "-l " << Green << "- \"ldd\" path, default \"/usr/bin/ldd\""; piCout << "-L " << Green << "- \"readelf\" path, overrides \"ldd\""; piCout << "-W " << Green << "- \"objdump\" path, overrides \"ldd\""; @@ -79,7 +81,7 @@ void usage() { piCout << ""; piCout << Bold << "Input control"; piCout << " ... " << Green << "- executable to process"; - piCout << "-a " << Green << "- additional libs, separated by \"!\". Libraries will be searched in "; + piCout << "-a " << Green << "- additional libs, separated by \""DELIM"\". Libraries will be searched in "; } struct QtDep { @@ -391,9 +393,9 @@ int main(int argc, char * argv[]) { piDebug = cli.hasArgument("verbose"); is_deps = cli.hasArgument("dependencies"); out_dir = cli.argumentValue("output"); - lib_dirs = cli.argumentValue("search_path").split("!"); - add_libs = cli.argumentValue("add_libs").split("!"); - ignore_libs = cli.argumentValue("ignore").split("!"); + lib_dirs = cli.argumentValue("search_path").split(DELIM); + add_libs = cli.argumentValue("add_libs").split(DELIM); + ignore_libs = cli.argumentValue("ignore").split(DELIM); qt_dir = cli.argumentValue("qtdir"); ldd = cli.argumentValue("ldd"); readelf = cli.argumentValue("Lreadelf"); @@ -446,7 +448,7 @@ int main(int argc, char * argv[]) { platforms = qplatforms.split(","); styles = cli.argumentValue("Styles").split(","); if (styles.isEmpty()) styles << ""; - PIStringList qpd = cli.argumentValue("qt-plugins").toLowerCase().split("!"); + PIStringList qpd = cli.argumentValue("qt-plugins").toLowerCase().split(DELIM); piForeachC (PIString & qp, qpd) { int _i = qp.indexOf("="); if (_i < 0) continue;