Problem: CMake evaluation fails with Mingw-w64

Solution: we can use 'CMAKE_SYSTEM_VERSION' instead of
'${CMAKE_SYSTEM_VERSION}' for the 'if' clauses.

CMake fails to evaluate condition when CMAKE_SYSTEM_VERSION is
empty, which can happen with a default installation of Mingw-w64
in Linux.
This commit is contained in:
Iban Cereijo 2017-06-14 15:55:29 +02:00
parent 2c4e5364aa
commit d040dc18b5

View File

@ -183,7 +183,7 @@ include (CheckCXXSymbolExists)
check_include_files (ifaddrs.h ZMQ_HAVE_IFADDRS) check_include_files (ifaddrs.h ZMQ_HAVE_IFADDRS)
check_include_files (windows.h ZMQ_HAVE_WINDOWS) check_include_files (windows.h ZMQ_HAVE_WINDOWS)
if( ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore" AND ${CMAKE_SYSTEM_VERSION} STREQUAL "10.0") if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_SYSTEM_VERSION STREQUAL "10.0")
SET(ZMQ_HAVE_WINDOWS_UWP ON) SET(ZMQ_HAVE_WINDOWS_UWP ON)
ADD_DEFINITIONS(-D_WIN32_WINNT=_WIN32_WINNT_WIN10) ADD_DEFINITIONS(-D_WIN32_WINNT=_WIN32_WINNT_WIN10)
endif() endif()