git-svn-id: svn://db.shs.com.ru/libs@821 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -4,13 +4,14 @@
|
|||||||
|
|
||||||
using namespace PICoutManipulators;
|
using namespace PICoutManipulators;
|
||||||
|
|
||||||
PIString cmd_copy, cmd_copydir;
|
PIString cmd_copy, cmd_copydir, cmd_suffix;
|
||||||
PIString qplatforms;
|
PIString qplatforms;
|
||||||
|
|
||||||
void setCommands() {
|
void setCommands() {
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
cmd_copy = "copy /y ";
|
cmd_copy = "copy /y ";
|
||||||
cmd_copydir = "copy /y ";
|
cmd_copydir = "copy /y ";
|
||||||
|
cmd_suffix = " 1> NUL";
|
||||||
qplatforms = "windows";
|
qplatforms = "windows";
|
||||||
#else
|
#else
|
||||||
cmd_copy = "cp -f ";
|
cmd_copy = "cp -f ";
|
||||||
@@ -206,9 +207,9 @@ void copyWildcard(const PIString & from, const PIString & to) {
|
|||||||
PIDir(to).make();
|
PIDir(to).make();
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
PIFile::FileInfo fi; fi.path = from;
|
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
|
#else
|
||||||
system(cmd_copy + from + " \"" + to + "/\"");
|
system(cmd_copy + from + " \"" + to + "/\"" + cmd_suffix);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,7 +358,7 @@ int main(int argc, char * argv[]) {
|
|||||||
piForeachC (PIString & l, clibs) {
|
piForeachC (PIString & l, clibs) {
|
||||||
piCout << "copy" << l;
|
piCout << "copy" << l;
|
||||||
if (!fake)
|
if (!fake)
|
||||||
system(cmd_copy + "\"" + l + "\" \"" + out_dir + "\"");
|
system(cmd_copy + "\"" + l + "\" \"" + out_dir + "\"" + cmd_suffix);
|
||||||
}
|
}
|
||||||
PIVector<PIString> fwdirs = frameworks.toVector();
|
PIVector<PIString> fwdirs = frameworks.toVector();
|
||||||
piForeachC (PIString & f, fwdirs) {
|
piForeachC (PIString & f, fwdirs) {
|
||||||
@@ -365,7 +366,7 @@ int main(int argc, char * argv[]) {
|
|||||||
if (!fd.isEmpty()) {
|
if (!fd.isEmpty()) {
|
||||||
piCout << "copy framework" << f;
|
piCout << "copy framework" << f;
|
||||||
if (!fake)
|
if (!fake)
|
||||||
system(cmd_copydir + "\"" + fd + "\" \"" + out_dir + "\"");
|
system(cmd_copydir + "\"" + fd + "\" \"" + out_dir + "\"" + cmd_suffix);
|
||||||
} else
|
} else
|
||||||
miss_frameworks << f;
|
miss_frameworks << f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ macro(qad_plugin NAME _MODULES _LIBS)
|
|||||||
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
||||||
qt_add_library(${PROJ_NAME} SHARED out_CPP)
|
qt_add_library(${PROJ_NAME} SHARED out_CPP)
|
||||||
qt_target_link_libraries(${PROJ_NAME} ${_LIBS} qad_${NAME} ${_${NAME}_PLUGIN_LIBS})
|
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()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|||||||
@@ -164,6 +164,40 @@ macro(deploy_target _T)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
#message("app depend libpath ${_DEP_LIBPATH}")
|
#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)
|
if (APPLE)
|
||||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "${${_T}_FULLNAME}")
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER "${${_T}_FULLNAME}")
|
||||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${${_T}_VERSION}")
|
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${${_T}_VERSION}")
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ if (DESIGNER_PLUGINS)
|
|||||||
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
||||||
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
||||||
qt_target_link_libraries(${PROJECT_NAME} qglengine)
|
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()
|
endif()
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ if (DESIGNER_PLUGINS)
|
|||||||
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
||||||
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
||||||
qt_target_link_libraries(${PROJECT_NAME} qglview)
|
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()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user