cmake.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. diff --git a/build/cmake/DefineInstallationPaths.cmake b/build/cmake/DefineInstallationPaths.cmake
  2. index d6b66e59..a089a790 100644
  3. --- a/build/cmake/DefineInstallationPaths.cmake
  4. +++ b/build/cmake/DefineInstallationPaths.cmake
  5. @@ -22,11 +22,7 @@
  6. set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)")
  7. # For MSVC builds, install shared libs to bin/, while keeping the install
  8. # dir for static libs as lib/.
  9. -if(MSVC AND BUILD_SHARED_LIBS)
  10. - set(LIB_INSTALL_DIR "bin${LIB_SUFFIX}" CACHE PATH "The library install dir (default: bin${LIB_SUFFIX})")
  11. -else()
  12. - set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
  13. -endif()
  14. +set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
  15. set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)")
  16. set(CMAKE_INSTALL_DIR "lib/cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)")
  17. set(PKGCONFIG_INSTALL_DIR "lib/pkgconfig" CACHE PATH "The subdirectory to install pkgconfig config files (default: lib/pkgconfig)")
  18. diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
  19. index b59292cd3..23caa09fe 100644
  20. --- a/build/cmake/DefineOptions.cmake
  21. +++ b/build/cmake/DefineOptions.cmake
  22. @@ -39,10 +39,7 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON)
  23. # and enables the library if all are found. This means the default is to build as
  24. # much as possible but leaving out libraries if their dependencies are not met.
  25. -if (NOT Boost_USE_STATIC_LIBS)
  26. - add_definitions(-DBOOST_ALL_DYN_LINK)
  27. - add_definitions(-DBOOST_TEST_DYN_LINK)
  28. -endif()
  29. +
  30. # as3
  31. option(WITH_AS3 "Build ActionScript 3 Thrift Library" ON)
  32. diff --git a/lib/c_glib/CMakeLists.txt b/lib/c_glib/CMakeLists.txt
  33. index 35571233d..ac6fc1d52 100644
  34. --- a/lib/c_glib/CMakeLists.txt
  35. +++ b/lib/c_glib/CMakeLists.txt
  36. @@ -71,7 +71,8 @@ set(thrift_c_glib_zlib_SOURCES
  37. )
  38. # If OpenSSL is not found just ignore the OpenSSL stuff
  39. -if(OPENSSL_FOUND AND WITH_OPENSSL)
  40. +if(WITH_OPENSSL)
  41. + find_package(OpenSSL REQUIRED)
  42. list(APPEND thrift_c_glib_SOURCES
  43. src/thrift/c_glib/transport/thrift_ssl_socket.c
  44. )
  45. @@ -83,8 +84,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL)
  46. list(APPEND SYSLIBS OpenSSL::Crypto)
  47. endif()
  48. else()
  49. - include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
  50. - list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}")
  51. + list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto)
  52. endif()
  53. endif()
  54. diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
  55. index c2f15dd57..3f36a23c1 100644
  56. --- a/lib/cpp/CMakeLists.txt
  57. +++ b/lib/cpp/CMakeLists.txt
  58. @@ -97,7 +97,8 @@ else()
  59. endif()
  60. # If OpenSSL is not found or disabled just ignore the OpenSSL stuff
  61. -if(OPENSSL_FOUND AND WITH_OPENSSL)
  62. +if(WITH_OPENSSL)
  63. + find_package(OpenSSL REQUIRED)
  64. list(APPEND thriftcpp_SOURCES
  65. src/thrift/transport/TSSLSocket.cpp
  66. src/thrift/transport/TSSLServerSocket.cpp
  67. @@ -112,8 +113,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL)
  68. list(APPEND SYSLIBS OpenSSL::Crypto)
  69. endif()
  70. else()
  71. - include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
  72. - list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}")
  73. + list(APPEND SYSLIBS OpenSSL::SSL OpenSSL::Crypto)
  74. endif()
  75. endif()
  76. @@ -174,7 +174,7 @@ if(WITH_LIBEVENT)
  77. target_link_libraries(thriftnb PUBLIC thrift)
  78. if(TARGET libevent::core AND TARGET libevent::extra)
  79. # libevent was found via its cmake config, use modern style targets
  80. - target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra)
  81. + target_link_libraries(thriftnb PUBLIC libevent::core libevent::extra)
  82. else()
  83. target_link_libraries(thriftnb PUBLIC ${LIBEVENT_LIBRARIES})
  84. endif()