0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-28 07:58:14 +08:00
libzmq/builds/cmake/Modules/TestZMQVersion.cmake
Henrik S. Gaßmann f0a76318f4 REPLACE MSVC VERSION SUFFIX VARIABLE
Replace _zmq_COMPILER with CMAKE_VS_PLATFORM_TOOLSET; so the suffix can
be automagically generated for every MSVC compiler supported by cmake.
2015-05-05 21:39:50 +02:00

9 lines
529 B
CMake

file(READ "${PROJECT_SOURCE_DIR}/include/zmq.h" _ZMQ_H_CONTENTS)
string(REGEX REPLACE ".*#define ZMQ_VERSION_MAJOR ([0-9]+).*" "\\1" ZMQ_VERSION_MAJOR "${_ZMQ_H_CONTENTS}")
string(REGEX REPLACE ".*#define ZMQ_VERSION_MINOR ([0-9]+).*" "\\1" ZMQ_VERSION_MINOR "${_ZMQ_H_CONTENTS}")
string(REGEX REPLACE ".*#define ZMQ_VERSION_PATCH ([0-9]+).*" "\\1" ZMQ_VERSION_PATCH "${_ZMQ_H_CONTENTS}")
set(ZMQ_VERSION "${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}")
message(STATUS "Detected ZMQ Version - ${ZMQ_VERSION}")