summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-05-03 11:10:55 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-05-03 11:11:03 +0200
commitb292aaf2b9d49847e014a3fdda3df287229ca0a0 (patch)
treeffec36fd4fa327fd79dca2bbfd2d19f1f1dd9efb /cmake
parent890fb27d782863dfc385193561f4cc8698f1cb4d (diff)
cmake: simplify
The original was pretty tasteless.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/opentrack-qt.cmake15
1 files 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