cmake.patch 3.7 KB

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