Commit 232a76ee authored by Lynn Garren's avatar Lynn Garren
Browse files

deal with MacOSX complications

parent ebdf90ca
......@@ -158,15 +158,68 @@ macro( clhep_config )
endif()
endmacro( clhep_config )
macro( clhep_lib_suffix )
if(LIB_SUFFIX)
if ( ${LIB_SUFFIX} STREQUAL "64" )
macro( _clhep_lib_suffix_64 )
if( APPLE )
#message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} and ${CMAKE_OSX_ARCHITECTURES}")
# On Mac, we use NAME-ARCH, but ARCH is 'Universal' if more than
# one arch is built for. Note that falling back to use
# CMAKE_SYSTEM_PROCESSOR may *not* be 100% reliable.
list(LENGTH CMAKE_OSX_ARCHITECTURES _number_of_arches)
if(NOT _number_of_arches)
# - Default
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(LIBSUFFIX ${LIB_SUFFIX})
else()
set(LIBSUFFIX "")
endif()
elseif(_number_of_arches GREATER 1)
# - Universal
set(LIBSUFFIX ${LIB_SUFFIX})
else()
# - Use what the user specified
if (${CMAKE_OSX_ARCHITECTURES} STREQUAL "x86_64")
set(LIBSUFFIX ${LIB_SUFFIX})
else()
set(LIBSUFFIX "")
endif()
endif()
else()
message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} ")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(LIBSUFFIX ${LIB_SUFFIX})
else()
set(LIBSUFFIX "")
endif()
elseif( ${LIB_SUFFIX} STREQUAL "32" )
endif()
endmacro( _clhep_lib_suffix_64 )
macro( _clhep_lib_suffix_32 )
if( APPLE )
#message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} and ${CMAKE_OSX_ARCHITECTURES}")
# On Mac, we use NAME-ARCH, but ARCH is 'Universal' if more than
# one arch is built for. Note that falling back to use
# CMAKE_SYSTEM_PROCESSOR may *not* be 100% reliable.
list(LENGTH CMAKE_OSX_ARCHITECTURES _number_of_arches)
if(NOT _number_of_arches)
# - Default
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
set(LIBSUFFIX ${LIB_SUFFIX})
else()
set(LIBSUFFIX "")
endif()
elseif(_number_of_arches GREATER 1)
# - Universal
set(LIBSUFFIX ${LIB_SUFFIX})
else()
# - Use what the user specified
if (${CMAKE_OSX_ARCHITECTURES} STREQUAL "i386")
set(LIBSUFFIX ${LIB_SUFFIX})
else()
set(LIBSUFFIX "")
endif()
endif()
else()
message(STATUS "checking LIB_SUFFIX ${LIB_SUFFIX} against ${CMAKE_SYSTEM_PROCESSOR} ")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i686")
set(LIBSUFFIX ${LIB_SUFFIX})
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
......@@ -174,6 +227,15 @@ macro( clhep_lib_suffix )
else()
set(LIBSUFFIX "")
endif()
endif()
endmacro( _clhep_lib_suffix_32 )
macro( clhep_lib_suffix )
if(LIB_SUFFIX)
if ( ${LIB_SUFFIX} STREQUAL "64" )
_clhep_lib_suffix_64()
elseif( ${LIB_SUFFIX} STREQUAL "32" )
_clhep_lib_suffix_32()
else()
set(LIBSUFFIX "")
endif()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment