From b292aaf2b9d49847e014a3fdda3df287229ca0a0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 3 May 2017 11:10:55 +0200 Subject: cmake: simplify The original was pretty tasteless. --- cmake/opentrack-qt.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake index 66618c59..d6c8315b 100644 --- a/cmake/opentrack-qt.cmake +++ b/cmake/opentrack-qt.cmake @@ -11,15 +11,18 @@ if(WIN32) install(FILES "${Qt5_DIR}/../../../plugins/platforms/qwindows.dll" DESTINATION "./platforms") endif() -string(FIND "${CMAKE_GENERATOR}" "Visual Studio " is-msvc) -if(is-msvc EQUAL 0) - set(is-msvc TRUE) -else() - set(is-msvc FALSE) -endif() +function(is_msvc_sln_generator var) + string(FIND "${CMAKE_GENERATOR}" "Visual Studio " is-msvc) + if(is-msvc EQUAL 0) + set(${var} TRUE PARENT_SCOPE) + else() + set(${var} FALSE PARENT_SCOPE) + endif() +endfunction() if(MSVC) # on .sln generator we have no editbin in path + is_msvc_sln_generator(is-msvc) if(is-msvc) # this is bad but what can we do? searching for vcvarsall.bat # would be easier, but then we'd have to differentiate x86/amd64 -- cgit v1.2.3