mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-04-05 10:17:03 +00:00
Improve OS reporting
This commit is contained in:
parent
e8276c4fc4
commit
3e0752a88b
@ -191,7 +191,7 @@ endif()
|
||||
# Detect Linux Distribution
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU")
|
||||
include(DetectLinuxDistro)
|
||||
message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on ${LINUX_DISTRIBUTION} GNU/Linux Release ${LINUX_VER} ${ARCH_}")
|
||||
message(STATUS "Configuring GNSS-SDR v${VERSION} to be built on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}")
|
||||
endif()
|
||||
|
||||
# Detect macOS / Mac OS X Version
|
||||
@ -2803,7 +2803,7 @@ message(STATUS "***************************************")
|
||||
message(STATUS "")
|
||||
message(STATUS "CMake version: ${CMAKE_VERSION}")
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU")
|
||||
message(STATUS "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCH_}")
|
||||
message(STATUS "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}")
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
message(STATUS "Building on ${MACOS_DISTRIBUTION}")
|
||||
@ -2817,7 +2817,7 @@ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "* BUILDING CONFIGURATION S
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "**********************************\n\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "GNSS-SDR version: ${VERSION}\n")
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCH_}\n")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}\n")
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/features.log "Building on ${MACOS_DISTRIBUTION}\n")
|
||||
|
@ -16,9 +16,9 @@
|
||||
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(ARCH_ "(64 bits)")
|
||||
set(ARCHITECTURE_STRING "(64 bits)")
|
||||
else()
|
||||
set(ARCH_ "(32 bits)")
|
||||
set(ARCHITECTURE_STRING "(32 bits)")
|
||||
endif()
|
||||
|
||||
if(EXISTS "/etc/lsb-release")
|
||||
@ -61,7 +61,7 @@ if(NOT LINUX_DISTRIBUTION)
|
||||
COMMAND awk -F= "{ print $2 }"
|
||||
COMMAND tr "\n" " "
|
||||
COMMAND sed "s/ //"
|
||||
OUTPUT_VARIABLE LINUX_DISTRIBUTION
|
||||
OUTPUT_VARIABLE LINUX_DISTRIBUTION_
|
||||
RESULT_VARIABLE LINUX_ID_RESULT
|
||||
)
|
||||
execute_process(COMMAND cat /etc/os-release
|
||||
@ -69,12 +69,19 @@ if(NOT LINUX_DISTRIBUTION)
|
||||
COMMAND awk -F= "{ print $2 }"
|
||||
COMMAND tr "\n" " "
|
||||
COMMAND sed "s/ //"
|
||||
OUTPUT_VARIABLE LINUX_VER
|
||||
OUTPUT_VARIABLE LINUX_VER_
|
||||
RESULT_VARIABLE LINUX_VER_RESULT
|
||||
)
|
||||
if(LINUX_DISTRIBUTION_)
|
||||
string(REPLACE "\"" "" LINUX_DISTRIBUTION ${LINUX_DISTRIBUTION_})
|
||||
endif()
|
||||
if(LINUX_VER_)
|
||||
string(REPLACE "\"" "" LINUX_VER ${LINUX_VER_})
|
||||
endif()
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Debian")
|
||||
set(LINUX_DISTRIBUTION "Debian")
|
||||
file(READ /etc/debian_version LINUX_VER)
|
||||
file(READ /etc/debian_version LINUX_VER_)
|
||||
string(REPLACE "\n" "" LINUX_VER ${LINUX_VER_})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -82,14 +89,23 @@ endif()
|
||||
if(NOT LINUX_DISTRIBUTION)
|
||||
if(EXISTS "/etc/redhat-release")
|
||||
set(LINUX_DISTRIBUTION "Red Hat")
|
||||
file(READ /etc/redhat-release LINUX_VER)
|
||||
file(READ /etc/redhat-release LINUX_VER_)
|
||||
string(REPLACE "\n" "" LINUX_VER ${LINUX_VER_})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT LINUX_DISTRIBUTION)
|
||||
if(EXISTS "/etc/debian_version")
|
||||
set(LINUX_DISTRIBUTION "Debian")
|
||||
file(READ /etc/debian_version LINUX_VER)
|
||||
file(READ /etc/debian_version LINUX_VER_)
|
||||
string(REPLACE "\n" "" LINUX_VER ${LINUX_VER_})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT LINUX_DISTRIBUTION)
|
||||
if(EXISTS "/etc/arch-release")
|
||||
set(LINUX_DISTRIBUTION "Arch Linux")
|
||||
set(LINUX_VER "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -639,7 +639,7 @@ endfunction()
|
||||
if(ENABLE_SYSTEM_TESTING)
|
||||
set(HOST_SYSTEM "Unknown")
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU")
|
||||
set(HOST_SYSTEM "GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCH_}")
|
||||
set(HOST_SYSTEM "GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}")
|
||||
string(REPLACE "\n" "" HOST_SYSTEM "${HOST_SYSTEM}")
|
||||
string(REPLACE "\"" "" HOST_SYSTEM "${HOST_SYSTEM}")
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user