Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ endif (ENABLE_DRAFTS)

message(STATUS "cppzmq v${cppzmq_VERSION}")

set(CPPZMQ_HEADERS
zmq.hpp
zmq_addon.hpp
)
set(CPPZMQ_INCLUDE_BUILD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")

foreach (target cppzmq cppzmq-static)
add_library(${target} INTERFACE)
target_include_directories(${target} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
target_include_directories(${target} INTERFACE $<BUILD_INTERFACE:${CPPZMQ_INCLUDE_BUILD_DIR}>
$<INSTALL_INTERFACE:include>)
endforeach()

Expand All @@ -58,7 +55,7 @@ include(CMakePackageConfigHelpers)
install(TARGETS cppzmq cppzmq-static
EXPORT ${PROJECT_NAME}-targets)

install(FILES ${CPPZMQ_HEADERS}
install(DIRECTORY ${CPPZMQ_INCLUDE_BUILD_DIR}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".
Expand Down
2 changes: 1 addition & 1 deletion cmake/DetectCPPZMQVersion.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

file(READ "${CMAKE_CURRENT_SOURCE_DIR}/zmq.hpp" _CPPZMQ_H_CONTENTS)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/include/zmq.hpp" _CPPZMQ_H_CONTENTS)
string(REGEX REPLACE ".*#define CPPZMQ_VERSION_MAJOR ([0-9]+).*" "\\1" DETECTED_CPPZMQ_VERSION_MAJOR "${_CPPZMQ_H_CONTENTS}")
string(REGEX REPLACE ".*#define CPPZMQ_VERSION_MINOR ([0-9]+).*" "\\1" DETECTED_CPPZMQ_VERSION_MINOR "${_CPPZMQ_H_CONTENTS}")
string(REGEX REPLACE ".*#define CPPZMQ_VERSION_PATCH ([0-9]+).*" "\\1" DETECTED_CPPZMQ_VERSION_PATCH "${_CPPZMQ_H_CONTENTS}")
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# This script extracts the 0MQ version from zmq.hpp, which is the master
# location for this information.
#
if [ ! -f zmq.hpp ]; then
if [ ! -f include/zmq.hpp ]; then
echo "version.sh: error: zmq.hpp does not exist" 1>&2
exit 1
fi
MAJOR=$(grep '^#define CPPZMQ_VERSION_MAJOR \+[0-9]\+' zmq.hpp)
MINOR=$(grep '^#define CPPZMQ_VERSION_MINOR \+[0-9]\+' zmq.hpp)
PATCH=$(grep '^#define CPPZMQ_VERSION_PATCH \+[0-9]\+' zmq.hpp)
MAJOR=$(grep '^#define CPPZMQ_VERSION_MAJOR \+[0-9]\+' include/zmq.hpp)
MINOR=$(grep '^#define CPPZMQ_VERSION_MINOR \+[0-9]\+' include/zmq.hpp)
PATCH=$(grep '^#define CPPZMQ_VERSION_PATCH \+[0-9]\+' include/zmq.hpp)
if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then
echo "version.sh: error: could not extract version from zmq.hpp" 1>&2
exit 1
Expand Down