DeployMacros fix and description of deploy_target(FILES) section
This commit is contained in:
@@ -119,6 +119,13 @@ Important! RESOURCES, PLUGINS, FILES and LIBS lists check
|
|||||||
at cmake-time, so if entry ends with "/" it treat
|
at cmake-time, so if entry ends with "/" it treat
|
||||||
as directory, else - file
|
as directory, else - file
|
||||||
|
|
||||||
|
FILES can be presents as cmake-generator-expressions. In this case
|
||||||
|
entry trated as absolute path only if it prepened wiht "/".
|
||||||
|
Examples:
|
||||||
|
* "/$<TARGET_FILE:myexe>" - right, TARGET_FILE is absolute path
|
||||||
|
* "$<TARGET_FILE_NAME:myexe>" - right, relative item and TARGET_FILE_NAME is only filename
|
||||||
|
* "/$<TARGET_FILE_NAME:myexe>" - wrong, absolute item with only filename
|
||||||
|
|
||||||
|
|
||||||
This macro using "deploy_tool" from PIP,
|
This macro using "deploy_tool" from PIP,
|
||||||
so make sure it can be executed from shell
|
so make sure it can be executed from shell
|
||||||
@@ -394,22 +401,33 @@ endmacro()
|
|||||||
|
|
||||||
macro(__add_file_or_dir _DIR_VAR _FILE_VAR _PATH _RELPATH)
|
macro(__add_file_or_dir _DIR_VAR _FILE_VAR _PATH _RELPATH)
|
||||||
set(_p)
|
set(_p)
|
||||||
|
set(_remabs 0)
|
||||||
set(_abs 0)
|
set(_abs 0)
|
||||||
if (IS_ABSOLUTE "${_PATH}")
|
if (IS_ABSOLUTE "${_PATH}")
|
||||||
set(_abs 1)
|
set(_abs 1)
|
||||||
endif()
|
endif()
|
||||||
if ("${_PATH}" MATCHES "^\$<")
|
if ("${_PATH}" MATCHES "^\\/\\$")
|
||||||
set(_abs 1)
|
set(_abs 1)
|
||||||
|
set(_remabs 1)
|
||||||
endif()
|
endif()
|
||||||
if (_abs)
|
if (_abs)
|
||||||
set(_p "${_PATH}")
|
set(_p "${_PATH}")
|
||||||
else()
|
else()
|
||||||
set(_p "${_RELPATH}/${_PATH}")
|
set(_p "${_RELPATH}/${_PATH}")
|
||||||
endif()
|
endif()
|
||||||
if ("${_p}" MATCHES ".*/$")
|
if (_remabs)
|
||||||
|
#message("b \"${_p}\"")
|
||||||
|
string(LENGTH "${_p}" __sl)
|
||||||
|
math(EXPR __sl ${__sl}-1)
|
||||||
|
string(SUBSTRING "${_p}" 1 ${__sl} _p)
|
||||||
|
#message("a \"${_p}\"")
|
||||||
|
endif()
|
||||||
|
if ("${_p}" MATCHES ".*\\/\$")
|
||||||
|
#message("b \"${_p}\"")
|
||||||
string(LENGTH "${_p}" __sl)
|
string(LENGTH "${_p}" __sl)
|
||||||
math(EXPR __sl ${__sl}-1)
|
math(EXPR __sl ${__sl}-1)
|
||||||
string(SUBSTRING "${_p}" 0 ${__sl} _p)
|
string(SUBSTRING "${_p}" 0 ${__sl} _p)
|
||||||
|
#message("a \"${_p}\"")
|
||||||
list(APPEND ${_DIR_VAR} "${_p}")
|
list(APPEND ${_DIR_VAR} "${_p}")
|
||||||
else()
|
else()
|
||||||
list(APPEND ${_FILE_VAR} "${_p}")
|
list(APPEND ${_FILE_VAR} "${_p}")
|
||||||
|
|||||||
Reference in New Issue
Block a user