build: an attempt to make Boost searching process be more error proof

This commit is contained in:
sowle 2023-12-05 19:50:02 +01:00
parent f5958fa722
commit 46bef30dad

View file

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.6)
cmake_minimum_required(VERSION 3.19)
PROJECT(Zano)
@ -185,8 +185,8 @@ else()
endif()
# If BOOST_ROOT is set, ignore system-wide Boost
if(DEFINED ENV{BOOST_ROOT})
# always use system-wide Boost (unless ZANO_USE_SYSTEM_BOOST is defined for some reason, which is not recommended)
if(not DEFINED ENV{ZANO_USE_SYSTEM_BOOST})
set(Boost_NO_SYSTEM_PATHS ON)
endif()
@ -213,7 +213,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}/${CMAKE_ANDROID_ARCH_ABI}/")
set(Boost_LIBRARIES "${Boost_LIBRARY_DIRS}libboost_system.a;${Boost_LIBRARY_DIRS}libboost_filesystem.a;${Boost_LIBRARY_DIRS}libboost_thread.a;${Boost_LIBRARY_DIRS}libboost_timer.a;${Boost_LIBRARY_DIRS}libboost_date_time.a;${Boost_LIBRARY_DIRS}libboost_chrono.a;${Boost_LIBRARY_DIRS}libboost_regex.a;${Boost_LIBRARY_DIRS}libboost_serialization.a;${Boost_LIBRARY_DIRS}libboost_atomic.a;${Boost_LIBRARY_DIRS}libboost_program_options.a")
else()
find_package(Boost 1.70 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale)
find_package(Boost 1.70...1.71 REQUIRED COMPONENTS system filesystem thread timer date_time chrono regex serialization atomic program_options locale)
endif()