THRIFT-4720: documenting breaking changes, minor cleanup
diff --git a/build/cmake/BoostMacros.cmake b/build/cmake/BoostMacros.cmake
new file mode 100644
index 0000000..0c7f13d
--- /dev/null
+++ b/build/cmake/BoostMacros.cmake
@@ -0,0 +1,41 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set(BOOST_MINREV 1.53)
+
+macro(REQUIRE_BOOST_HEADERS)
+ find_package(Boost ${BOOST_MINREV} QUIET REQUIRED)
+ if (NOT Boost_FOUND)
+ string(CONCAT fatal_message
+ "Boost 1.53 or later is required to build sources in ${CMAKE_CURRENT_SOURCE_DIR}")
+ message(FATAL_ERROR, ${fatal_message})
+ endif()
+ include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
+endmacro()
+
+macro(REQUIRE_BOOST_LIBRARIES libs)
+ message(STATUS "Locating boost libraries required by sources in ${CMAKE_CURRENT_SOURCE_DIR}")
+ find_package(Boost ${BOOST_MINREV} REQUIRED COMPONENTS ${${libs}})
+ if (NOT Boost_FOUND)
+ string(CONCAT fatal_message
+ "Boost 1.53 or later is required to build sources in ${CMAKE_CURRENT_SOURCE_DIR}, "
+ "or use -DBUILD_TESTING=OFF")
+ message(FATAL_ERROR, ${fatal_message})
+ endif()
+endmacro()
diff --git a/build/cmake/DefineCMakeDefaults.cmake b/build/cmake/DefineCMakeDefaults.cmake
index 93255e0..7ae2136 100644
--- a/build/cmake/DefineCMakeDefaults.cmake
+++ b/build/cmake/DefineCMakeDefaults.cmake
@@ -34,10 +34,6 @@
# since cmake 2.4.0
set(CMAKE_COLOR_MAKEFILE ON)
-# Define the generic version of the libraries here
-set(GENERIC_LIB_VERSION "1.0.0")
-set(GENERIC_LIB_SOVERSION "0")
-
# Set the default build type to release with debug info
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 9aff53c..207b770 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -50,7 +50,6 @@
# C++
option(WITH_CPP "Build C++ Thrift library" ON)
if(WITH_CPP)
- find_package(Boost 1.53 QUIET)
# NOTE: Currently the following options are C++ specific,
# but in future other libraries might reuse them.
# So they are not dependent on WITH_CPP but setting them without WITH_CPP currently
@@ -78,10 +77,11 @@
find_package(OpenSSL QUIET)
CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON
"OPENSSL_FOUND" OFF)
+ # if disabled, builds with posix thread class - deprecated and will be removed...
option(WITH_STDTHREADS "Build with C++ std::thread support" ON)
endif()
CMAKE_DEPENDENT_OPTION(BUILD_CPP "Build C++ library" ON
- "BUILD_LIBRARIES;WITH_CPP;Boost_FOUND" OFF)
+ "BUILD_LIBRARIES;WITH_CPP" OFF)
CMAKE_DEPENDENT_OPTION(WITH_PLUGIN "Build compiler plugin support" OFF
"BUILD_COMPILER;BUILD_CPP" OFF)
@@ -93,20 +93,9 @@
CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON
"BUILD_LIBRARIES;WITH_C_GLIB;GLIB_FOUND" OFF)
-if(BUILD_CPP)
- set(boost_components)
- if(BUILD_TESTING)
- list(APPEND boost_components system thread)
- endif()
- if(BUILD_TESTING)
- list(APPEND boost_components unit_test_framework filesystem chrono program_options)
- endif()
- if(boost_components)
- find_package(Boost 1.53 REQUIRED COMPONENTS ${boost_components})
- endif()
-elseif(BUILD_C_GLIB AND BUILD_TESTING)
- find_package(Boost 1.53 REQUIRED)
-endif()
+ #if(BUILD_C_GLIB AND BUILD_TESTING)
+ # find_package(Boost 1.53 REQUIRED)
+ #endif()
# Java
option(WITH_JAVA "Build Java Thrift library" ON)
@@ -170,7 +159,6 @@
message(STATUS " Language libraries:")
message(STATUS " Build C++ library: ${BUILD_CPP}")
MESSAGE_DEP(WITH_CPP "Disabled by WITH_CPP=OFF")
-MESSAGE_DEP(Boost_FOUND "Boost headers missing")
message(STATUS " C++ Language Level: ${CXX_LANGUAGE_LEVEL}")
message(STATUS " Build C (GLib) library: ${BUILD_C_GLIB}")
MESSAGE_DEP(WITH_C_GLIB "Disabled by WITH_C_GLIB=OFF")