Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08e1982
commit 30c4449
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
project(cppzmq) | ||
|
||
find_package(ZeroMQ REQUIRED) | ||
|
||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/zmq.hpp" cppzmq_version_defines | ||
REGEX "#define CPPZMQ_VERSION_(MAJOR|MINOR|PATCH)") | ||
foreach(ver ${cppzmq_version_defines}) | ||
if(ver MATCHES "#define CPPZMQ_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$") | ||
set(CPPZMQ_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" CACHE INTERNAL "") | ||
endif() | ||
endforeach() | ||
set(${PROJECT_NAME}_VERSION | ||
${CPPZMQ_VERSION_MAJOR}.${CPPZMQ_VERSION_MINOR}.${CPPZMQ_VERSION_PATCH}) | ||
message(STATUS "cppzmq v${${PROJECT_NAME}_VERSION}") | ||
|
||
set(CPPZMQ_HEADERS | ||
zmq.hpp | ||
zmq_addon.hpp | ||
) | ||
|
||
include(GNUInstallDirs) | ||
include(CMakePackageConfigHelpers) | ||
|
||
install(FILES ${CPPZMQ_HEADERS} | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
||
# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share". | ||
set(CPPZMQ_CMAKECONFIG_INSTALL_DIR "share/cmake/${PROJECT_NAME}" CACHE STRING "install path for cppzmqConfig.cmake") | ||
|
||
configure_package_config_file(${PROJECT_NAME}Config.cmake.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" | ||
INSTALL_DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR}) | ||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake | ||
VERSION ${${PROJECT_NAME}_VERSION} | ||
COMPATIBILITY AnyNewerVersion) | ||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake | ||
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake | ||
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# cppzmq cmake module | ||
# This module sets the following variables in your project:: | ||
# | ||
# cppzmq_FOUND - true if cppzmq found on the system | ||
# cppzmq_INCLUDE_DIR - the directory containing cppzmq headers | ||
# cppzmq_LIBRARY - the ZeroMQ library for dynamic linking | ||
# cppzmq_STATIC_LIBRARY - the ZeroMQ library for static linking | ||
|
||
@PACKAGE_INIT@ | ||
|
||
set(PN cppzmq) | ||
set_and_check(${PN}_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@") | ||
set_and_check(${PN}_LIBRARY "@ZeroMQ_LIBRARY@") | ||
set_and_check(${PN}_STATIC_LIBRARY "@ZeroMQ_STATIC_LIBRARY@") | ||
check_required_components(${PN}) |