Skip to content

Commit

Permalink
Merge pull request #1 from madebr/zyre_for_casabre
Browse files Browse the repository at this point in the history
zyre: add shared/static + do not override shared in options
  • Loading branch information
casabre authored Mar 4, 2020
2 parents a12a31a + 03fe2cf commit 8b2a0ac
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 22 deletions.
2 changes: 1 addition & 1 deletion recipes/zyre/2.0.0/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ project(conanzyre)
include(conanbuildinfo.cmake)
conan_basic_setup()

add_subdirectory("source_subfolder")
add_subdirectory(source_subfolder)
4 changes: 4 additions & 0 deletions recipes/zyre/2.0.0/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ sources:
"2.0.0":
url: "https://github.com/zeromq/zyre/archive/v2.0.0.tar.gz"
sha256: "b978a999947ddb6722d956db2427869b313225e50518c4fbbf960a68109e3e91"
patches:
"2.0.0":
- patch_file: "patches/0001-cmake-use-conan-disable-executables.patch"
base_path: "source_subfolder"
12 changes: 7 additions & 5 deletions recipes/zyre/2.0.0/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from conans import ConanFile, CMake, tools
from packaging import version
import os


Expand All @@ -12,15 +11,16 @@ class ZyreConan(ConanFile):
description = "Local Area Clustering for Peer-to-Peer Applications."
topics = ("conan", "zyre", "czmq", "zmq", "zeromq",
"message-queue", "asynchronous")
exports_sources = ['CMakeLists.txt']
exports_sources = "CMakeLists.txt", "patches/**"
settings = "os", "compiler", "build_type", "arch"
requires = "zeromq/4.3.2", "czmq/4.2.0"
options = {
"shared": [True, False],
"fPIC": [True, False],
"drafts": [True, False],
}
default_options = {
"*:shared": True,
"shared": False,
"fPIC": True,
"drafts": False,
}
Expand All @@ -47,15 +47,17 @@ def _configure_cmake(self):
return self._cmake

def build(self):
for patch in self.conan_data["patches"][self.version]:
tools.patch(**patch)
cmake = self._configure_cmake()
cmake.build()

def package(self):
self.copy(pattern="LICENSE", src=self._source_subfolder,
dst='licenses')
dst="licenses")
cmake = self._configure_cmake()
cmake.install()
tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))

def package_info(self):
self.cpp_info.libs = ['zyre']
self.cpp_info.libs = ["zyre"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -109,8 +109,8 @@ set(OPTIONAL_LIBRARIES)
########################################################################
find_package(libzmq REQUIRED)
IF (LIBZMQ_FOUND)
- include_directories(${LIBZMQ_INCLUDE_DIRS})
- list(APPEND MORE_LIBRARIES ${LIBZMQ_LIBRARIES})
+ include_directories(${CONAN_INCLUDE_DIRS_LIBZMQ})
+ list(APPEND MORE_LIBRARIES ${CONAN_LIBS_LIBZMQ})
set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq")
ELSE (LIBZMQ_FOUND)
message( FATAL_ERROR "libzmq not found." )
@@ -121,8 +121,8 @@ ENDIF (LIBZMQ_FOUND)
########################################################################
find_package(czmq REQUIRED)
IF (CZMQ_FOUND)
- include_directories(${CZMQ_INCLUDE_DIRS})
- list(APPEND MORE_LIBRARIES ${CZMQ_LIBRARIES})
+ include_directories(${CONAN_INCLUDE_DIRS_CZMQ})
+ list(APPEND MORE_LIBRARIES ${CONAN_LIBS_CZMQ})
set(pkg_config_libs_private "${pkg_config_libs_private} -lczmq")
ELSE (CZMQ_FOUND)
message( FATAL_ERROR "czmq not found." )
@@ -182,9 +182,9 @@ install(TARGETS zyre
ARCHIVE DESTINATION "lib${LIB_SUFFIX}" # .lib file
RUNTIME DESTINATION bin # .dll file
)
-
+if(BUILD_EXECUTABLES)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists-local.txt) # Optional project-local hook
-
+endif()
########################################################################
# pkgconfig
########################################################################
@@ -211,6 +211,7 @@ install(
########################################################################
# executables
########################################################################
+if(BUILD_EXECUTABLES)
add_executable(
perf_local
"${SOURCE_DIR}/src/perf_local.c"
@@ -304,7 +305,7 @@ set_target_properties(
zyre_selftest
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SOURCE_DIR}/src"
)
-
+endif()
########################################################################
# tests
########################################################################
16 changes: 0 additions & 16 deletions recipes/zyre/2.0.0/patches/zyre-2.0.0.patch

This file was deleted.

0 comments on commit 8b2a0ac

Please sign in to comment.