Skip to content

Commit

Permalink
Merge pull request #171 from ValeevGroup/170-boost-discovery-only-wor…
Browse files Browse the repository at this point in the history
…ks-cleanly-if-all-or-none-but-not-some-required-boost-components-already-exist

most robust Boost discovery
  • Loading branch information
evaleev committed Jan 24, 2024
2 parents bef8f22 + a09cdac commit a54b414
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
sudo apt-get install intel-oneapi-mkl-devel
echo "BLAS_PREFERENCE_LIST=IntelMKL" >> $GITHUB_ENV
echo "MKLROOT=/opt/intel/oneapi/mkl/latest" >> $GITHUB_ENV
echo "MKL_NUM_THREADS=1" >> $GITHUB_ENV
else
echo "BLAS_PREFERENCE_LIST=ReferenceBLAS" >> $GITHUB_ENV
fi
Expand Down
46 changes: 22 additions & 24 deletions external/boost.cmake
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
# -*- mode: cmake -*-

# Boost can be discovered by every (sub)package but only the top package can build it ...
# if we are the top package need to include the list of Boost components to be built
if("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
set(required_components
headers # BTAS
container # BTAS
iterator # BTAS
random # BTAS
)
if (DEFINED Boost_REQUIRED_COMPONENTS)
list(APPEND Boost_REQUIRED_COMPONENTS ${required_components})
list(REMOVE_DUPLICATES Boost_REQUIRED_COMPONENTS)
else()
set(Boost_REQUIRED_COMPONENTS "${required_components}" CACHE STRING "Required components of Boost to discovered or built")
endif()
set(optional_components
serialization # BTAS
)
if (DEFINED Boost_OPTIONAL_COMPONENTS)
list(APPEND Boost_OPTIONAL_COMPONENTS ${optional_components})
list(REMOVE_DUPLICATES Boost_OPTIONAL_COMPONENTS)
else()
set(Boost_OPTIONAL_COMPONENTS "${optional_components}" CACHE STRING "Optional components of Boost to discovered or built")
endif()
# Boost can be discovered by every (sub)package but only the top package can *build* it ...
# in either case must declare the components used by BTAS
set(required_components
headers # BTAS
container # BTAS
iterator # BTAS
random # BTAS
)
if (DEFINED Boost_REQUIRED_COMPONENTS)
list(APPEND Boost_REQUIRED_COMPONENTS ${required_components})
list(REMOVE_DUPLICATES Boost_REQUIRED_COMPONENTS)
else()
set(Boost_REQUIRED_COMPONENTS "${required_components}" CACHE STRING "Required components of Boost to discovered or built")
endif()
set(optional_components
serialization # BTAS
)
if (DEFINED Boost_OPTIONAL_COMPONENTS)
list(APPEND Boost_OPTIONAL_COMPONENTS ${optional_components})
list(REMOVE_DUPLICATES Boost_OPTIONAL_COMPONENTS)
else()
set(Boost_OPTIONAL_COMPONENTS "${optional_components}" CACHE STRING "Optional components of Boost to discovered or built")
endif()

if (BTAS_BUILD_DEPS_FROM_SOURCE AND NOT DEFINED Boost_FETCH_IF_MISSING)
Expand Down
2 changes: 1 addition & 1 deletion external/versions.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(BTAS_TRACKED_VGCMAKEKIT_TAG 8713beb71ff6b7d4b1c758e9e1c7d814bd97b0af)
set(BTAS_TRACKED_VGCMAKEKIT_TAG 45e7d0d8d7f994a88c5af5fc082332db7bd0d6b3)

# likely can use earlier, but
# - as of oct 2023 tested with 1.71 and up only
Expand Down

0 comments on commit a54b414

Please sign in to comment.