From: Lucian Petrut Date: Fri, 4 Oct 2019 10:37:58 +0000 (+0300) Subject: cmake: Add missing ssl include X-Git-Tag: v15.1.1~328^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ddf7de4f35ea0fa75b60d64792c8eaae3eae1eb0;p=ceph.git cmake: Add missing ssl include A few modules are using ssl headers without having the openssl include dir set by the cmake files. This change updates the according cmake files. Signed-off-by: Lucian Petrut --- diff --git a/src/auth/CMakeLists.txt b/src/auth/CMakeLists.txt index b6ae0c83efdc..8e849373a0b6 100644 --- a/src/auth/CMakeLists.txt +++ b/src/auth/CMakeLists.txt @@ -21,3 +21,4 @@ if(HAVE_GSSAPI) endif() add_library(common-auth-objs OBJECT ${auth_srcs}) +target_include_directories(common-auth-objs PRIVATE ${OPENSSL_INCLUDE_DIR}) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 7affa6d5f6b8..5e7fb6a78ebe 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -126,6 +126,10 @@ endif() add_library(common-common-objs OBJECT ${common_srcs}) +# Let's not rely on the default system headers and point Cmake to the +# retrieved OpenSSL location. This is especially important when cross +# compiling (e.g. targeting Windows). +target_include_directories(common-common-objs PRIVATE ${OPENSSL_INCLUDE_DIR}) # for options.cc target_compile_definitions(common-common-objs PRIVATE "CEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"" diff --git a/src/crypto/openssl/CMakeLists.txt b/src/crypto/openssl/CMakeLists.txt index 2525ed9359ba..7a63a32e8b3b 100644 --- a/src/crypto/openssl/CMakeLists.txt +++ b/src/crypto/openssl/CMakeLists.txt @@ -6,6 +6,7 @@ set(openssl_crypto_plugin_srcs add_library(ceph_crypto_openssl SHARED ${openssl_crypto_plugin_srcs}) target_link_libraries(ceph_crypto_openssl PRIVATE crypto) +target_include_directories(ceph_crypto_openssl PRIVATE ${OPENSSL_INCLUDE_DIR}) add_dependencies(crypto_plugins ceph_crypto_openssl) set_target_properties(ceph_crypto_openssl PROPERTIES INSTALL_RPATH "") install(TARGETS ceph_crypto_openssl DESTINATION ${crypto_plugin_dir}) diff --git a/src/msg/CMakeLists.txt b/src/msg/CMakeLists.txt index ce6550a57f6b..0c8359657958 100644 --- a/src/msg/CMakeLists.txt +++ b/src/msg/CMakeLists.txt @@ -38,6 +38,7 @@ if(HAVE_RDMA) endif() add_library(common-msg-objs OBJECT ${msg_srcs}) +target_include_directories(common-msg-objs PRIVATE ${OPENSSL_INCLUDE_DIR}) if(WITH_DPDK) set(async_dpdk_srcs