mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-27 07:31:03 +08:00
Conform to cmakelint --filter=-linelength
- Lowercase all commands - Unify indent to 2 spaces - Remove spaces around brackets - Remove repitition of condition in else(...) and endif(...) Note: (re-)running CMake did not change the content of the generated files
This commit is contained in:
parent
ca7c03f825
commit
a21228b664
120
CMakeLists.txt
120
CMakeLists.txt
@ -1,6 +1,6 @@
|
|||||||
# CMake build script for ZeroMQ
|
# CMake build script for ZeroMQ
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 2.8.12)
|
||||||
|
|
||||||
project(ZeroMQ)
|
project(ZeroMQ)
|
||||||
|
|
||||||
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}")
|
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
@ -25,12 +25,12 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=gnu++11" COMPILER_SUPPORTS_CXX11)
|
check_cxx_compiler_flag("-std=gnu++11" COMPILER_SUPPORTS_CXX11)
|
||||||
if(COMPILER_SUPPORTS_CXX11)
|
if(COMPILER_SUPPORTS_CXX11)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||||
endif()
|
endif()
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
CHECK_C_COMPILER_FLAG("-std=gnu11" COMPILER_SUPPORTS_C11)
|
check_c_compiler_flag("-std=gnu11" COMPILER_SUPPORTS_C11)
|
||||||
if(COMPILER_SUPPORTS_C11)
|
if(COMPILER_SUPPORTS_C11)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||||
endif()
|
endif()
|
||||||
@ -39,11 +39,11 @@ include (ZMQSupportMacros)
|
|||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
# clang 6 has a warning that does not make sense on multi-platform code
|
# clang 6 has a warning that does not make sense on multi-platform code
|
||||||
CHECK_CXX_COMPILER_FLAG("-Wno-tautological-constant-compare" CXX_HAS_TAUT_WARNING)
|
check_cxx_compiler_flag("-Wno-tautological-constant-compare" CXX_HAS_TAUT_WARNING)
|
||||||
if(CXX_HAS_TAUT_WARNING)
|
if(CXX_HAS_TAUT_WARNING)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-tautological-constant-compare")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-tautological-constant-compare")
|
||||||
endif()
|
endif()
|
||||||
CHECK_C_COMPILER_FLAG("-Wno-tautological-constant-compare" CC_HAS_TAUT_WARNING)
|
check_c_compiler_flag("-Wno-tautological-constant-compare" CC_HAS_TAUT_WARNING)
|
||||||
if(CC_HAS_TAUT_WARNING)
|
if(CC_HAS_TAUT_WARNING)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-tautological-constant-compare")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-tautological-constant-compare")
|
||||||
endif()
|
endif()
|
||||||
@ -68,7 +68,6 @@ option (ENABLE_CURVE "Enable CURVE security" ON)
|
|||||||
|
|
||||||
if(NOT ENABLE_CURVE)
|
if(NOT ENABLE_CURVE)
|
||||||
message(STATUS "CURVE security is disabled")
|
message(STATUS "CURVE security is disabled")
|
||||||
|
|
||||||
elseif(WITH_LIBSODIUM)
|
elseif(WITH_LIBSODIUM)
|
||||||
find_package(Sodium)
|
find_package(Sodium)
|
||||||
if(SODIUM_FOUND)
|
if(SODIUM_FOUND)
|
||||||
@ -81,7 +80,6 @@ elseif (WITH_LIBSODIUM)
|
|||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"libsodium is not installed. Install it, then run CMake again")
|
"libsodium is not installed. Install it, then run CMake again")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using tweetnacl for CURVE security")
|
message(STATUS "Using tweetnacl for CURVE security")
|
||||||
list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/src/tweetnacl.c)
|
list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/src/tweetnacl.c)
|
||||||
@ -92,16 +90,16 @@ endif ()
|
|||||||
set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
if(EXISTS "${SOURCE_DIR}/.git")
|
if(EXISTS "${SOURCE_DIR}/.git")
|
||||||
OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" ON)
|
option(ENABLE_DRAFTS "Build and install draft classes and methods" ON)
|
||||||
else()
|
else()
|
||||||
OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" OFF)
|
option(ENABLE_DRAFTS "Build and install draft classes and methods" OFF)
|
||||||
endif()
|
endif()
|
||||||
IF (ENABLE_DRAFTS)
|
if(ENABLE_DRAFTS)
|
||||||
ADD_DEFINITIONS (-DZMQ_BUILD_DRAFT_API)
|
add_definitions(-DZMQ_BUILD_DRAFT_API)
|
||||||
set(pkg_config_defines "-DZMQ_BUILD_DRAFT_API=1")
|
set(pkg_config_defines "-DZMQ_BUILD_DRAFT_API=1")
|
||||||
ELSE (ENABLE_DRAFTS)
|
else()
|
||||||
set(pkg_config_defines "")
|
set(pkg_config_defines "")
|
||||||
ENDIF (ENABLE_DRAFTS)
|
endif()
|
||||||
|
|
||||||
option(WITH_MILITANT "Enable militant assertions" OFF)
|
option(WITH_MILITANT "Enable militant assertions" OFF)
|
||||||
if(WITH_MILITANT)
|
if(WITH_MILITANT)
|
||||||
@ -235,8 +233,8 @@ if (NOT CYGWIN)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
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()
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
check_include_files(ifaddrs.h ZMQ_HAVE_IFADDRS)
|
check_include_files(ifaddrs.h ZMQ_HAVE_IFADDRS)
|
||||||
@ -270,7 +268,6 @@ find_library (RT_LIBRARY rt)
|
|||||||
|
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
|
||||||
|
|
||||||
if(WIN32 AND NOT CYGWIN)
|
if(WIN32 AND NOT CYGWIN)
|
||||||
if(NOT HAVE_WS2_32 AND NOT HAVE_WS2)
|
if(NOT HAVE_WS2_32 AND NOT HAVE_WS2)
|
||||||
message(FATAL_ERROR "Cannot link to ws2_32 or ws2")
|
message(FATAL_ERROR "Cannot link to ws2_32 or ws2")
|
||||||
@ -320,7 +317,7 @@ macro (zmq_check_cxx_flag_prepend flag)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
OPTION (ENABLE_ANALYSIS "Build with static analysis (make take very long)" OFF)
|
option(ENABLE_ANALYSIS "Build with static analysis(make take very long)" OFF)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
if(ENABLE_ANALYSIS)
|
if(ENABLE_ANALYSIS)
|
||||||
@ -400,19 +397,18 @@ if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
|
|||||||
zmq_check_cxx_flag_prepend("-features=zla")
|
zmq_check_cxx_flag_prepend("-features=zla")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "SunOS" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
if(CMAKE_SYSTEM_NAME MATCHES "SunOS" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
|
||||||
message(STATUS "Checking whether atomic operations can be used")
|
message(STATUS "Checking whether atomic operations can be used")
|
||||||
check_c_source_compiles(
|
check_c_source_compiles(
|
||||||
"
|
"\
|
||||||
#include <atomic.h>
|
#include <atomic.h> \
|
||||||
|
\
|
||||||
int main ()
|
int main() \
|
||||||
{
|
{ \
|
||||||
uint32_t value;
|
uint32_t value; \
|
||||||
atomic_cas_32 (&value, 0, 0);
|
atomic_cas_32(&value, 0, 0); \
|
||||||
return 0;
|
return 0; \
|
||||||
}
|
} \
|
||||||
"
|
"
|
||||||
HAVE_ATOMIC_H)
|
HAVE_ATOMIC_H)
|
||||||
|
|
||||||
@ -474,18 +470,16 @@ if (MSVC)
|
|||||||
find_path(OPENPGM_ROOT include/pgm/pgm.h
|
find_path(OPENPGM_ROOT include/pgm/pgm.h
|
||||||
PATHS
|
PATHS
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\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
|
NO_DEFAULT_PATH)
|
||||||
)
|
|
||||||
message(STATUS "OpenPGM x64 detected - ${OPENPGM_ROOT}")
|
message(STATUS "OpenPGM x64 detected - ${OPENPGM_ROOT}")
|
||||||
else()
|
else()
|
||||||
find_path(OPENPGM_ROOT include/pgm/pgm.h
|
find_path(OPENPGM_ROOT include/pgm/pgm.h
|
||||||
PATHS
|
PATHS
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]"
|
"[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}]"
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]"
|
||||||
NO_DEFAULT_PATH
|
NO_DEFAULT_PATH)
|
||||||
)
|
|
||||||
message(STATUS "OpenPGM x86 detected - ${OPENPGM_ROOT}")
|
message(STATUS "OpenPGM x86 detected - ${OPENPGM_ROOT}")
|
||||||
endif (CMAKE_CL_64)
|
endif()
|
||||||
set(OPENPGM_INCLUDE_DIRS ${OPENPGM_ROOT}/include)
|
set(OPENPGM_INCLUDE_DIRS ${OPENPGM_ROOT}/include)
|
||||||
set(OPENPGM_LIBRARY_DIRS ${OPENPGM_ROOT}/lib)
|
set(OPENPGM_LIBRARY_DIRS ${OPENPGM_ROOT}/lib)
|
||||||
set(OPENPGM_LIBRARIES
|
set(OPENPGM_LIBRARIES
|
||||||
@ -497,10 +491,10 @@ else ()
|
|||||||
# message(FATAL_ERROR "WITH_OPENPGM not implemented")
|
# message(FATAL_ERROR "WITH_OPENPGM not implemented")
|
||||||
|
|
||||||
if(NOT OPENPGM_PKGCONFIG_NAME)
|
if(NOT OPENPGM_PKGCONFIG_NAME)
|
||||||
SET (OPENPGM_PKGCONFIG_NAME "openpgm-5.2")
|
set(OPENPGM_PKGCONFIG_NAME "openpgm-5.2")
|
||||||
endif(NOT OPENPGM_PKGCONFIG_NAME)
|
endif()
|
||||||
|
|
||||||
SET (OPENPGM_PKGCONFIG_NAME ${OPENPGM_PKGCONFIG_NAME} CACHE STRING
|
set(OPENPGM_PKGCONFIG_NAME ${OPENPGM_PKGCONFIG_NAME} CACHE STRING
|
||||||
"Name pkg-config shall use to find openpgm libraries and include paths"
|
"Name pkg-config shall use to find openpgm libraries and include paths"
|
||||||
FORCE)
|
FORCE)
|
||||||
|
|
||||||
@ -528,14 +522,13 @@ endif ()
|
|||||||
# force off-tree build
|
# force off-tree build
|
||||||
|
|
||||||
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
|
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
message (FATAL_ERROR "CMake generation is not allowed within the source directory!
|
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.:
|
Remove the CMakeCache.txt file and try again from another folder, e.g.: \
|
||||||
|
\
|
||||||
rm CMakeCache.txt
|
rm CMakeCache.txt \
|
||||||
mkdir cmake-make
|
mkdir cmake-make \
|
||||||
cd cmake-make
|
cd cmake-make \
|
||||||
cmake ..
|
cmake ..")
|
||||||
")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
@ -835,11 +828,11 @@ if (MINGW)
|
|||||||
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Also happens on x86_64 systems...what a worthless variable
|
||||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "i386"
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "i386"
|
||||||
OR CMAKE_SYSTEM_PROCESSOR MATCHES "i486"
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "i486"
|
||||||
OR CMAKE_SYSTEM_PROCESSOR MATCHES "i586"
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "i586"
|
||||||
OR CMAKE_SYSTEM_PROCESSOR MATCHES "i686"
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "i686"
|
||||||
# This also happens on x86_64 systems...what a worthless variable
|
|
||||||
OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86"
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86"
|
||||||
OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64"
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64"
|
||||||
OR CMAKE_SYSTEM_PROCESSOR MATCHES "amd64")
|
OR CMAKE_SYSTEM_PROCESSOR MATCHES "amd64")
|
||||||
@ -852,10 +845,12 @@ if (MINGW)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set (public_headers include/zmq.h
|
set(public_headers
|
||||||
|
include/zmq.h
|
||||||
include/zmq_utils.h)
|
include/zmq_utils.h)
|
||||||
|
|
||||||
set (readme-docs AUTHORS
|
set(readme-docs
|
||||||
|
AUTHORS
|
||||||
COPYING
|
COPYING
|
||||||
COPYING.LESSER
|
COPYING.LESSER
|
||||||
NEWS)
|
NEWS)
|
||||||
@ -868,18 +863,18 @@ if (WITH_OPENPGM)
|
|||||||
include_directories(${OPENPGM_INCLUDE_DIRS})
|
include_directories(${OPENPGM_INCLUDE_DIRS})
|
||||||
link_directories(${OPENPGM_LIBRARY_DIRS})
|
link_directories(${OPENPGM_LIBRARY_DIRS})
|
||||||
set(OPTIONAL_LIBRARIES ${OPENPGM_LIBRARIES})
|
set(OPTIONAL_LIBRARIES ${OPENPGM_LIBRARIES})
|
||||||
endif (WITH_OPENPGM)
|
endif()
|
||||||
|
|
||||||
if(WITH_VMCI)
|
if(WITH_VMCI)
|
||||||
add_definitions(-DZMQ_HAVE_VMCI)
|
add_definitions(-DZMQ_HAVE_VMCI)
|
||||||
include_directories(${VMCI_INCLUDE_DIRS})
|
include_directories(${VMCI_INCLUDE_DIRS})
|
||||||
list(APPEND cxx-sources vmci_address.cpp vmci_connecter.cpp vmci_listener.cpp vmci.cpp)
|
list(APPEND cxx-sources vmci_address.cpp vmci_connecter.cpp vmci_listener.cpp vmci.cpp)
|
||||||
endif (WITH_VMCI)
|
endif()
|
||||||
|
|
||||||
if(ZMQ_HAVE_TIPC)
|
if(ZMQ_HAVE_TIPC)
|
||||||
add_definitions(-DZMQ_HAVE_TIPC)
|
add_definitions(-DZMQ_HAVE_TIPC)
|
||||||
list(APPEND cxx-sources tipc_address.cpp tipc_connecter.cpp tipc_listener.cpp)
|
list(APPEND cxx-sources tipc_address.cpp tipc_connecter.cpp tipc_listener.cpp)
|
||||||
endif (ZMQ_HAVE_TIPC)
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# source generators
|
# source generators
|
||||||
@ -961,16 +956,14 @@ if (MSVC)
|
|||||||
set_source_files_properties(${source}
|
set_source_files_properties(${source}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_FLAGS "/Yuprecompiled.hpp"
|
COMPILE_FLAGS "/Yuprecompiled.hpp"
|
||||||
OBJECT_DEPENDS precompiled.hpp
|
OBJECT_DEPENDS precompiled.hpp)
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
# create precompiled header
|
# create precompiled header
|
||||||
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/precompiled.cpp
|
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/precompiled.cpp
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_FLAGS "/Ycprecompiled.hpp"
|
COMPILE_FLAGS "/Ycprecompiled.hpp"
|
||||||
OBJECT_OUTPUTS precompiled.hpp
|
OBJECT_OUTPUTS precompiled.hpp)
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
@ -1038,8 +1031,7 @@ else ()
|
|||||||
PUBLIC
|
PUBLIC
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||||
$<INSTALL_INTERFACE:include>
|
$<INSTALL_INTERFACE:include>)
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_SHARED)
|
if(BUILD_SHARED)
|
||||||
@ -1073,22 +1065,22 @@ else ()
|
|||||||
|
|
||||||
if(BUILD_STATIC)
|
if(BUILD_STATIC)
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
add_library (libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs}
|
||||||
|
${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
||||||
else()
|
else()
|
||||||
add_library (libzmq-static STATIC $<TARGET_OBJECTS:objects> ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
add_library(libzmq-static STATIC $<TARGET_OBJECTS:objects> ${public_headers}
|
||||||
|
${html-docs} ${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(libzmq-static PROPERTIES
|
set_target_properties(libzmq-static PROPERTIES
|
||||||
PUBLIC_HEADER "${public_headers}"
|
PUBLIC_HEADER "${public_headers}"
|
||||||
OUTPUT_NAME "zmq"
|
OUTPUT_NAME "zmq"
|
||||||
PREFIX "lib")
|
PREFIX "lib")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_STATIC)
|
if(BUILD_STATIC)
|
||||||
target_compile_definitions(libzmq-static
|
target_compile_definitions(libzmq-static
|
||||||
PUBLIC ZMQ_STATIC
|
PUBLIC ZMQ_STATIC)
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(target ${target_outputs})
|
foreach(target ${target_outputs})
|
||||||
@ -1096,8 +1088,7 @@ foreach (target ${target_outputs})
|
|||||||
PUBLIC
|
PUBLIC
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||||
$<INSTALL_INTERFACE:include>
|
$<INSTALL_INTERFACE:include>)
|
||||||
)
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(BUILD_SHARED)
|
if(BUILD_SHARED)
|
||||||
@ -1161,7 +1152,8 @@ if (BUILD_STATIC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_SHARED)
|
if(BUILD_SHARED)
|
||||||
set (perf-tools local_lat
|
set(perf-tools
|
||||||
|
local_lat
|
||||||
remote_lat
|
remote_lat
|
||||||
local_thr
|
local_thr
|
||||||
remote_thr
|
remote_thr
|
||||||
@ -1208,7 +1200,7 @@ set (ZMQ_BUILD_TESTS ${BUILD_TESTS} CACHE BOOL "Build the tests for ZeroMQ")
|
|||||||
|
|
||||||
if(ZMQ_BUILD_TESTS)
|
if(ZMQ_BUILD_TESTS)
|
||||||
enable_testing() # Enable testing only works in root scope
|
enable_testing() # Enable testing only works in root scope
|
||||||
ADD_SUBDIRECTORY (tests)
|
add_subdirectory(tests)
|
||||||
if(BUILD_STATIC)
|
if(BUILD_STATIC)
|
||||||
add_subdirectory(unittests)
|
add_subdirectory(unittests)
|
||||||
else()
|
else()
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
cmake_minimum_required(VERSION "2.8.1")
|
cmake_minimum_required(VERSION "2.8.1")
|
||||||
|
|
||||||
# On Windows: solution file will be called tests.sln
|
# On Windows: solution file will be called tests.sln
|
||||||
PROJECT(tests)
|
project(tests)
|
||||||
|
|
||||||
set(tests
|
set(tests
|
||||||
test_ancillaries
|
test_ancillaries
|
||||||
@ -73,10 +73,12 @@ set(tests
|
|||||||
test_reconnect_ivl
|
test_reconnect_ivl
|
||||||
test_mock_pub_sub
|
test_mock_pub_sub
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ZMQ_HAVE_CURVE)
|
if(ZMQ_HAVE_CURVE)
|
||||||
list(APPEND tests
|
list(APPEND tests
|
||||||
test_security_curve)
|
test_security_curve)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
list(APPEND tests
|
list(APPEND tests
|
||||||
test_ipc_wildcard
|
test_ipc_wildcard
|
||||||
@ -123,8 +125,7 @@ if(WITH_VMCI)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_DRAFTS)
|
||||||
IF (ENABLE_DRAFTS)
|
|
||||||
list(APPEND tests
|
list(APPEND tests
|
||||||
test_poller
|
test_poller
|
||||||
test_thread_safe
|
test_thread_safe
|
||||||
@ -136,7 +137,7 @@ IF (ENABLE_DRAFTS)
|
|||||||
test_app_meta
|
test_app_meta
|
||||||
test_router_notify
|
test_router_notify
|
||||||
)
|
)
|
||||||
ENDIF (ENABLE_DRAFTS)
|
endif()
|
||||||
|
|
||||||
# add location of platform.hpp for Windows builds
|
# add location of platform.hpp for Windows builds
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@ -146,8 +147,7 @@ if(WIN32)
|
|||||||
link_libraries(ws2_32.lib)
|
link_libraries(ws2_32.lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library (unity
|
add_library(unity STATIC
|
||||||
STATIC
|
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.c"
|
"${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.c"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.h"
|
"${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.h"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity_internals.h")
|
"${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity_internals.h")
|
||||||
@ -156,13 +156,13 @@ set_target_properties (unity PROPERTIES
|
|||||||
target_compile_definitions(unity PUBLIC "UNITY_USE_COMMAND_LINE_ARGS" "UNITY_EXCLUDE_FLOAT")
|
target_compile_definitions(unity PUBLIC "UNITY_USE_COMMAND_LINE_ARGS" "UNITY_EXCLUDE_FLOAT")
|
||||||
target_include_directories(unity PUBLIC "${CMAKE_CURRENT_LIST_DIR}/../external/unity")
|
target_include_directories(unity PUBLIC "${CMAKE_CURRENT_LIST_DIR}/../external/unity")
|
||||||
|
|
||||||
IF (MSVC_VERSION LESS 1700)
|
if(MSVC_VERSION LESS 1700)
|
||||||
SET_SOURCE_FILES_PROPERTIES("${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.c" PROPERTIES LANGUAGE CXX)
|
set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.c" PROPERTIES LANGUAGE CXX)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF (MSVC_VERSION LESS 1600)
|
if(MSVC_VERSION LESS 1600)
|
||||||
target_compile_definitions(unity PUBLIC "UNITY_EXCLUDE_STDINT_H")
|
target_compile_definitions(unity PUBLIC "UNITY_EXCLUDE_STDINT_H")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# add library and include dirs for all targets
|
# add library and include dirs for all targets
|
||||||
if(BUILD_SHARED)
|
if(BUILD_SHARED)
|
||||||
@ -192,7 +192,7 @@ foreach(test ${tests})
|
|||||||
# You should provide the correct directory, don't know how to do it automatically
|
# You should provide the correct directory, don't know how to do it automatically
|
||||||
find_path(LIBZMQ_PATH "libzmq.lib" PATHS "../bin/Win32/Debug/v120/dynamic")
|
find_path(LIBZMQ_PATH "libzmq.lib" PATHS "../bin/Win32/Debug/v120/dynamic")
|
||||||
if(NOT ${LIBZMQ_PATH} STREQUAL "LIBZMQ_PATH-NOTFOUND")
|
if(NOT ${LIBZMQ_PATH} STREQUAL "LIBZMQ_PATH-NOTFOUND")
|
||||||
SET_TARGET_PROPERTIES( ${test} PROPERTIES LINK_FLAGS "/LIBPATH:${LIBZMQ_PATH}" )
|
set_target_properties(${test} PROPERTIES LINK_FLAGS "/LIBPATH:${LIBZMQ_PATH}")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
# per-test directories not generated on OS X / Darwin
|
# per-test directories not generated on OS X / Darwin
|
||||||
@ -201,7 +201,6 @@ foreach(test ${tests})
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(RT_LIBRARY)
|
if(RT_LIBRARY)
|
||||||
target_link_libraries(${test} ${RT_LIBRARY})
|
target_link_libraries(${test} ${RT_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
@ -9,10 +9,10 @@ set(unittests
|
|||||||
unittest_udp_address
|
unittest_udp_address
|
||||||
)
|
)
|
||||||
|
|
||||||
#IF (ENABLE_DRAFTS)
|
#if(ENABLE_DRAFTS)
|
||||||
# list(APPEND tests
|
# list(APPEND tests
|
||||||
# )
|
# )
|
||||||
#ENDIF (ENABLE_DRAFTS)
|
#endif(ENABLE_DRAFTS)
|
||||||
|
|
||||||
# add location of platform.hpp for Windows builds
|
# add location of platform.hpp for Windows builds
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user