Darwin-GNU.cmake 602 B

123456789101112131415161718
  1. macro(cmake_gnu_has_isysroot lang)
  2. if("x${CMAKE_${lang}_HAS_ISYSROOT}" STREQUAL "x")
  3. set(_doc "${lang} compiler has -isysroot")
  4. message(STATUS "Checking whether ${_doc}")
  5. execute_process(
  6. COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help"
  7. OUTPUT_VARIABLE _gcc_help
  8. ERROR_VARIABLE _gcc_help
  9. )
  10. if("${_gcc_help}" MATCHES "isysroot")
  11. message(STATUS "Checking whether ${_doc} - yes")
  12. set(CMAKE_${lang}_HAS_ISYSROOT 1)
  13. else()
  14. message(STATUS "Checking whether ${_doc} - no")
  15. set(CMAKE_${lang}_HAS_ISYSROOT 0)
  16. endif()
  17. endif()
  18. endmacro()