Advertisement
Fabian42

Untitled

Sep 7th, 2018
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  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.  
  5. if (NOT Qt5_FIND_COMPONENTS)
  6. set(Qt5_NOT_FOUND_MESSAGE "The Qt5 package requires at least one component")
  7. set(Qt5_FOUND False)
  8. return()
  9. endif()
  10.  
  11. set(_Qt5_FIND_PARTS_REQUIRED)
  12. if (Qt5_FIND_REQUIRED)
  13. set(_Qt5_FIND_PARTS_REQUIRED REQUIRED)
  14. endif()
  15. set(_Qt5_FIND_PARTS_QUIET)
  16. if (Qt5_FIND_QUIETLY)
  17. set(_Qt5_FIND_PARTS_QUIET QUIET)
  18. endif()
  19.  
  20. get_filename_component(_qt5_install_prefix "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
  21.  
  22. set(_Qt5_NOTFOUND_MESSAGE)
  23.  
  24. foreach(module ${Qt5_FIND_COMPONENTS})
  25. find_package(Qt5${module}
  26. ${_Qt5_FIND_PARTS_QUIET}
  27. ${_Qt5_FIND_PARTS_REQUIRED}
  28. PATHS "${_qt5_install_prefix}" NO_DEFAULT_PATH
  29. )
  30. if (NOT Qt5${module}_FOUND)
  31. if (Qt5_FIND_REQUIRED_${module})
  32. 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")
  33. elseif(NOT Qt5_FIND_QUIETLY)
  34. message(WARNING "Failed to find Qt5 component \"${module}\" config file at \"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\"")
  35. endif()
  36. endif()
  37. endforeach()
  38.  
  39. if (_Qt5_NOTFOUND_MESSAGE)
  40. set(Qt5_NOT_FOUND_MESSAGE "${_Qt5_NOTFOUND_MESSAGE}")
  41. set(Qt5_FOUND False)
  42. endif()
  43.  
  44. _qt5_Core_check_file_exists("${CMAKE_CURRENT_LIST_DIR}/Qt5ConfigVersion.cmake")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement