Skip to content

Commit

Permalink
refs #4472 Added logic to determine Mac OS X version.
Browse files Browse the repository at this point in the history
Defines OSX_VERSION and OSX_CODENAME variables.
  • Loading branch information
stuartcampbell committed Mar 28, 2012
1 parent 16e0c5d commit 237d4cb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Code/Mantid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,33 @@ ENDIF()
###########################################################################
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

execute_process(
COMMAND /usr/bin/sw_vers -productVersion
OUTPUT_VARIABLE OSX_VERSION
RESULT_VARIABLE OSX_VERSION_STATUS
)

# Strip off any /CR or /LF
string(STRIP ${OSX_VERSION} OSX_VERSION)

if (OSX_VERSION VERSION_LESS 10.6)
message (FATAL_ERROR "The minimum supported version of Mac OS X is 10.6 (Snow Leopard).")
endif()

if (OSX_VERSION VERSION_GREATER 10.6 OR OSX_VERSION VERSION_EQUAL 10.6)
set ( OSX_CODENAME "Snow Leopard" )
endif()

if (OSX_VERSION VERSION_GREATER 10.7 OR OSX_VERSION VERSION_EQUAL 10.7)
set ( OSX_CODENAME "Lion")
endif()

if (OSX_VERSION VERSION_GREATER 10.8 OR OSX_VERSION VERSION_EQUAL 10.8)
set ( OSX_CODENAME "Mountain Lion")
endif()

message (STATUS "Operating System: Mac OS X ${OSX_VERSION} (${OSX_CODENAME})")

if ( NOT THIRD_PARTY )
set ( THIRD_PARTY "${PROJECT_SOURCE_DIR}/../Third_Party" )
endif ()
Expand Down

0 comments on commit 237d4cb

Please sign in to comment.