CopernicaMarketingSoftware / AMQP-CPP

C++ library for asynchronous non-blocking communication with RabbitMQ
Apache License 2.0
885 stars 341 forks source link

build requires openssl to be installed on build machine in /usr/include #208

Open yuyongzhang1 opened 6 years ago

yuyongzhang1 commented 6 years ago

Hi,

We use meson/ninja as our build systems, where openssl is built as 3rdParty package, which is not installed on build-machine.

We tried to build AMQP-CPP as another 3rdParty Package with conanfile as the following: (We want to use TcpHandler, so we enabled AMQP-CPP_LINUX_TCP flag.)

from conans import ConanFile, CMake

class amqpcppConan(ConanFile): name = "amqpcpp" version = "3.0.0" settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False]} default_options = "shared=False" requires = "OpenSSL/1.0.2o@casa/stable" url = "https://github.com/CopernicaMarketingSoftware/AMQP-CPP.git" license = "Apache License 2.0" description = "amqpcpp"

def source(self):
    self.run("git clone https://github.com/CopernicaMarketingSoftware/AMQP-CPP.git")
    self.run("cd AMQP-CPP && git checkout v%s" % self.version)

def build(self):
    cmake = CMake(self, generator='Ninja')
    #cmake.configure(source_folder="AMQP-CPP")
    cmake.configure(source_folder="AMQP-CPP",
         defs={"AMQP-CPP_LINUX_TCP" : "ON"})
    cmake.build()

def package(self):
    self.copy("*.h", dst="include", src="AMQP-CPP/include")
    self.copy("*.a", dst="lib", keep_path=False)
    self.copy("*.so*", dst="lib", keep_path=False, symlinks=True)

def package_info(self):
    self.cpp_info.libs = ["amqpcpp"]

=====================================

However, we are getting errors:

[2/17] Building CXX object CMakeFiles/amqpcpp.dir/src/linux_tcp/tcpconnection.cpp.o FAILED: CMakeFiles/amqpcpp.dir/src/linux_tcp/tcpconnection.cpp.o /usr/bin/c++ -IAMQP-CPP/include -O2 -DNDEBUG -std=gnu++11 -MD -MT CMakeFiles/amqpcpp.dir/src/linux_tcp/tcpconnection.cpp.o -MF CMakeFiles/amqpcpp.dir/src/linux_tcp/tcpconnection.cpp.o.d -o CMakeFiles/amqpcpp.dir/src/linux_tcp/tcpconnection.cpp.o -c AMQP-CPP/src/linux_tcp/tcpconnection.cpp In file included from AMQP-CPP/src/linux_tcp/includes.h:23:0, from AMQP-CPP/src/linux_tcp/tcpconnection.cpp:13: AMQP-CPP/include/amqpcpp/linux_tcp/tcphandler.h:20:25: fatal error: openssl/ssl.h: No such file or directory

include <openssl/ssl.h>

                     ^

=================================== Any suggestions how to get around this?

DimasVeliz commented 4 years ago

Hey, I dont know the thing you are using, however I got the same error while installing with make :) you can try this out from stack overflow, it worked for me

https://stackoverflow.com/questions/17915098/openssl-ssl-h-no-such-file-or-directory-during-installation-of-git

aleksei-shabalin-simplisafe commented 4 years ago

I have the same problem as a topic starter. Some another libraries, like aws-cpp-sdk, provides an option to specify the path to openssl includes through CMake option. Something like this: cmake -DOPENSSL_ROOT_DIR=${openssl_PREFIX}... Does it make sense to provide the same config option for AMQP-CPP? It seems it is the only "external" dependency.

EmielBruijntjes commented 4 years ago

In our organization we don't use cmake. All the cmake code comes from pull requests, if you want it to be solved, you should submit a pull request too.