diff --git a/services/tunnelbroker/CMakeLists.txt b/services/tunnelbroker/CMakeLists.txt --- a/services/tunnelbroker/CMakeLists.txt +++ b/services/tunnelbroker/CMakeLists.txt @@ -10,6 +10,8 @@ set(CMAKE_CXX_STANDARD 17) +find_package(PkgConfig REQUIRED) + # FIND LIBS set(protobuf_MODULE_COMPATIBLE TRUE) find_package(Protobuf CONFIG REQUIRED) @@ -37,19 +39,13 @@ set(_GRPC_CPP_PLUGIN_EXECUTABLE $) # Find AMQP-CPP installation -set(AMQPCPP_ROOT "/usr/lib/AMQP-CPP") -set(AMQPCPP_INCLUDE_DIR ${AMQPCPP_ROOT}/include) -set(AMQPCPP_LIBRARIES ${AMQPCPP_ROOT}/build/bin/libamqpcpp.so) +find_package(amqpcpp CONFIG REQUIRED) # Find Cryptopp installation -set(CRYPTOPP_ROOT "/usr/lib/cryptopp/build") -set(CRYPTOPP_INCLUDE_DIR ${CRYPTOPP_ROOT}/include) -set(CRYPTOPP_LIBRARIES ${CRYPTOPP_ROOT}/lib/libcryptopp.a) +pkg_check_modules(CRYPTOPP REQUIRED libcryptopp=8.6) # Find Libuv installation -set(LIBUV_ROOT "/usr/lib/libuv") -set(LIBUV_INCLUDE_DIR ${LIBUV_ROOT}/include) -set(LIBUV_LIBRARIES ${LIBUV_ROOT}/build/libuv.so) +pkg_check_modules(LIBUV REQUIRED libuv=1.43.0) set(BUILD_TESTING OFF CACHE BOOL "Turn off tests" FORCE) set(WITH_GFLAGS OFF CACHE BOOL "Turn off gflags" FORCE) @@ -106,9 +102,8 @@ ./lib/folly ./lib/double-conversion ${Boost_INCLUDE_DIR} - ${AMQPCPP_INCLUDE_DIR} - ${CRYPTOPP_INCLUDE_DIR} - ${LIBUV_INCLUDE_DIR} + ${CRYPTOPP_INCLUDE_DIRS} + ${LIBUV_INCLUDE_DIRS} ) set( @@ -164,10 +159,10 @@ ${_PROTOBUF_LIBPROTOBUF} ${_REFLECTION} ${AWSSDK_LINK_LIBRARIES} - ${AMQPCPP_LIBRARIES} ${CRYPTOPP_LIBRARIES} ${LIBUV_LIBRARIES} ${Boost_LIBRARIES} + amqpcpp OpenSSL::SSL glog::glog ) diff --git a/services/tunnelbroker/docker/install_cryptopp.sh b/services/tunnelbroker/docker/install_cryptopp.sh --- a/services/tunnelbroker/docker/install_cryptopp.sh +++ b/services/tunnelbroker/docker/install_cryptopp.sh @@ -14,7 +14,8 @@ mkdir build CXXFLAGS="-DNDEBUG -g2 -O3 -std=c++11" make -make install PREFIX=/usr/lib/cryptopp/build +make libcryptopp.pc +make install popd # cryptopp popd # /usr/lib diff --git a/services/tunnelbroker/docker/install_libuv.sh b/services/tunnelbroker/docker/install_libuv.sh --- a/services/tunnelbroker/docker/install_libuv.sh +++ b/services/tunnelbroker/docker/install_libuv.sh @@ -12,8 +12,10 @@ git clone --recurse-submodules -b v1.43.0 --single-branch https://github.com/libuv/libuv.git pushd libuv mkdir build -(cd build && cmake .. -DBUILD_TESTING=OFF) -cmake --build build +cd build +cmake .. -DBUILD_TESTING=OFF +make +make install popd # libuv popd # /usr/lib