ctkBlockSetCMakeOSXVariables.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ###########################################################################
  2. #
  3. # Library: CTK
  4. #
  5. # Copyright (c) Kitware Inc.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License");
  8. # you may not use this file except in compliance with the License.
  9. # You may obtain a copy of the License at
  10. #
  11. # http://www.commontk.org/LICENSE
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. #
  19. ###########################################################################
  20. #
  21. # ctkBlockSetCMakeOSXVariables
  22. #
  23. #
  24. # Adapted from Paraview/Superbuild/CMakeLists.txt
  25. #
  26. # Note: Change architecture *before* any enable_language() or project()
  27. # calls so that it's set properly to detect 64-bit-ness...
  28. # Currently, we default to 10.5. Obviously this may need to be re-evaluated when Lion comes out.
  29. #
  30. if(APPLE)
  31. if(NOT CMAKE_OSX_DEPLOYMENT_TARGET OR "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
  32. set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "force build for 64-bit Leopard" FORCE)
  33. set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "force build for 64-bit Leopard" FORCE)
  34. set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk" CACHE PATH "force build for 64-bit Leopard" FORCE)
  35. endif()
  36. if(NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
  37. if(NOT EXISTS "${CMAKE_OSX_SYSROOT}")
  38. message(FATAL_ERROR "error: CMAKE_OSX_SYSROOT='${CMAKE_OSX_SYSROOT}' does not exist")
  39. endif()
  40. endif()
  41. endif()