Skip to content

Commit

Permalink
Windows CMake corrections (#6336)
Browse files Browse the repository at this point in the history
* Corrected method of specifying Windows path to LLVM tools

* Fixing windows build

* Corrected the dll install path

* Fixing pulsarShared paths

(cherry picked from commit 9b9e79e)
  • Loading branch information
heronr authored and tuteng committed Apr 13, 2020
1 parent ebb1c6f commit ea2cfad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
11 changes: 6 additions & 5 deletions pulsar-client-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions pulsar-client-cpp/cmake_modules/FindClangTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<$<PLATFORM_ID:Windows>:"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
Expand Down Expand Up @@ -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()
endif()

3 changes: 2 additions & 1 deletion pulsar-client-cpp/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit ea2cfad

Please sign in to comment.