git-svn-id: svn://db.shs.com.ru/libs@821 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2020-03-18 15:18:30 +00:00
parent 79db045ee1
commit 08551fa0b6
5 changed files with 43 additions and 8 deletions

View File

@@ -4,13 +4,14 @@
using namespace PICoutManipulators;
PIString cmd_copy, cmd_copydir;
PIString cmd_copy, cmd_copydir, cmd_suffix;
PIString qplatforms;
void setCommands() {
#ifdef WINDOWS
cmd_copy = "copy /y ";
cmd_copydir = "copy /y ";
cmd_suffix = " 1> NUL";
qplatforms = "windows";
#else
cmd_copy = "cp -f ";
@@ -206,9 +207,9 @@ void copyWildcard(const PIString & from, const PIString & to) {
PIDir(to).make();
#ifdef WINDOWS
PIFile::FileInfo fi; fi.path = from;
system("robocopy \"" + fi.dir() + "\" \"" + to + "\" \"" + fi.name() + "\" /NJH /NJS /NP /NDL /NS /NC /NFL");
system("robocopy \"" + fi.dir() + "\" \"" + to + "\" \"" + fi.name() + "\" /NJH /NJS /NP /NDL /NS /NC /NFL 1> NUL");
#else
system(cmd_copy + from + " \"" + to + "/\"");
system(cmd_copy + from + " \"" + to + "/\"" + cmd_suffix);
#endif
}
@@ -357,7 +358,7 @@ int main(int argc, char * argv[]) {
piForeachC (PIString & l, clibs) {
piCout << "copy" << l;
if (!fake)
system(cmd_copy + "\"" + l + "\" \"" + out_dir + "\"");
system(cmd_copy + "\"" + l + "\" \"" + out_dir + "\"" + cmd_suffix);
}
PIVector<PIString> fwdirs = frameworks.toVector();
piForeachC (PIString & f, fwdirs) {
@@ -365,7 +366,7 @@ int main(int argc, char * argv[]) {
if (!fd.isEmpty()) {
piCout << "copy framework" << f;
if (!fake)
system(cmd_copydir + "\"" + fd + "\" \"" + out_dir + "\"");
system(cmd_copydir + "\"" + fd + "\" \"" + out_dir + "\"" + cmd_suffix);
} else
miss_frameworks << f;
}

View File

@@ -112,7 +112,7 @@ macro(qad_plugin NAME _MODULES _LIBS)
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
qt_add_library(${PROJ_NAME} SHARED out_CPP)
qt_target_link_libraries(${PROJ_NAME} ${_LIBS} qad_${NAME} ${_${NAME}_PLUGIN_LIBS})
qt_install(TARGETS ${PROJ_NAME} DESTINATION QtPlugins/designer)
qt_install(TARGETS ${PROJ_NAME} RUNTIME DESTINATION QtPlugins/designer)
endif()
endif()
endmacro()

View File

@@ -164,6 +164,40 @@ macro(deploy_target _T)
endif()
endforeach()
#message("app depend libpath ${_DEP_LIBPATH}")
if (WIN32)
if (NOT CMAKE_OBJDUMP)
find_program(CMAKE_OBJDUMP objdump)
endif()
set(_AGD "${_DEPLOY_DIR}/${_TV}")
set(_SEP "/")
set(_COPY "cp" "-rf")
set(_COPY_SUFFIX)
set(_MKDIR "mkdir" "-p" "${_AGD}")
set(_MKDIR_L "mkdir" "-p" "${_AGD}/lang")
if ("x${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "xWindows")
set(_SEP "\\")
set(_COPY "xcopy" "/y" "/r")
set(_COPY_SUFFIX "1>" "NUL")
file(TO_NATIVE_PATH "${_AGD}/" _AGD)
file(TO_NATIVE_PATH "${_DEPLOY_DIR}/" _DEPLOY_DIR)
string(REPLACE "/" "\\" _AGD "${_AGD}")
string(REPLACE "/" "\\" _DEPLOY_DIR "${_DEPLOY_DIR}")
string(REPLACE "/" "\\" CMAKE_OBJDUMP "${CMAKE_OBJDUMP}")
set(_MKDIR "if" "not" "exist" "\"${_AGD}\"" "mkdir" "\"${_AGD}\"")
set(_MKDIR_L "if" "not" "exist" "\"${_AGD}lang\"" "mkdir" "\"${_AGD}lang\"")
endif()
add_custom_target(deploy
# gather dir
COMMAND ${_MKDIR}
COMMAND ${_MKDIR_L}
COMMAND ${_COPY} "\"${_DEPLOY_DIR}${_T}.exe\"" "\"${_AGD}\"" ${_COPY_SUFFIX}
COMMAND ${_COPY} "\"${_DEPLOY_DIR}lang${_SEP}*\"" "\"${_AGD}lang${_SEP}\"" ${_COPY_SUFFIX}
COMMAND deploy_tool -W "\"${CMAKE_OBJDUMP}\"" -P windows -S windows -q "\"${Qt5_ROOT}\"" -s "\"${CMAKE_PREFIX_PATH}/bin\;${MINGW_BIN};${DEPLOY_ADD_LIBPATH}${_DEP_LIBPATH}\"" -o ${_AGD} -p ${_AGD} "\"${_AGD}${_T}.exe\""
# zip
COMMAND cd "\"${_DEPLOY_DIR}\"" "&&" zip -r "\"${_DESTINATION}/${_TV}.zip\"" "\"${_TV}\""
COMMENT "Generating ${_TV}.zip"
)
endif()
if (APPLE)
set(MACOSX_BUNDLE_GUI_IDENTIFIER "${${_T}_FULLNAME}")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${${_T}_VERSION}")

View File

@@ -10,5 +10,5 @@ if (DESIGNER_PLUGINS)
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
qt_target_link_libraries(${PROJECT_NAME} qglengine)
qt_install(TARGETS ${PROJECT_NAME} DESTINATION QtPlugins/designer)
qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer)
endif()

View File

@@ -10,5 +10,5 @@ if (DESIGNER_PLUGINS)
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
qt_target_link_libraries(${PROJECT_NAME} qglview)
qt_install(TARGETS ${PROJECT_NAME} DESTINATION QtPlugins/designer)
qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer)
endif()