mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-18 17:36:57 +00:00
fixed compilation - added detection for _WIN32_WINNT
This commit is contained in:
parent
2aca7b233b
commit
d1ea5e525e
@ -210,16 +210,22 @@ foreach (source ${rc-sources})
|
|||||||
configure_file(${CMAKE_SOURCE_DIR}/src/${source}.in ${CMAKE_BINARY_DIR}/${source})
|
configure_file(${CMAKE_SOURCE_DIR}/src/${source}.in ${CMAKE_BINARY_DIR}/${source})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_command(
|
if(WIN32)
|
||||||
OUTPUT ${CMAKE_BINARY_DIR}/platform.hpp
|
set(_platform_sp "builds/msvc")
|
||||||
COMMAND ${CMAKE_COMMAND}
|
if(MINGW)
|
||||||
ARGS -E
|
set(_platform_sp "builds/mingw32")
|
||||||
copy
|
endif()
|
||||||
${CMAKE_SOURCE_DIR}/builds/msvc/platform.hpp
|
add_custom_command(
|
||||||
${CMAKE_BINARY_DIR}/platform.hpp
|
OUTPUT ${CMAKE_SOURCE_DIR}/src/platform.hpp
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/builds/msvc/platform.hpp
|
COMMAND ${CMAKE_COMMAND}
|
||||||
)
|
ARGS -E
|
||||||
list(APPEND sources ${CMAKE_BINARY_DIR}/platform.hpp)
|
copy
|
||||||
|
${CMAKE_SOURCE_DIR}/${_platform_sp}/platform.hpp
|
||||||
|
${CMAKE_SOURCE_DIR}/src/platform.hpp
|
||||||
|
DEPENDS ${CMAKE_SOURCE_DIR}/${_platform_sp}/platform.hpp
|
||||||
|
)
|
||||||
|
list(APPEND sources ${CMAKE_SOURCE_DIR}/src/platform.hpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CL_64)
|
if (CMAKE_CL_64)
|
||||||
set (nsis-template ${CMAKE_SOURCE_DIR}/cmake/NSIS.template64.in)
|
set (nsis-template ${CMAKE_SOURCE_DIR}/cmake/NSIS.template64.in)
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
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})
|
||||||
|
set(${version} "0x${ver}")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
MESSAGE(STATUS "Detecting ZMQ")
|
MESSAGE(STATUS "Detecting ZMQ")
|
||||||
SET(TRY_RUN_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/zmq_run.dir)
|
SET(TRY_RUN_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/zmq_run.dir)
|
||||||
@ -24,36 +32,25 @@
|
|||||||
MESSAGE(STATUS "Detecting ZMQ - failed")
|
MESSAGE(STATUS "Detecting ZMQ - failed")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
get_WIN32_WINNT(_zmq_WIN32_WINNT)
|
||||||
|
|
||||||
if(CMAKE_GENERATOR_TOOLSET MATCHES "v120")
|
if(CMAKE_GENERATOR_TOOLSET MATCHES "v120")
|
||||||
set(_zmq_TOOLSET "-v120")
|
set(_zmq_TOOLSET "-v120")
|
||||||
set(_zmq_COMPILER "vc120")
|
set(_zmq_COMPILER "vc120")
|
||||||
set(_zmq_WIN32_WINNT "0x0601")
|
|
||||||
elseif(CMAKE_GENERATOR_TOOLSET MATCHES "v110_xp")
|
elseif(CMAKE_GENERATOR_TOOLSET MATCHES "v110_xp")
|
||||||
set(_zmq_TOOLSET "-v110_xp")
|
set(_zmq_TOOLSET "-v110_xp")
|
||||||
set(_zmq_COMPILER "vc110")
|
set(_zmq_COMPILER "vc110")
|
||||||
set(_zmq_WIN32_WINNT "0x0501")
|
|
||||||
elseif(CMAKE_GENERATOR_TOOLSET MATCHES "v110")
|
elseif(CMAKE_GENERATOR_TOOLSET MATCHES "v110")
|
||||||
set(_zmq_TOOLSET "-v110")
|
set(_zmq_TOOLSET "-v110")
|
||||||
set(_zmq_COMPILER "vc110")
|
set(_zmq_COMPILER "vc110")
|
||||||
set(_zmq_WIN32_WINNT "0x0601")
|
|
||||||
elseif(CMAKE_GENERATOR_TOOLSET MATCHES "v100")
|
elseif(CMAKE_GENERATOR_TOOLSET MATCHES "v100")
|
||||||
set(_zmq_TOOLSET "-v100")
|
set(_zmq_TOOLSET "-v100")
|
||||||
set(_zmq_COMPILER "vc100")
|
set(_zmq_COMPILER "vc100")
|
||||||
if(CMAKE_CL_64)
|
|
||||||
set(_zmq_WIN32_WINNT "0x0600")
|
|
||||||
else()
|
|
||||||
set(_zmq_WIN32_WINNT "0x0501")
|
|
||||||
endif()
|
|
||||||
elseif(CMAKE_GENERATOR_TOOLSET MATCHES "v90")
|
elseif(CMAKE_GENERATOR_TOOLSET MATCHES "v90")
|
||||||
set(_zmq_TOOLSET "-v90")
|
set(_zmq_TOOLSET "-v90")
|
||||||
set(_zmq_COMPILER "vc90")
|
set(_zmq_COMPILER "vc90")
|
||||||
if(CMAKE_CL_64)
|
|
||||||
set(_zmq_WIN32_WINNT "0x0600")
|
|
||||||
else()
|
|
||||||
set(_zmq_WIN32_WINNT "0x0501")
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
set(_zmq_TOOLSET "")
|
set(_zmq_TOOLSET "")
|
||||||
set(_zmq_COMPILER "")
|
set(_zmq_COMPILER "")
|
||||||
set(_zmq_WIN32_WINNT "")
|
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user