diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-04-06 18:12:48 +0200 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-04-06 18:12:48 +0200 |
commit | eb246c4fa744bd50e008455f5f8363114b4de3eb (patch) | |
tree | a45644dc7bbcd1d3a3bc7fba0c5a610d162ab65f /cmake/QMakeQuery.cmake | |
parent | 482ad250a4454d993a98488edfe01d7f9dc35de7 (diff) | |
download | MultiMC-eb246c4fa744bd50e008455f5f8363114b4de3eb.tar MultiMC-eb246c4fa744bd50e008455f5f8363114b4de3eb.tar.gz MultiMC-eb246c4fa744bd50e008455f5f8363114b4de3eb.tar.lz MultiMC-eb246c4fa744bd50e008455f5f8363114b4de3eb.tar.xz MultiMC-eb246c4fa744bd50e008455f5f8363114b4de3eb.zip |
.cmake files to reduce "code" duplicate
Diffstat (limited to 'cmake/QMakeQuery.cmake')
-rw-r--r-- | cmake/QMakeQuery.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/QMakeQuery.cmake b/cmake/QMakeQuery.cmake new file mode 100644 index 00000000..bf0fe967 --- /dev/null +++ b/cmake/QMakeQuery.cmake @@ -0,0 +1,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) |