2012-12-31 17:52:32 -05:00
|
|
|
# CMake build script for ZeroMQ
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
project(ZeroMQ)
|
|
|
|
|
|
|
|
option(WITH_OPENPGM "Build with support for OpenPGM" OFF)
|
|
|
|
|
2014-05-01 21:35:36 +02:00
|
|
|
if(WIN32)
|
|
|
|
option(WITH_TWEETNACL "Build with tweetnacl" OFF)
|
|
|
|
else()
|
2014-05-01 21:24:20 +02:00
|
|
|
option(WITH_TWEETNACL "Build with tweetnacl" ON)
|
2014-05-01 21:35:36 +02:00
|
|
|
endif()
|
2014-05-01 21:24:20 +02:00
|
|
|
|
|
|
|
if(WITH_TWEETNACL)
|
|
|
|
add_definitions(-DHAVE_TWEETNACL -DHAVE_LIBSODIUM)
|
|
|
|
include_directories(
|
2014-05-01 21:35:36 +02:00
|
|
|
tweetnacl/contrib/randombytes
|
|
|
|
tweetnacl/src
|
|
|
|
)
|
2014-05-01 21:24:20 +02:00
|
|
|
|
|
|
|
set(TWEETNACL_SOURCES
|
2014-05-01 21:35:36 +02:00
|
|
|
tweetnacl/src/tweetnacl.c
|
|
|
|
)
|
2014-05-01 21:24:20 +02:00
|
|
|
if(WIN32)
|
|
|
|
else()
|
2014-05-01 21:35:36 +02:00
|
|
|
list(APPEND TWEETNACL_SOURCES tweetnacl/contrib/randombytes/devurandom.c)
|
2014-05-01 21:24:20 +02:00
|
|
|
endif()
|
2014-05-08 23:51:34 +02:00
|
|
|
else()
|
|
|
|
find_library(SODIUM_FOUND sodium)
|
2014-05-01 21:24:20 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
|
2014-02-17 14:08:11 +01:00
|
|
|
set(POLLER "" CACHE STRING "Choose polling system. valid values are
|
2012-12-31 17:52:32 -05:00
|
|
|
kqueue, epoll, devpoll, poll or select [default=autodetect]")
|
|
|
|
|
2014-02-17 14:08:11 +01:00
|
|
|
include(CheckFunctionExists)
|
|
|
|
include(CheckTypeSize)
|
|
|
|
if(POLLER STREQUAL "")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES sys/event.h)
|
|
|
|
check_function_exists(kqueue HAVE_KQUEUE)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES )
|
|
|
|
if(HAVE_KQUEUE)
|
|
|
|
set(POLLER "kqueue")
|
|
|
|
else()
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES sys/epoll.h)
|
|
|
|
check_function_exists(epoll_create HAVE_EPOLL)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES )
|
|
|
|
if(HAVE_EPOLL)
|
|
|
|
set(POLLER "epoll")
|
|
|
|
else()
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES sys/devpoll.h)
|
|
|
|
check_type_size("struct pollfd" DEVPOLL)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES )
|
|
|
|
if(HAVE_DEVPOLL)
|
|
|
|
set(POLLER "devpoll")
|
|
|
|
else()
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES poll.h)
|
|
|
|
check_function_exists(poll HAVE_POLL)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES )
|
|
|
|
if(HAVE_POLL)
|
|
|
|
set(POLLER "poll")
|
|
|
|
else()
|
2014-04-14 21:49:57 +02:00
|
|
|
if(WIN32)
|
2014-02-17 14:08:11 +01:00
|
|
|
set(CMAKE_REQUIRED_INCLUDES winsock2.h)
|
2014-03-16 16:18:30 +00:00
|
|
|
set(HAVE_SELECT 1)
|
2014-02-17 14:08:11 +01:00
|
|
|
else()
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES sys/select.h)
|
2014-03-16 16:18:30 +00:00
|
|
|
check_function_exists(select HAVE_SELECT)
|
2014-02-17 14:08:11 +01:00
|
|
|
endif()
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES )
|
|
|
|
if(HAVE_SELECT)
|
|
|
|
set(POLLER "select")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"Could not autodetect polling method")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if( NOT POLLER STREQUAL "kqueue"
|
2012-12-31 17:52:32 -05:00
|
|
|
AND NOT POLLER STREQUAL "epoll"
|
|
|
|
AND NOT POLLER STREQUAL "devpoll"
|
|
|
|
AND NOT POLLER STREQUAL "poll"
|
|
|
|
AND NOT POLLER STREQUAL "select")
|
|
|
|
message(FATAL_ERROR "Invalid polling method")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT ${POLLER} STREQUAL "")
|
|
|
|
string(TOUPPER ${POLLER} UPPER_POLLER)
|
2014-02-17 14:08:11 +01:00
|
|
|
set(ZMQ_USE_${UPPER_POLLER} 1)
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
|
|
|
|
2013-07-14 13:36:30 -04:00
|
|
|
set(ZMQ_CMAKE_MODULES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/Modules)
|
2012-12-31 17:52:32 -05:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${ZMQ_CMAKE_MODULES_DIR})
|
|
|
|
|
|
|
|
include(TestZMQVersion)
|
|
|
|
include(ZMQSourceRunChecks)
|
|
|
|
include(CheckCCompilerFlag)
|
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
include(CheckCSourceCompiles)
|
|
|
|
include(CheckCSourceRuns)
|
|
|
|
include(CMakeDependentOption)
|
2013-12-06 10:55:44 -08:00
|
|
|
include(CheckCXXSymbolExists)
|
2012-12-31 17:52:32 -05:00
|
|
|
|
2015-02-06 10:42:23 -05:00
|
|
|
# MACRO to find include file
|
|
|
|
macro(zmq_find_include include_name var_result)
|
|
|
|
message(STATUS "Looking for header ${include_name}")
|
|
|
|
find_file(file_result NAMES "${include_name}" )
|
2015-02-06 11:03:14 -05:00
|
|
|
# message(STATUS "Find File result - ${file_result}")
|
2015-02-06 10:42:23 -05:00
|
|
|
string(FIND "${file_result}" "NOTFOUND" pos)
|
|
|
|
if (pos EQUAL -1)
|
|
|
|
#found include file
|
|
|
|
message(STATUS "Looking for header ${include_name} - found")
|
|
|
|
set("${var_result}" "${file_result}")
|
|
|
|
else()
|
|
|
|
# did not find include
|
|
|
|
message(STATUS "Looking for header ${include_name} - not found")
|
|
|
|
set("${var_result}" "")
|
|
|
|
endif()
|
|
|
|
#clear the find result
|
|
|
|
unset(file_result CACHE)
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
# MACRO to find a library
|
|
|
|
macro(zmq_find_library library_name var_result)
|
|
|
|
message(STATUS "Looking for library ${library_name}")
|
|
|
|
find_library(lib_result NAMES "${library_name}" )
|
2015-02-06 11:03:14 -05:00
|
|
|
# message(STATUS "Find Library result - ${lib_result}")
|
2015-02-06 10:42:23 -05:00
|
|
|
string(FIND "${lib_result}" "NOTFOUND" pos)
|
|
|
|
if (pos EQUAL -1)
|
|
|
|
#found library
|
|
|
|
message(STATUS "Looking for library ${library_name} - found")
|
|
|
|
set("${var_result}" "${lib_result}")
|
|
|
|
else()
|
|
|
|
# did not find library
|
|
|
|
message(STATUS "Looking for library ${library_name} - not found")
|
|
|
|
set("${var_result}" "")
|
|
|
|
endif()
|
|
|
|
#clear the find result
|
|
|
|
unset(lib_result CACHE)
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
#use find file instead of check_include_files
|
|
|
|
zmq_find_include("ifaddrs.h" ZMQ_HAVE_IFADDRS)
|
|
|
|
zmq_find_include("windows.h" ZMQ_HAVE_WINDOWS)
|
|
|
|
zmq_find_include("sys/uio.h" ZMQ_HAVE_UIO)
|
|
|
|
zmq_find_include("sys/eventfd.h" ZMQ_HAVE_EVENTFD)
|
|
|
|
|
|
|
|
#use find library instead of check library which fails on VS2015
|
|
|
|
zmq_find_library("ws2_32" HAVE_WS2_32)
|
|
|
|
zmq_find_library("ws2" HAVE_WS2)
|
|
|
|
zmq_find_library("rpcrt4" HAVE_RPCRT4) # UuidCreateSequential
|
|
|
|
zmq_find_library("iphlpapi" HAVE_IPHLAPI) # GetAdaptersAddresses
|
|
|
|
|
2013-12-06 10:55:44 -08:00
|
|
|
check_cxx_symbol_exists(SO_PEERCRED sys/socket.h ZMQ_HAVE_SO_PEERCRED)
|
|
|
|
check_cxx_symbol_exists(LOCAL_PEERCRED sys/socket.h ZMQ_HAVE_LOCAL_PEERCRED)
|
|
|
|
|
2013-01-23 14:31:02 -05:00
|
|
|
find_library(RT_LIBRARY rt)
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
find_package(Threads)
|
|
|
|
|
2013-01-01 21:04:19 -05:00
|
|
|
|
|
|
|
if(WIN32 AND NOT CYGWIN)
|
|
|
|
if(NOT HAVE_WS2_32 AND NOT HAVE_WS2)
|
|
|
|
message(FATAL_ERROR "Cannot link to ws2_32 or ws2")
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT HAVE_RPCRT4)
|
|
|
|
message(FATAL_ERROR "Cannot link to rpcrt4")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT HAVE_IPHLAPI)
|
|
|
|
message(FATAL_ERROR "Cannot link to iphlapi")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES rt)
|
|
|
|
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES )
|
|
|
|
|
2014-03-17 21:09:10 +01:00
|
|
|
set(CMAKE_REQUIRED_INCLUDES unistd.h)
|
|
|
|
check_function_exists(fork HAVE_FORK)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES )
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
set(CMAKE_REQUIRED_INCLUDES sys/time.h)
|
|
|
|
check_function_exists(gethrtime HAVE_GETHRTIME)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES )
|
|
|
|
|
|
|
|
add_definitions(-D_REENTRANT -D_THREAD_SAFE)
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
add_definitions(-DDLL_EXPORT)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(ENABLE_EVENTFD "Enable/disable eventfd" ZMQ_HAVE_EVENTFD)
|
|
|
|
|
|
|
|
macro(zmq_check_cxx_flag_prepend flag)
|
|
|
|
check_cxx_compiler_flag("${flag}" HAVE_FLAG_${flag})
|
|
|
|
|
|
|
|
if(HAVE_FLAG_${flag})
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
zmq_check_cxx_flag_prepend("/W3")
|
|
|
|
else()
|
|
|
|
zmq_check_cxx_flag_prepend("-Wall")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
zmq_check_cxx_flag_prepend("-Wextra")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
zmq_check_cxx_flag_prepend("-Wno-long-long")
|
|
|
|
zmq_check_cxx_flag_prepend("-Wno-uninitialized")
|
|
|
|
|
|
|
|
option(LIBZMQ_PEDANTIC "" ON)
|
|
|
|
option(LIBZMQ_WERROR "" OFF)
|
|
|
|
|
|
|
|
if(LIBZMQ_PEDANTIC)
|
2013-01-01 03:26:31 -05:00
|
|
|
zmq_check_cxx_flag_prepend("-pedantic")
|
|
|
|
|
|
|
|
if(${CMAKE_CXX_COMPILER_ID} MATCHES "Intel")
|
|
|
|
zmq_check_cxx_flag_prepend("-strict-ansi")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
|
|
|
|
zmq_check_cxx_flag_prepend("-compat=5")
|
|
|
|
endif()
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(LIBZMQ_WERROR)
|
|
|
|
zmq_check_cxx_flag_prepend("-Werror")
|
|
|
|
zmq_check_cxx_flag_prepend("-errwarn=%all")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
|
|
|
|
zmq_check_cxx_flag_prepend("-mcpu=v9")
|
|
|
|
endif()
|
|
|
|
|
2013-01-01 05:22:05 -05:00
|
|
|
if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
|
|
|
|
zmq_check_cxx_flag_prepend("-features=zla")
|
|
|
|
endif()
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "SunOS" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
|
|
|
message(STATUS "Checking whether atomic operations can be used")
|
|
|
|
check_c_source_compiles(
|
|
|
|
"
|
|
|
|
#include <atomic.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
uint32_t value;
|
|
|
|
atomic_cas_32(&value, 0, 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
"
|
|
|
|
HAVE_ATOMIC_H)
|
|
|
|
|
|
|
|
if(NOT HAVE_ATOMIC_H)
|
|
|
|
set(ZMQ_FORCE_MUTEXES 1)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
zmq_check_sock_cloexec()
|
|
|
|
zmq_check_so_keepalive()
|
|
|
|
zmq_check_tcp_keepcnt()
|
|
|
|
zmq_check_tcp_keepidle()
|
|
|
|
zmq_check_tcp_keepintvl()
|
|
|
|
zmq_check_tcp_keepalive()
|
|
|
|
|
|
|
|
|
|
|
|
if( CMAKE_SYSTEM_NAME MATCHES "Linux"
|
|
|
|
OR CMAKE_SYSTEM_NAME MATCHES "GNU/kFreeBSD"
|
|
|
|
OR CMAKE_SYSTEM_NAME MATCHES "GNU/Hurd"
|
|
|
|
OR CYGWIN)
|
|
|
|
add_definitions(-D_GNU_SOURCE)
|
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
|
|
add_definitions(-D__BSD_VISIBLE)
|
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
|
|
|
add_definitions(-D_NETBSD_SOURCE)
|
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
|
|
|
add_definitions(-D_OPENBSD_SOURCE)
|
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
|
|
|
add_definitions(-D_PTHREADS)
|
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
|
|
|
|
add_definitions(-D_POSIX_C_SOURCE=200112L)
|
|
|
|
zmq_check_cxx_flag_prepend(-Ae)
|
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|
|
|
add_definitions(-D_DARWIN_C_SOURCE)
|
|
|
|
endif()
|
|
|
|
|
2014-12-09 10:33:15 -05:00
|
|
|
if(NOT WITHOUT_ASCIIDOC)
|
2015-02-06 11:03:14 -05:00
|
|
|
set(CMAKE_PYTHON_VERSION 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5 2.4)
|
2014-12-09 10:33:15 -05:00
|
|
|
find_package(PythonInterp)
|
|
|
|
find_package(AsciiDoc)
|
|
|
|
else()
|
|
|
|
set(PYTHON_FOUND OFF)
|
|
|
|
set(ASCIIDOC_FOUND OFF)
|
|
|
|
endif()
|
2012-12-31 17:52:32 -05:00
|
|
|
|
|
|
|
cmake_dependent_option(WITH_DOC "Build Reference Guide documentation(requires DocBook)" ON
|
|
|
|
"PYTHON_FOUND;ASCIIDOC_FOUND" OFF)
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
if(WITH_OPENPGM)
|
|
|
|
# set(OPENPGM_ROOT "" CACHE PATH "Location of OpenPGM")
|
2013-01-01 06:53:56 -05:00
|
|
|
set(OPENPGM_VERSION_MAJOR 5)
|
|
|
|
set(OPENPGM_VERSION_MINOR 2)
|
|
|
|
set(OPENPGM_VERSION_MICRO 122)
|
|
|
|
if(CMAKE_CL_64)
|
|
|
|
find_path(OPENPGM_ROOT include/pgm/pgm.h
|
2012-12-31 17:52:32 -05:00
|
|
|
PATHS
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]"
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
2013-01-01 06:53:56 -05:00
|
|
|
message(STATUS "OpenPGM x64 detected - ${OPENPGM_ROOT}")
|
|
|
|
else()
|
|
|
|
find_path(OPENPGM_ROOT include/pgm/pgm.h
|
2012-12-31 17:52:32 -05:00
|
|
|
PATHS
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]"
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]"
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
)
|
2013-01-01 06:53:56 -05:00
|
|
|
message(STATUS "OpenPGM x86 detected - ${OPENPGM_ROOT}")
|
|
|
|
endif(CMAKE_CL_64)
|
|
|
|
set(OPENPGM_INCLUDE_DIRS ${OPENPGM_ROOT}/include)
|
|
|
|
set(OPENPGM_LIBRARY_DIRS ${OPENPGM_ROOT}/lib)
|
|
|
|
set(OPENPGM_LIBRARIES
|
|
|
|
optimized libpgm${_zmq_COMPILER}-mt-${OPENPGM_VERSION_MAJOR}_${OPENPGM_VERSION_MINOR}_${OPENPGM_VERSION_MICRO}.lib
|
|
|
|
debug libpgm${_zmq_COMPILER}-mt-gd-${OPENPGM_VERSION_MAJOR}_${OPENPGM_VERSION_MINOR}_${OPENPGM_VERSION_MICRO}.lib)
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
if(WITH_OPENPGM)
|
|
|
|
message(FATAL_ERROR "WITH_OPENPGM not implemented")
|
|
|
|
# DSO symbol visibility for openpgm
|
|
|
|
if(HAVE_FLAG_VISIBILITY_HIDDEN)
|
|
|
|
|
|
|
|
elseif(HAVE_FLAG_LDSCOPE_HIDDEN)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-10-11 19:31:30 +09:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# force off-tree build
|
|
|
|
|
2013-01-01 05:34:44 -05:00
|
|
|
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
|
2012-10-11 19:31:30 +09:00
|
|
|
message(FATAL_ERROR "CMake generation is not allowed within the source directory!
|
|
|
|
Remove the CMakeCache.txt file and try again from another folder, e.g.:
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
rm CMakeCache.txt
|
2012-10-11 19:31:30 +09:00
|
|
|
mkdir cmake-make
|
|
|
|
cd cmake-make
|
|
|
|
cmake ..
|
|
|
|
")
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
2012-10-11 19:31:30 +09:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# default to Release build
|
|
|
|
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING
|
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
|
|
|
FORCE)
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
2012-10-11 19:31:30 +09:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# platform specifics
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
if(MSVC)
|
|
|
|
add_definitions(
|
|
|
|
-DWIN32
|
2013-01-01 21:04:19 -05:00
|
|
|
-DDLL_EXPORT
|
2012-12-31 17:52:32 -05:00
|
|
|
# NB: May require tweaking for highly connected applications.
|
2014-08-23 13:59:53 +02:00
|
|
|
-DFD_SETSIZE=4096
|
2013-01-01 21:04:19 -05:00
|
|
|
-D_CRT_SECURE_NO_WARNINGS)
|
2012-12-31 17:52:32 -05:00
|
|
|
|
|
|
|
# Parallel make.
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
2012-10-11 19:31:30 +09:00
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
# Optimization flags.
|
|
|
|
# http://msdn.microsoft.com/en-us/magazine/cc301698.aspx
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG")
|
|
|
|
endif()
|
2012-10-12 18:18:04 +00:00
|
|
|
|
|
|
|
|
2012-10-11 19:31:30 +09:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# source files
|
|
|
|
|
|
|
|
set(cxx-sources
|
2012-12-31 17:52:32 -05:00
|
|
|
address.cpp
|
2015-02-02 16:42:50 +02:00
|
|
|
client.cpp
|
2012-12-31 17:52:32 -05:00
|
|
|
clock.cpp
|
|
|
|
ctx.cpp
|
2013-06-18 23:38:24 +02:00
|
|
|
curve_client.cpp
|
|
|
|
curve_server.cpp
|
2012-12-31 17:52:32 -05:00
|
|
|
dealer.cpp
|
|
|
|
devpoll.cpp
|
|
|
|
dist.cpp
|
|
|
|
epoll.cpp
|
|
|
|
err.cpp
|
|
|
|
fq.cpp
|
|
|
|
io_object.cpp
|
|
|
|
io_thread.cpp
|
|
|
|
ip.cpp
|
|
|
|
ipc_address.cpp
|
|
|
|
ipc_connecter.cpp
|
|
|
|
ipc_listener.cpp
|
|
|
|
kqueue.cpp
|
|
|
|
lb.cpp
|
|
|
|
mailbox.cpp
|
2013-08-17 13:43:45 +01:00
|
|
|
mechanism.cpp
|
2014-05-01 21:35:53 +02:00
|
|
|
metadata.cpp
|
2012-12-31 17:52:32 -05:00
|
|
|
msg.cpp
|
|
|
|
mtrie.cpp
|
|
|
|
object.cpp
|
|
|
|
options.cpp
|
|
|
|
own.cpp
|
2013-08-17 13:43:45 +01:00
|
|
|
null_mechanism.cpp
|
2012-12-31 17:52:32 -05:00
|
|
|
pair.cpp
|
|
|
|
pgm_receiver.cpp
|
|
|
|
pgm_sender.cpp
|
|
|
|
pgm_socket.cpp
|
|
|
|
pipe.cpp
|
2014-05-12 08:51:13 +01:00
|
|
|
plain_client.cpp
|
|
|
|
plain_server.cpp
|
2012-12-31 17:52:32 -05:00
|
|
|
poll.cpp
|
|
|
|
poller_base.cpp
|
|
|
|
precompiled.cpp
|
|
|
|
proxy.cpp
|
|
|
|
pub.cpp
|
|
|
|
pull.cpp
|
|
|
|
push.cpp
|
|
|
|
random.cpp
|
|
|
|
raw_encoder.cpp
|
|
|
|
raw_decoder.cpp
|
|
|
|
reaper.cpp
|
|
|
|
rep.cpp
|
|
|
|
req.cpp
|
|
|
|
router.cpp
|
|
|
|
select.cpp
|
2015-02-02 16:42:50 +02:00
|
|
|
server.cpp
|
2012-12-31 17:52:32 -05:00
|
|
|
session_base.cpp
|
|
|
|
signaler.cpp
|
|
|
|
socket_base.cpp
|
2014-06-23 13:10:43 +01:00
|
|
|
socks.cpp
|
|
|
|
socks_connecter.cpp
|
2013-07-01 11:52:39 +01:00
|
|
|
stream.cpp
|
2012-12-31 17:52:32 -05:00
|
|
|
stream_engine.cpp
|
|
|
|
sub.cpp
|
|
|
|
tcp.cpp
|
|
|
|
tcp_address.cpp
|
|
|
|
tcp_connecter.cpp
|
|
|
|
tcp_listener.cpp
|
|
|
|
thread.cpp
|
|
|
|
trie.cpp
|
|
|
|
v1_decoder.cpp
|
|
|
|
v1_encoder.cpp
|
2013-03-13 20:10:00 +01:00
|
|
|
v2_decoder.cpp
|
|
|
|
v2_encoder.cpp
|
2012-12-31 17:52:32 -05:00
|
|
|
xpub.cpp
|
|
|
|
xsub.cpp
|
|
|
|
zmq.cpp
|
2013-01-01 21:04:19 -05:00
|
|
|
zmq_utils.cpp)
|
|
|
|
|
|
|
|
set(rc-sources version.rc)
|
|
|
|
|
|
|
|
if(MINGW)
|
|
|
|
# Generate the right type when using -m32 or -m64
|
|
|
|
macro(set_rc_arch rc_target)
|
|
|
|
set(CMAKE_RC_COMPILER_INIT windres)
|
|
|
|
enable_language(RC)
|
|
|
|
set(CMAKE_RC_COMPILE_OBJECT
|
2014-04-13 15:25:22 +02:00
|
|
|
"<CMAKE_RC_COMPILER> <FLAGS> -O coff --target=${rc_target} <DEFINES> -i <SOURCE> -o <OBJECT>")
|
2013-01-01 21:04:19 -05:00
|
|
|
endmacro()
|
|
|
|
|
2013-10-23 20:22:20 +02:00
|
|
|
if (NOT CMAKE_SYSTEM_PROCESSOR )
|
|
|
|
set (CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR} )
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if( CMAKE_SYSTEM_PROCESSOR MATCHES "i386"
|
|
|
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "i486"
|
|
|
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "i586"
|
|
|
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "i686"
|
2013-01-01 21:04:19 -05:00
|
|
|
# This also happens on x86_64 systems...what a worthless variable
|
2013-10-23 20:22:20 +02:00
|
|
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86"
|
|
|
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64"
|
|
|
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "amd64")
|
2013-01-01 21:04:19 -05:00
|
|
|
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set_rc_arch("pe-x86-64")
|
|
|
|
else()
|
|
|
|
set_rc_arch("pe-i386")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(include ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
set(public_headers include/zmq.h
|
|
|
|
include/zmq_utils.h)
|
|
|
|
|
|
|
|
set(readme-docs AUTHORS
|
|
|
|
COPYING
|
|
|
|
COPYING.LESSER
|
|
|
|
MAINTAINERS
|
2013-07-14 13:26:55 -04:00
|
|
|
NEWS)
|
2012-10-11 19:31:30 +09:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# optional modules
|
|
|
|
|
2012-10-12 15:13:45 +00:00
|
|
|
if(WITH_OPENPGM)
|
2013-01-01 06:53:56 -05:00
|
|
|
add_definitions(-DZMQ_HAVE_OPENPGM)
|
|
|
|
include_directories(${OPENPGM_INCLUDE_DIRS})
|
|
|
|
link_directories(${OPENPGM_LIBRARY_DIRS})
|
|
|
|
set(OPTIONAL_LIBRARIES ${OPENPGM_LIBRARIES})
|
2012-10-12 15:13:45 +00:00
|
|
|
endif(WITH_OPENPGM)
|
2012-10-11 19:31:30 +09:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# source generators
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
foreach(source ${cxx-sources})
|
2013-01-01 05:34:44 -05:00
|
|
|
list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/src/${source})
|
2012-10-11 19:31:30 +09:00
|
|
|
endforeach()
|
|
|
|
|
2014-05-01 21:24:20 +02:00
|
|
|
foreach(source ${TWEETNACL_SOURCES})
|
|
|
|
list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/${source})
|
|
|
|
endforeach()
|
|
|
|
|
2013-01-01 02:25:15 -05:00
|
|
|
foreach(source ${rc-sources})
|
2013-01-02 15:50:04 -05:00
|
|
|
list(APPEND sources ${CMAKE_CURRENT_BINARY_DIR}/${source})
|
2013-01-01 02:25:15 -05:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/${source}.in ${CMAKE_CURRENT_BINARY_DIR}/${source})
|
|
|
|
endforeach()
|
|
|
|
|
2013-01-01 05:34:44 -05:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/platform.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/platform.hpp)
|
|
|
|
list(APPEND sources ${CMAKE_CURRENT_BINARY_DIR}/platform.hpp)
|
2012-10-11 19:31:30 +09:00
|
|
|
|
2014-02-11 15:46:38 -08:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/libzmq.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/libzmq.pc @ONLY)
|
2013-01-01 05:34:44 -05:00
|
|
|
set(zmq-pkgconfig ${CMAKE_CURRENT_BINARY_DIR}/libzmq.pc)
|
2012-12-31 17:52:32 -05:00
|
|
|
|
|
|
|
|
2015-02-09 10:47:05 -05:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzmq.pc DESTINATION lib/pkgconfig)
|
2012-12-31 17:52:32 -05:00
|
|
|
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
if(CMAKE_CL_64)
|
2013-07-14 13:36:30 -04:00
|
|
|
set(nsis-template ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/NSIS.template64.in)
|
2012-12-31 17:52:32 -05:00
|
|
|
else()
|
2013-07-14 13:36:30 -04:00
|
|
|
set(nsis-template ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/NSIS.template32.in)
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_custom_command(
|
2013-01-01 06:53:56 -05:00
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
ARGS -E
|
|
|
|
copy
|
|
|
|
${nsis-template}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in
|
|
|
|
DEPENDS ${nsis-template})
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
2012-10-11 19:31:30 +09:00
|
|
|
|
2013-01-01 05:34:44 -05:00
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
|
|
|
|
file(GLOB docs RELATIVE ${CMAKE_CURRENT_BINARY_DIR}/ "${CMAKE_CURRENT_SOURCE_DIR}/doc/*.txt")
|
2012-12-31 17:52:32 -05:00
|
|
|
set(html-docs)
|
|
|
|
foreach(txt ${docs})
|
|
|
|
string(REGEX REPLACE ".*/(.*)\\.txt" "\\1.html" html ${txt})
|
|
|
|
set(src ${txt})
|
|
|
|
set(dst doc/${html})
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${dst}
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE}
|
|
|
|
ARGS -x
|
|
|
|
${ASCIIDOC_EXECUTABLE}
|
|
|
|
-d manpage
|
|
|
|
-b xhtml11
|
2013-01-01 05:34:44 -05:00
|
|
|
-f ${CMAKE_CURRENT_SOURCE_DIR}/doc/asciidoc.conf
|
|
|
|
-azmq_version=${ZMQ_VERSION}
|
2012-12-31 17:52:32 -05:00
|
|
|
-o ${dst}
|
|
|
|
${src}
|
2013-01-01 05:34:44 -05:00
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${src}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
2012-12-31 17:52:32 -05:00
|
|
|
COMMENT "Generating ${html}")
|
|
|
|
if(WITH_DOC)
|
2013-01-01 05:34:44 -05:00
|
|
|
list(APPEND html-docs ${CMAKE_CURRENT_BINARY_DIR}/${dst})
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(ZMQ_BUILD_FRAMEWORK)
|
|
|
|
add_custom_command(
|
|
|
|
TARGET libzmq
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
ARGS -E make_directory "${CMAKE_LIBRARY_OUTPUT_PATH}/ZeroMQ.framework/Versions/${ZMQ_VERSION}/MacOS"
|
|
|
|
COMMENT "Perf tools")
|
|
|
|
endif()
|
|
|
|
|
2012-10-11 19:31:30 +09:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# output
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
if(MSVC)
|
2013-01-01 05:34:44 -05:00
|
|
|
add_library(libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in)
|
|
|
|
target_link_libraries(libzmq ${OPTIONAL_LIBRARIES})
|
2012-12-31 17:52:32 -05:00
|
|
|
set_target_properties(libzmq PROPERTIES
|
|
|
|
PUBLIC_HEADER "${public_headers}"
|
|
|
|
RELEASE_POSTFIX "${_zmq_COMPILER}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
2015-02-09 10:47:05 -05:00
|
|
|
RELWITHDEBINFO_POSTFIX "${_zmq_COMPILER}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
2014-03-19 22:01:45 +04:00
|
|
|
DEBUG_POSTFIX "${_zmq_COMPILER}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
2013-07-14 13:58:46 -04:00
|
|
|
add_library(libzmq-static STATIC ${sources})
|
|
|
|
set_target_properties(libzmq-static PROPERTIES
|
|
|
|
PUBLIC_HEADER "${public_headers}"
|
2015-02-09 10:47:05 -05:00
|
|
|
RELEASE_POSTFIX "${_zmq_COMPILER}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
|
|
|
RELWITHDEBINFO_POSTFIX "${_zmq_COMPILER}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
|
|
|
DEBUG_POSTFIX "${_zmq_COMPILER}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}"
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib"
|
2013-07-14 13:58:46 -04:00
|
|
|
COMPILE_FLAGS "/D ZMQ_STATIC"
|
2014-12-12 16:45:29 -05:00
|
|
|
OUTPUT_NAME "zmq")
|
2012-12-31 17:52:32 -05:00
|
|
|
else()
|
|
|
|
add_library(libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig})
|
|
|
|
if(ZMQ_BUILD_FRAMEWORK)
|
|
|
|
set_target_properties(libzmq PROPERTIES
|
|
|
|
FRAMEWORK TRUE
|
|
|
|
OUTPUT_NAME "ZeroMQ"
|
|
|
|
PUBLIC_HEADER "${public_headers}"
|
|
|
|
MACOSX_FRAMEWORK_IDENTIFIER "org.zeromq.libzmq"
|
|
|
|
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${ZMQ_VERSION}
|
|
|
|
MACOSX_FRAMEWORK_BUNDLE_VERSION ${ZMQ_VERSION}
|
|
|
|
VERSION ${ZMQ_VERSION}
|
|
|
|
SOVERSION "${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.0")
|
|
|
|
set_source_files_properties(${html-docs} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION doc)
|
|
|
|
set_source_files_properties(${readme-docs} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION etc)
|
|
|
|
set_source_files_properties(${zmq-pkgconfig} PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION lib/pkgconfig)
|
|
|
|
else()
|
|
|
|
set_target_properties(libzmq PROPERTIES
|
|
|
|
OUTPUT_NAME "zmq"
|
|
|
|
PUBLIC_HEADER "${public_headers}")
|
|
|
|
endif()
|
2014-07-02 16:51:34 -03:00
|
|
|
add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig})
|
|
|
|
set_target_properties(libzmq-static PROPERTIES
|
|
|
|
PUBLIC_HEADER "${public_headers}"
|
|
|
|
COMPILE_FLAGS "-DZMQ_STATIC"
|
|
|
|
OUTPUT_NAME "zmq-static")
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
|
|
|
|
2014-05-08 23:51:34 +02:00
|
|
|
target_link_libraries(libzmq ${SODIUM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
|
2012-12-31 17:52:32 -05:00
|
|
|
if(HAVE_WS2_32)
|
|
|
|
target_link_libraries(libzmq ws2_32)
|
2013-01-01 21:04:19 -05:00
|
|
|
elseif(HAVE_WS2)
|
|
|
|
target_link_libraries(libzmq ws2)
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_RPCRT4)
|
|
|
|
target_link_libraries(libzmq rpcrt4)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_IPHLAPI)
|
|
|
|
target_link_libraries(libzmq iphlpapi)
|
|
|
|
endif()
|
|
|
|
|
2014-02-24 11:07:28 -08:00
|
|
|
if(RT_LIBRARY)
|
|
|
|
target_link_libraries(libzmq ${RT_LIBRARY})
|
|
|
|
endif()
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
set(perf-tools local_lat
|
|
|
|
remote_lat
|
|
|
|
local_thr
|
|
|
|
remote_thr
|
|
|
|
inproc_lat
|
|
|
|
inproc_thr)
|
|
|
|
|
|
|
|
|
2015-02-09 10:47:05 -05:00
|
|
|
foreach(perf-tool ${perf-tools})
|
|
|
|
add_executable("${perf-tool}" "perf/${perf-tool}.cpp")
|
|
|
|
target_link_libraries("${perf-tool}" libzmq)
|
|
|
|
set_target_properties("${perf-tool}" PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
|
|
|
|
2013-01-23 14:31:02 -05:00
|
|
|
if(RT_LIBRARY)
|
2015-02-09 10:47:05 -05:00
|
|
|
target_link_libraries("${perf-tool}" ${RT_LIBRARY})
|
2013-01-23 14:31:02 -05:00
|
|
|
endif()
|
|
|
|
|
2015-02-09 10:47:05 -05:00
|
|
|
install(TARGETS "${perf-tool}"
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
COMPONENT PerfTools)
|
|
|
|
endforeach()
|
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
|
2014-02-07 17:50:45 +01:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# tests
|
|
|
|
|
|
|
|
set(ZMQ_BUILD_TESTS ON CACHE BOOL "Build the tests for ZeroMQ")
|
|
|
|
|
|
|
|
if(ZMQ_BUILD_TESTS)
|
2014-08-05 13:24:32 +02:00
|
|
|
enable_testing() # Enable testing only works in root scope
|
|
|
|
ADD_SUBDIRECTORY(tests)
|
|
|
|
endif()
|
2013-12-06 14:28:44 -08:00
|
|
|
|
2012-11-09 08:48:59 -05:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# installer
|
2012-10-11 19:31:30 +09:00
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
if(MSVC)
|
2015-02-09 10:47:05 -05:00
|
|
|
install(TARGETS libzmq libzmq-static EXPORT ZMQ-TARGETS
|
2012-12-31 17:52:32 -05:00
|
|
|
RUNTIME DESTINATION bin
|
2014-01-10 10:47:33 +04:00
|
|
|
ARCHIVE DESTINATION lib
|
2012-12-31 17:52:32 -05:00
|
|
|
PUBLIC_HEADER DESTINATION include
|
|
|
|
COMPONENT SDK)
|
|
|
|
else()
|
2015-02-09 10:47:05 -05:00
|
|
|
install(TARGETS libzmq libzmq-static EXPORT ZMQ-TARGETS
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
FRAMEWORK DESTINATION "Library/Frameworks"
|
|
|
|
PUBLIC_HEADER DESTINATION include)
|
2012-12-31 17:52:32 -05:00
|
|
|
endif()
|
|
|
|
|
2015-02-09 10:47:05 -05:00
|
|
|
#desire would be to export these with below but broken
|
|
|
|
#install(EXPORT ZMQ-TARGETS DESTINATION lib)
|
2012-12-31 17:52:32 -05:00
|
|
|
|
2013-01-01 05:34:44 -05:00
|
|
|
file(GLOB private_headers "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp")
|
2015-02-09 10:47:05 -05:00
|
|
|
install(FILES "${sources}" "${private_headers}" DESTINATION src/zmq
|
2012-12-31 17:52:32 -05:00
|
|
|
COMPONENT SourceCode)
|
|
|
|
|
|
|
|
foreach(readme ${readme-docs})
|
2013-01-01 05:34:44 -05:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${readme} ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt)
|
2012-12-31 17:52:32 -05:00
|
|
|
|
2013-01-01 05:34:44 -05:00
|
|
|
if(MSVC)
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt DESTINATION .)
|
|
|
|
else()
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt DESTINATION etc/zmq)
|
|
|
|
endif()
|
2015-02-09 10:47:05 -05:00
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
endforeach()
|
2012-10-11 19:31:30 +09:00
|
|
|
|
2012-12-31 17:52:32 -05:00
|
|
|
if(WITH_DOC)
|
|
|
|
if(NOT ZMQ_BUILD_FRAMEWORK)
|
|
|
|
install(FILES ${html-docs} DESTINATION doc/zmq COMPONENT RefGuide)
|
|
|
|
endif()
|
|
|
|
endif()
|