From 66326b9a47ba79fbdd4da2d9d4a06d46bb39adf6 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 29 Aug 2024 16:34:51 +0900 Subject: [PATCH] Boost::XXX may not exist when boost-cmake isn't used --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index cece13793e4bd..b31037a973279 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -1330,8 +1330,15 @@ if(ARROW_USE_BOOST) else() # Boost < 1.86 add_library(Boost::process INTERFACE IMPORTED) - target_link_libraries(Boost::process INTERFACE Boost::filesystem Boost::system - Boost::headers) + if(TARGET Boost::filesystem) + target_link_libraries(Boost::process INTERFACE Boost::filesystem) + endif() + if(TARGET Boost::system) + target_link_libraries(Boost::process INTERFACE Boost::system) + endif() + if(TARGET Boost::headers) + target_link_libraries(Boost::process INTERFACE Boost::headers) + endif() if(Boost_VERSION VERSION_GREATER_EQUAL 1.80) target_compile_definitions(Boost::process INTERFACE "BOOST_PROCESS_HAVE_V2") # Boost < 1.86 has a bug that