Repository: parquet-cpp Updated Branches: refs/heads/master 879feb2e6 -> 0189ead42
PARQUET-941: Stop needless Boost static library detection If PARQUET_BOOST_USE_SHARED is enabled (default), we never use Boost static libraries. So we doesn't need to detect Boost static libraries as a required dependency. Boost packages on CentOS 7 doesn't provide static libraries. So we can't build with Boost packages on CentOS 7 by the required dependency. Author: Kouhei Sutou <[email protected]> Closes #287 from kou/stop-needless-boost-static-library-detection and squashes the following commits: de11e70 [Kouhei Sutou] Stop needless Boost static library detection Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/0189ead4 Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/0189ead4 Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/0189ead4 Branch: refs/heads/master Commit: 0189ead42929319b0eed67ff3159252c09845d82 Parents: 879feb2 Author: Kouhei Sutou <[email protected]> Authored: Sun Apr 2 14:19:58 2017 +0200 Committer: Uwe L. Korn <[email protected]> Committed: Sun Apr 2 14:19:58 2017 +0200 ---------------------------------------------------------------------- cmake_modules/ThirdpartyToolchain.cmake | 43 ++++++++++++++++------------ 1 file changed, 24 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/0189ead4/cmake_modules/ThirdpartyToolchain.cmake ---------------------------------------------------------------------- diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake index bf2bb36..0cb3ef7 100644 --- a/cmake_modules/ThirdpartyToolchain.cmake +++ b/cmake_modules/ThirdpartyToolchain.cmake @@ -25,32 +25,37 @@ set(BROTLI_VERSION "5db62dcc9d386579609540cdf8869e95ad334bbd") set(ARROW_VERSION "15b874e47e3975c5240290ec7ed105bf8d1b56bc") # find boost headers and libs -# Find shared Boost libraries. set(Boost_DEBUG TRUE) set(Boost_USE_MULTITHREADED ON) -set(Boost_USE_STATIC_LIBS ON) -find_package(Boost COMPONENTS regex REQUIRED) -if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") - set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG}) -else() - set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE}) -endif() - -# Find static Boost libraries. -set(Boost_USE_STATIC_LIBS OFF) -find_package(Boost COMPONENTS regex REQUIRED) -if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") - set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG}) +if (PARQUET_BOOST_USE_SHARED) + # Find shared Boost libraries. + set(Boost_USE_STATIC_LIBS OFF) + find_package(Boost COMPONENTS regex REQUIRED) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") + set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG}) + else() + set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE}) + endif() else() - set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE}) + # Find static Boost libraries. + set(Boost_USE_STATIC_LIBS ON) + find_package(Boost COMPONENTS regex REQUIRED) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") + set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG}) + else() + set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE}) + endif() endif() message(STATUS "Boost include dir: " ${Boost_INCLUDE_DIRS}) message(STATUS "Boost libraries: " ${Boost_LIBRARIES}) -add_library(boost_static_regex STATIC IMPORTED) -set_target_properties(boost_static_regex PROPERTIES IMPORTED_LOCATION ${BOOST_STATIC_REGEX_LIBRARY}) -add_library(boost_shared_regex SHARED IMPORTED) -set_target_properties(boost_shared_regex PROPERTIES IMPORTED_LOCATION ${BOOST_SHARED_REGEX_LIBRARY}) +if (PARQUET_BOOST_USE_SHARED) + add_library(boost_shared_regex SHARED IMPORTED) + set_target_properties(boost_shared_regex PROPERTIES IMPORTED_LOCATION ${BOOST_SHARED_REGEX_LIBRARY}) +else() + add_library(boost_static_regex STATIC IMPORTED) + set_target_properties(boost_static_regex PROPERTIES IMPORTED_LOCATION ${BOOST_STATIC_REGEX_LIBRARY}) +endif() include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) set(LIBS ${LIBS} ${Boost_LIBRARIES})
