git-svn-id: svn://db.shs.com.ru/libs@878 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -106,7 +106,7 @@ END
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
# usage: deploy_target(<target> [DEPLOY_DIR <dir>] [DESTINATION <dir>] [NO_AUTO_ICON_EXT])
|
# usage: deploy_target(<target> [DEPLOY_DIR <dir>] [DESTINATION <dir>] [RESOURCE_DIRS <dir> [<dir> ...]])
|
||||||
#
|
#
|
||||||
# DEPLOY_DIR - dir where you install
|
# DEPLOY_DIR - dir where you install
|
||||||
# * executable on Windows, Linux
|
# * executable on Windows, Linux
|
||||||
@@ -132,24 +132,30 @@ endmacro()
|
|||||||
macro(deploy_target _T)
|
macro(deploy_target _T)
|
||||||
set(_DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
set(_DESTINATION "${CMAKE_INSTALL_PREFIX}")
|
||||||
set(_DEPLOY_DIR "${CMAKE_INSTALL_PREFIX}")
|
set(_DEPLOY_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||||
|
set(_RES_DIRS)
|
||||||
set(_is_dest 0)
|
set(_is_dest 0)
|
||||||
set(_is_deploy_dir 0)
|
set(_is_deploy_dir 0)
|
||||||
|
set(_is_res_dirs 0)
|
||||||
foreach(_i ${ARGN})
|
foreach(_i ${ARGN})
|
||||||
if (_is_dest)
|
if (_is_dest)
|
||||||
set(_is_dest 0)
|
set(_is_dest 0)
|
||||||
set(_DESTINATION "${_i}/")
|
set(_DESTINATION "${_i}/")
|
||||||
else()
|
elseif (_is_deploy_dir)
|
||||||
if (_is_deploy_dir)
|
set(_is_deploy_dir 0)
|
||||||
set(_is_deploy_dir 0)
|
set(_DEPLOY_DIR "${_i}/")
|
||||||
set(_DEPLOY_DIR "${_i}/")
|
elseif (_is_res_dirs)
|
||||||
|
if (IS_ABSOLUTE "${_i}")
|
||||||
|
list(APPEND _RES_DIRS "${_i}")
|
||||||
else()
|
else()
|
||||||
if ("x${_i}" STREQUAL "xDESTINATION")
|
list(APPEND _RES_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/${_i}")
|
||||||
set(_is_dest 1)
|
endif()
|
||||||
else()
|
else()
|
||||||
if ("x${_i}" STREQUAL "xDEPLOY_DIR")
|
if ("x${_i}" STREQUAL "xDESTINATION")
|
||||||
set(_is_deploy_dir 1)
|
set(_is_dest 1)
|
||||||
endif()
|
elseif ("x${_i}" STREQUAL "xDEPLOY_DIR")
|
||||||
endif()
|
set(_is_deploy_dir 1)
|
||||||
|
elseif ("x${_i}" STREQUAL "xRESOURCE_DIRS")
|
||||||
|
set(_is_res_dirs 1)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
#message("-i = ${_i}")
|
#message("-i = ${_i}")
|
||||||
@@ -203,6 +209,10 @@ macro(deploy_target _T)
|
|||||||
set(_C_echo ">>" "${_AGD}/DEBIAN/control")
|
set(_C_echo ">>" "${_AGD}/DEBIAN/control")
|
||||||
set(_D_echof ">" "${_AGD}/usr/share/applications/${_DEBNAME}.desktop")
|
set(_D_echof ">" "${_AGD}/usr/share/applications/${_DEBNAME}.desktop")
|
||||||
set(_D_echo ">>" "${_AGD}/usr/share/applications/${_DEBNAME}.desktop")
|
set(_D_echo ">>" "${_AGD}/usr/share/applications/${_DEBNAME}.desktop")
|
||||||
|
set(_CMD_RES)
|
||||||
|
foreach(_r ${_RES_DIRS})
|
||||||
|
set(_CMD_RES "${_CMD_RES} COMMAND cp -r ${_r} ${_AGD}/usr/share/${${_T}_COMPANY}")
|
||||||
|
endforeach()
|
||||||
add_custom_target(deploy
|
add_custom_target(deploy
|
||||||
# gather deb dir
|
# gather deb dir
|
||||||
COMMAND mkdir -p ${_AGD}/DEBIAN
|
COMMAND mkdir -p ${_AGD}/DEBIAN
|
||||||
@@ -213,8 +223,9 @@ macro(deploy_target _T)
|
|||||||
COMMAND mkdir -p ${_AGD}/usr/share/applications
|
COMMAND mkdir -p ${_AGD}/usr/share/applications
|
||||||
COMMAND cp -f ${_DEPLOY_DIR}/${_T} ${_AGD}/usr/bin
|
COMMAND cp -f ${_DEPLOY_DIR}/${_T} ${_AGD}/usr/bin
|
||||||
COMMAND cp -f ${_DEP_LIBS} ${_AGD}/usr/lib
|
COMMAND cp -f ${_DEP_LIBS} ${_AGD}/usr/lib
|
||||||
COMMAND cp -r ${_DEPLOY_DIR}/lang ${_AGD}/usr/share/${${_T}_COMPANY}
|
|
||||||
COMMAND cp -f ${_ICON_FN} ${_AGD}/usr/share/pixmaps
|
COMMAND cp -f ${_ICON_FN} ${_AGD}/usr/share/pixmaps
|
||||||
|
#COMMAND cp -r ${_DEPLOY_DIR}/lang ${_AGD}/usr/share/${${_T}_COMPANY}
|
||||||
|
${_CMD_RES}
|
||||||
|
|
||||||
COMMAND echo "Package: ${_DEBNAME}" ${_C_echof}
|
COMMAND echo "Package: ${_DEBNAME}" ${_C_echof}
|
||||||
COMMAND echo "Version: ${${_T}_VERSION}" ${_C_echo}
|
COMMAND echo "Version: ${${_T}_VERSION}" ${_C_echo}
|
||||||
@@ -246,7 +257,7 @@ macro(deploy_target _T)
|
|||||||
COMMAND mkdir -p ${_DESTINATION}
|
COMMAND mkdir -p ${_DESTINATION}
|
||||||
COMMAND dpkg-deb -b ${_AGD} ${_DESTINATION}/${_TV}_${_DEB_ARCH}.deb
|
COMMAND dpkg-deb -b ${_AGD} ${_DESTINATION}/${_TV}_${_DEB_ARCH}.deb
|
||||||
VERBATIM
|
VERBATIM
|
||||||
COMMENT "Generating ${_TV}.deb"
|
COMMENT "Generating ${_TV}_${_DEB_ARCH}.deb"
|
||||||
)
|
)
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
if (NOT CMAKE_OBJDUMP)
|
if (NOT CMAKE_OBJDUMP)
|
||||||
|
|||||||
Reference in New Issue
Block a user