summaryrefslogtreecommitdiffstats
path: root/cmake/QMakeQuery.cmake
blob: bf0fe9672da49b9bf3455cb6a35a87418c151fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
if(__QMAKEQUERY_CMAKE__)
    return()
endif()
set(__QMAKEQUERY_CMAKE__ TRUE)

get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)

function(QUERY_QMAKE VAR RESULT)
    exec_program(${QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
    if(NOT return_code)
        file(TO_CMAKE_PATH "${output}" output)
        set(${RESULT} ${output} PARENT_SCOPE)
    endif(NOT return_code)
endfunction(QUERY_QMAKE)