linux deploy

This commit is contained in:
2020-05-12 22:39:16 +03:00
parent b07fe9f892
commit de17f93679

View File

@@ -600,8 +600,11 @@ macro(deploy_target _T)
if ("x${CMAKE_SYSTEM_NAME}" STREQUAL "xLinux")
set(_os_id "")
set(_os_ver "")
set(_paths "/usr/lib" "/etc")
if (CMAKE_CROSSCOMPILING)
find_file(_release_file NAMES os-release lsb-release PATHS "${CMAKE_PREFIX_PATH}/lib" "${CMAKE_PREFIX_PATH}/../etc" NO_DEFAULT_PATH)
set(_paths "${CMAKE_PREFIX_PATH}/lib" "${CMAKE_PREFIX_PATH}/../etc")
endif()
find_file(_release_file NAMES os-release lsb-release PATHS ${_paths} NO_DEFAULT_PATH)
if (NOT "x${_release_file}" STREQUAL "x")
file(STRINGS "${_release_file}" _lines)
foreach(_l ${_lines})
@@ -616,18 +619,16 @@ macro(deploy_target _T)
endif()
endforeach()
endif()
else()
execute_process(COMMAND "lsb_release -si" OUTPUT_VARIABLE _os_id)
execute_process(COMMAND "lsb_release -sr" OUTPUT_VARIABLE _os_ver)
endif()
#execute_process(COMMAND "lsb_release -si" OUTPUT_VARIABLE _os_id)
#execute_process(COMMAND "lsb_release -sr" OUTPUT_VARIABLE _os_ver)
set(_build "${${_T}_VERSION_BUILD}")
if (NOT "x${_build}" STREQUAL "x")
set(_build "-${_build}")
endif()
string(TOLOWER "${_os_id}${_os_ver}" _TARGET_OS)
if ("x${_TARGET_OS}" STREQUAL "x")
set(_TARGET_OS "linux")
endif()
string(TOLOWER "${_os_id}${_os_ver}" _TARGET_OS)
string(REPLACE "_" "-" _DEBNAME "${_T}")
string(REPLACE "_" "-" _DEBVERSION "${${_T}_VERSION}${_build}+${_TARGET_OS}")
set(_DEB_ARCH)