From ba773c5d7a02e975eddf5558960aa07eb7a9848f Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 9 May 2016 11:20:15 +0200 Subject: [PATCH] more robust macro to get WINNT version, fixes error "constant too big" in icon compilation on Windows (thx J. Schickmair) --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed7feb4f..edfb7505 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,10 +110,9 @@ add_definitions(-DHAVE_CONFIG_H) # platform specific definitions and flags macro(get_WIN32_WINNT version) if (WIN32 AND CMAKE_SYSTEM_VERSION) - set(ver ${CMAKE_SYSTEM_VERSION}) - string(REPLACE "." "" ver ${ver}) - string(REGEX REPLACE "([0-9])" "0\\1" ver ${ver}) - + if("${CMAKE_SYSTEM_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)") + math(EXPR ver "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}") + endif() set(${version} "0x${ver}") endif() endmacro()