From ea2cfad51bb461df730667799ac400aec3f18f7c Mon Sep 17 00:00:00 2001 From: Nick Rivera Date: Tue, 18 Feb 2020 10:08:06 -0800 Subject: [PATCH] Windows CMake corrections (#6336) * Corrected method of specifying Windows path to LLVM tools * Fixing windows build * Corrected the dll install path * Fixing pulsarShared paths (cherry picked from commit 9b9e79e11acd01c9419af4726ae70ca3af10e074) --- pulsar-client-cpp/CMakeLists.txt | 11 ++++++----- pulsar-client-cpp/cmake_modules/FindClangTools.cmake | 8 ++++++-- pulsar-client-cpp/lib/CMakeLists.txt | 3 ++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pulsar-client-cpp/CMakeLists.txt b/pulsar-client-cpp/CMakeLists.txt index 56144b27e70d5..7c744df2def48 100644 --- a/pulsar-client-cpp/CMakeLists.txt +++ b/pulsar-client-cpp/CMakeLists.txt @@ -68,9 +68,9 @@ endif(NOT LOG_CATEGORY_NAME) add_definitions(-DLOG_CATEGORY_NAME=${LOG_CATEGORY_NAME} -DBUILDING_PULSAR -DBOOST_ALL_NO_LIB -DBOOST_ALLOW_DEPRECATED_HEADERS) if (LINK_STATIC) - find_library(ZLIB_LIBRARIES REQUIRED NAMES libz.a z) - find_library(Protobuf_LITE_LIBRARIES NAMES libprotobuf-lite.a) - find_library(CURL_LIBRARIES NAMES libcurl.a curl curl_a) + find_library(ZLIB_LIBRARIES REQUIRED NAMES libz.a z zlib) + find_library(Protobuf_LITE_LIBRARIES NAMES libprotobuf-lite.a libprotobuf-lite) + find_library(CURL_LIBRARIES NAMES libcurl.a curl curl_a libcurl_a) find_library(LIB_ZSTD NAMES libzstd.a) find_library(LIB_SNAPPY NAMES libsnappy.a) @@ -115,8 +115,9 @@ else() endif (NOT PROTOBUF_LIBRARIES) find_library(LIB_ZSTD zstd) - find_library(LIB_SNAPPY snappy libsnappy) - find_library(CURL_LIBRARIES curl) + find_library(LIB_SNAPPY NAMES snappy libsnappy) + find_library(CURL_LIBRARIES NAMES curl libcurl) + if (USE_LOG4CXX) find_library(LOG4CXX_LIBRARY_PATH log4cxx) find_path(LOG4CXX_INCLUDE_PATH log4cxx/logger.h) diff --git a/pulsar-client-cpp/cmake_modules/FindClangTools.cmake b/pulsar-client-cpp/cmake_modules/FindClangTools.cmake index 2d71c6b7cfbde..08d081a89eb7f 100644 --- a/pulsar-client-cpp/cmake_modules/FindClangTools.cmake +++ b/pulsar-client-cpp/cmake_modules/FindClangTools.cmake @@ -30,7 +30,10 @@ # CLANG_FORMAT_BIN, The path to the clang format binary # CLANG_TIDY_FOUND, Whether clang format was found -list(APPEND CLANG_SEARCH_PATHS ${ClangTools_PATH} $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin $<$:"C:/Program Files/LLVM/bin">) +list(APPEND CLANG_SEARCH_PATHS ${ClangTools_PATH} $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin) +if (WIN32) + list(APPEND CLANG_SEARCH_PATHS "C:/Program Files/LLVM/bin" "C:/Program Files (x86)/LLVM/bin") +endif() find_program(CLANG_TIDY_BIN NAMES clang-tidy-4.0 @@ -96,4 +99,5 @@ if ( "${CLANG_FORMAT_BIN}" STREQUAL "CLANG_FORMAT_BIN-NOTFOUND" ) else() set(CLANG_FORMAT_FOUND 1) message("clang-format found at ${CLANG_FORMAT_BIN}") -endif() \ No newline at end of file +endif() + diff --git a/pulsar-client-cpp/lib/CMakeLists.txt b/pulsar-client-cpp/lib/CMakeLists.txt index cb77b172e15b8..db514f1d2a505 100644 --- a/pulsar-client-cpp/lib/CMakeLists.txt +++ b/pulsar-client-cpp/lib/CMakeLists.txt @@ -120,5 +120,6 @@ else() install(TARGETS pulsarStatic DESTINATION lib) endif(LINK_STATIC) -install(TARGETS pulsarShared pulsarStatic DESTINATION lib) +install(TARGETS pulsarStatic DESTINATION lib) +install(TARGETS pulsarShared RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) install(DIRECTORY "../include/pulsar" DESTINATION include)