1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00

Improve detection of macOS version

This commit is contained in:
Carles Fernandez 2021-05-26 13:09:13 +02:00
parent daedb65de8
commit b2fccc826e
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -7,10 +7,16 @@
execute_process(COMMAND uname -v OUTPUT_VARIABLE DARWIN_VERSION)
string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
if(${DARWIN_VERSION} MATCHES "20")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++17")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
set(MACOS_DISTRIBUTION "macOS Big Sur 11")
if(${DARWIN_VERSION} VERSION_GREATER "19")
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)
if(macOS_NAME)
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()
if(${DARWIN_VERSION} MATCHES "19")