mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 12:10:34 +00:00
Improve detection of macOS version
This commit is contained in:
parent
daedb65de8
commit
b2fccc826e
@ -7,10 +7,16 @@
|
|||||||
execute_process(COMMAND uname -v OUTPUT_VARIABLE DARWIN_VERSION)
|
execute_process(COMMAND uname -v OUTPUT_VARIABLE DARWIN_VERSION)
|
||||||
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
|
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
|
||||||
|
|
||||||
if(${DARWIN_VERSION} MATCHES "20")
|
if(${DARWIN_VERSION} VERSION_GREATER "19")
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++17")
|
execute_process(COMMAND awk "/SOFTWARE LICENSE AGREEMENT FOR macOS/" "/System/Library/CoreServices/Setup Assistant.app/Contents/Resources/en.lproj/OSXSoftwareLicense.rtf" OUTPUT_VARIABLE macOS_NAME)
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
if(macOS_NAME)
|
||||||
set(MACOS_DISTRIBUTION "macOS Big Sur 11")
|
string(REGEX MATCH "macOS*([^\n\r]*)" macOS_NAME ${macOS_NAME})
|
||||||
|
string(REGEX REPLACE "macOS " "" macOS_NAME ${macOS_NAME})
|
||||||
|
string(REGEX REPLACE ".$" "" macOS_NAME ${macOS_NAME})
|
||||||
|
execute_process(COMMAND sw_vers -productVersion OUTPUT_VARIABLE macOS_VERSION)
|
||||||
|
string(REGEX REPLACE "\n$" "" macOS_VERSION ${macOS_VERSION})
|
||||||
|
set(MACOS_DISTRIBUTION "macOS ${macOS_NAME} ${macOS_VERSION}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${DARWIN_VERSION} MATCHES "19")
|
if(${DARWIN_VERSION} MATCHES "19")
|
||||||
|
Loading…
Reference in New Issue
Block a user