File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 2.8.12)
2+ project (cppzmq)
3+
4+ find_package (ZeroMQ REQUIRED)
5+
6+ file (STRINGS "${CMAKE_CURRENT_SOURCE_DIR} /zmq.hpp" cppzmq_version_defines
7+ REGEX "#define CPPZMQ_VERSION_(MAJOR|MINOR|PATCH)" )
8+ foreach (ver ${cppzmq_version_defines} )
9+ if (ver MATCHES "#define CPPZMQ_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$" )
10+ set (CPPZMQ_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2} " CACHE INTERNAL "" )
11+ endif ()
12+ endforeach ()
13+ set (${PROJECT_NAME} _VERSION
14+ ${CPPZMQ_VERSION_MAJOR} .${CPPZMQ_VERSION_MINOR} .${CPPZMQ_VERSION_PATCH} )
15+ message (STATUS "cppzmq v${${PROJECT_NAME} _VERSION}" )
16+
17+ set (CPPZMQ_HEADERS
18+ zmq.hpp
19+ zmq_addon.hpp
20+ )
21+
22+ include (GNUInstallDirs)
23+ include (CMakePackageConfigHelpers)
24+
25+ install (FILES ${CPPZMQ_HEADERS}
26+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
27+
28+ # GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".
29+ set (CPPZMQ_CMAKECONFIG_INSTALL_DIR "share/cmake/${PROJECT_NAME} " CACHE STRING "install path for cppzmqConfig.cmake" )
30+
31+ configure_package_config_file(${PROJECT_NAME} Config.cmake.in
32+ "${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} Config.cmake"
33+ INSTALL_DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR} )
34+ write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} ConfigVersion.cmake
35+ VERSION ${${PROJECT_NAME} _VERSION}
36+ COMPATIBILITY AnyNewerVersion)
37+ install (FILES ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} Config.cmake
38+ ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} ConfigVersion.cmake
39+ DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR} )
Original file line number Diff line number Diff line change 1+ # cppzmq cmake module
2+ # This module sets the following variables in your project::
3+ #
4+ # cppzmq_FOUND - true if cppzmq found on the system
5+ # cppzmq_INCLUDE_DIR - the directory containing cppzmq headers
6+ # cppzmq_LIBRARY - the ZeroMQ library for dynamic linking
7+ # cppzmq_STATIC_LIBRARY - the ZeroMQ library for static linking
8+
9+ @PACKAGE_INIT@
10+
11+ set (PN cppzmq)
12+ set_and_check(${PN} _INCLUDE_DIR "${PACKAGE_PREFIX_DIR} /@CMAKE_INSTALL_INCLUDEDIR@" )
13+ set_and_check(${PN} _LIBRARY "@ZeroMQ_LIBRARY@" )
14+ set_and_check(${PN} _STATIC_LIBRARY "@ZeroMQ_STATIC_LIBRARY@" )
15+ check_required_components(${PN} )
You can’t perform that action at this time.
0 commit comments