Qt5Config.cmake 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. if (CMAKE_VERSION VERSION_LESS 2.8.9)
  2. message(FATAL_ERROR "Qt5 requires at least CMake version 2.8.9")
  3. endif()
  4. if(NOT DEFINED OE_QMAKE_PATH_EXTERNAL_HOST_BINS)
  5. message(WARNING Skipping because OE_QMAKE_PATH_EXTERNAL_HOST_BINS is not defined)
  6. return()
  7. endif()
  8. if (NOT Qt5_FIND_COMPONENTS)
  9. set(Qt5_NOT_FOUND_MESSAGE "The Qt5 package requires at least one component")
  10. set(Qt5_FOUND False)
  11. return()
  12. endif()
  13. set(_Qt5_FIND_PARTS_REQUIRED)
  14. if (Qt5_FIND_REQUIRED)
  15. set(_Qt5_FIND_PARTS_REQUIRED REQUIRED)
  16. endif()
  17. set(_Qt5_FIND_PARTS_QUIET)
  18. if (Qt5_FIND_QUIETLY)
  19. set(_Qt5_FIND_PARTS_QUIET QUIET)
  20. endif()
  21. get_filename_component(_qt5_install_prefix "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
  22. set(_Qt5_NOTFOUND_MESSAGE)
  23. foreach(module ${Qt5_FIND_COMPONENTS})
  24. find_package(Qt5${module}
  25. ${_Qt5_FIND_PARTS_QUIET}
  26. ${_Qt5_FIND_PARTS_REQUIRED}
  27. PATHS "${_qt5_install_prefix}" NO_DEFAULT_PATH
  28. )
  29. if (NOT Qt5${module}_FOUND)
  30. if (Qt5_FIND_REQUIRED_${module})
  31. set(_Qt5_NOTFOUND_MESSAGE "${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \"${module}\" config file at \"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\"\n")
  32. elseif(NOT Qt5_FIND_QUIETLY)
  33. message(WARNING "Failed to find Qt5 component \"${module}\" config file at \"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\"")
  34. endif()
  35. endif()
  36. endforeach()
  37. if (_Qt5_NOTFOUND_MESSAGE)
  38. set(Qt5_NOT_FOUND_MESSAGE "${_Qt5_NOTFOUND_MESSAGE}")
  39. set(Qt5_FOUND False)
  40. endif()
  41. _qt5_Core_check_file_exists("${CMAKE_CURRENT_LIST_DIR}/Qt5ConfigVersion.cmake")