diff --git a/recipes/zyre/2.0.0/CMakeLists.txt b/recipes/zyre/2.0.0/CMakeLists.txt index eea302b579ce6..7ec2533c9fb7c 100644 --- a/recipes/zyre/2.0.0/CMakeLists.txt +++ b/recipes/zyre/2.0.0/CMakeLists.txt @@ -4,4 +4,4 @@ project(conanzyre) include(conanbuildinfo.cmake) conan_basic_setup() -add_subdirectory("source_subfolder") +add_subdirectory(source_subfolder) diff --git a/recipes/zyre/2.0.0/conandata.yml b/recipes/zyre/2.0.0/conandata.yml index 14e744b76d4c1..8cbf792a2f44e 100644 --- a/recipes/zyre/2.0.0/conandata.yml +++ b/recipes/zyre/2.0.0/conandata.yml @@ -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" diff --git a/recipes/zyre/2.0.0/conanfile.py b/recipes/zyre/2.0.0/conanfile.py index 9f8d674914989..7e90abfea6b3d 100644 --- a/recipes/zyre/2.0.0/conanfile.py +++ b/recipes/zyre/2.0.0/conanfile.py @@ -1,5 +1,4 @@ from conans import ConanFile, CMake, tools -from packaging import version import os @@ -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, } @@ -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"] diff --git a/recipes/zyre/2.0.0/patches/0001-cmake-use-conan-disable-executables.patch b/recipes/zyre/2.0.0/patches/0001-cmake-use-conan-disable-executables.patch new file mode 100644 index 0000000000000..2bbf730c44dc8 --- /dev/null +++ b/recipes/zyre/2.0.0/patches/0001-cmake-use-conan-disable-executables.patch @@ -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 + ######################################################################## diff --git a/recipes/zyre/2.0.0/patches/zyre-2.0.0.patch b/recipes/zyre/2.0.0/patches/zyre-2.0.0.patch deleted file mode 100644 index 8886086e692e1..0000000000000 --- a/recipes/zyre/2.0.0/patches/zyre-2.0.0.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2bfab61..c86aef7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -203,11 +203,6 @@ configure_file( - "${SOURCE_DIR}/src/libzyre.pc" - @ONLY) - --install( -- FILES "${SOURCE_DIR}/src/libzyre.pc" -- DESTINATION "lib${LIB_SUFFIX}/pkgconfig" --) -- - ######################################################################## - # executables - ########################################################################