Warning, /frameworks/extra-cmake-modules/modules/ECMQueryQmake.cmake is written in an unsupported language. File is not indexed.
0001 if (${ECM_GLOBAL_FIND_VERSION} VERSION_GREATER_EQUAL 5.93) 0002 message(DEPRECATION "ECMQueryQmake.cmake is deprecated since 5.93, please use ECMQueryQt.cmake instead.") 0003 endif() 0004 0005 include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake) 0006 find_package(Qt${QT_MAJOR_VERSION}Core QUIET) 0007 0008 if (Qt5Core_FOUND) 0009 set(_qmake_executable_default "qmake-qt5") 0010 endif () 0011 if (TARGET Qt5::qmake) 0012 get_target_property(_qmake_executable_default Qt5::qmake LOCATION) 0013 endif() 0014 set(QMAKE_EXECUTABLE ${_qmake_executable_default} 0015 CACHE FILEPATH "Location of the Qt5 qmake executable") 0016 0017 # Helper method 0018 # This is not public API (yet)! 0019 # Usage: query_qmake(<result_variable> <qt_variable> [TRY]) 0020 # Passing TRY will result in the method not failing fatal if no qmake executable 0021 # has been found, but instead simply returning an empty string 0022 function(query_qmake result_variable qt_variable) 0023 set(options TRY) 0024 set(oneValueArgs ) 0025 set(multiValueArgs ) 0026 0027 cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) 0028 0029 if(NOT QMAKE_EXECUTABLE) 0030 if(ARGS_TRY) 0031 set(${result_variable} "" PARENT_SCOPE) 0032 message(STATUS "No qmake Qt5 binary found. Can't check ${qt_variable}") 0033 return() 0034 else() 0035 message(FATAL_ERROR "No qmake Qt5 binary found. Can't check ${qt_variable} as required") 0036 endif() 0037 endif() 0038 execute_process( 0039 COMMAND ${QMAKE_EXECUTABLE} -query "${qt_variable}" 0040 RESULT_VARIABLE return_code 0041 OUTPUT_VARIABLE output 0042 ) 0043 if(return_code EQUAL 0) 0044 string(STRIP "${output}" output) 0045 file(TO_CMAKE_PATH "${output}" output_path) 0046 set(${result_variable} "${output_path}" PARENT_SCOPE) 0047 else() 0048 message(WARNING "Failed call: ${QMAKE_EXECUTABLE} -query \"${qt_variable}\"") 0049 message(FATAL_ERROR "QMake call failed: ${return_code}") 0050 endif() 0051 endfunction()