Advertisement
Guest User

Qt5Config.cmake

a guest
Jun 15th, 2022
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1.  
  2. if (CMAKE_VERSION VERSION_LESS 3.1.0)
  3. message(FATAL_ERROR "Qt5 requires at least CMake version 3.1.0")
  4. endif()
  5.  
  6. if (NOT Qt5_FIND_COMPONENTS)
  7. set(Qt5_NOT_FOUND_MESSAGE "The Qt5 package requires at least one component")
  8. set(Qt5_FOUND False)
  9. return()
  10. endif()
  11.  
  12. set(_Qt5_FIND_PARTS_REQUIRED)
  13. if (Qt5_FIND_REQUIRED)
  14. set(_Qt5_FIND_PARTS_REQUIRED REQUIRED)
  15. endif()
  16. set(_Qt5_FIND_PARTS_QUIET)
  17. if (Qt5_FIND_QUIETLY)
  18. set(_Qt5_FIND_PARTS_QUIET QUIET)
  19. endif()
  20.  
  21. get_filename_component(_qt5_install_prefix "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
  22.  
  23. set(_Qt5_NOTFOUND_MESSAGE)
  24.  
  25. include(${CMAKE_CURRENT_LIST_DIR}/Qt5ModuleLocation.cmake)
  26.  
  27. foreach(module ${Qt5_FIND_COMPONENTS})
  28. find_package(Qt5${module}
  29. ${_Qt5_FIND_PARTS_QUIET}
  30. ${_Qt5_FIND_PARTS_REQUIRED}
  31. PATHS ${_qt5_module_paths} NO_DEFAULT_PATH
  32. )
  33. if (NOT Qt5${module}_FOUND)
  34. string(CONFIGURE ${_qt5_module_location_template} _expected_module_location @ONLY)
  35.  
  36. if (Qt5_FIND_REQUIRED_${module})
  37. set(_Qt5_NOTFOUND_MESSAGE "${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \"${module}\" config file at \"${_expected_module_location}\"\n")
  38. elseif(NOT Qt5_FIND_QUIETLY)
  39. message(WARNING "Failed to find Qt5 component \"${module}\" config file at \"${_expected_module_location}\"")
  40. endif()
  41.  
  42. unset(_expected_module_location)
  43. endif()
  44. endforeach()
  45.  
  46. if (_Qt5_NOTFOUND_MESSAGE)
  47. set(Qt5_NOT_FOUND_MESSAGE "${_Qt5_NOTFOUND_MESSAGE}")
  48. set(Qt5_FOUND False)
  49. endif()
  50.  
  51. _qt5_Core_check_file_exists("${CMAKE_CURRENT_LIST_DIR}/Qt5ConfigVersion.cmake")
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement