Commit cdcaca2d authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #438 from steve-o/master

Duplicate CMake patch set from zeromq3-x
parents 73537e67 c62fb89e
This diff is collapsed.
MESSAGE(STATUS "Detecting ZMQ")
SET(TRY_RUN_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/zmq_run.dir)
TRY_RUN(RUN_RESULT COMPILE_RESULT
${TRY_RUN_DIR}
${CMAKE_SOURCE_DIR}/cmake/Modules/zmq_version.cpp
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_SOURCE_DIR}/include"
COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT
RUN_OUTPUT_VARIABLE RUN_OUTPUT)
IF(COMPILE_RESULT)
IF(RUN_RESULT MATCHES "FAILED_TO_RUN")
MESSAGE(STATUS "Detecting ZMQ - failed")
ELSE()
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\1" ZMQ_VERSION_MAJOR "${RUN_OUTPUT}")
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\2" ZMQ_VERSION_MINOR "${RUN_OUTPUT}")
STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\3" ZMQ_VERSION_PATCH "${RUN_OUTPUT}")
MESSAGE(STATUS "Detecting ZMQ - ${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}")
ENDIF()
ELSE()
MESSAGE(STATUS "Check for ZMQ version - not found")
MESSAGE(STATUS "Detecting ZMQ - failed")
ENDIF()
if(MSVC_VERSION MATCHES "1700")
set(_zmq_COMPILER "-v110")
elseif(MSVC10)
set(_zmq_COMPILER "-v100")
elseif(MSVC90)
set(_zmq_COMPILER "-v90")
else()
set(_zmq_COMPILER "")
endif()
/*
Copyright (c) 2007-2012 iMatix Corporation
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
This file is part of 0MQ.
0MQ is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
0MQ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "zmq.h"
#include <stdio.h>
int main ()
{
printf ("%d.%d.%d\n", ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH);
return 0;
}
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment