Skip to content

Commit

Permalink
[cmake] introduced versions.cmake , pins to specific version of VG cm…
Browse files Browse the repository at this point in the history
…ake kit, require Boost 1.71 or higher
  • Loading branch information
evaleev committed Oct 24, 2023
1 parent f884850 commit 5025a3d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

cmake_minimum_required (VERSION 3.14.0) # FetchContent_MakeAvailable

# Preload versions/tags of all dependencies ====================================
include(external/versions.cmake)

###############################################################################
# CMake defaults to address key pain points
###############################################################################
Expand All @@ -24,6 +27,7 @@ FetchContent_Declare(
vg_cmake_kit
QUIET
GIT_REPOSITORY https://github.com/ValeevGroup/kit-cmake.git
GIT_TAG ${BTAS_TRACKED_VGCMAKEKIT_TAG}
SOURCE_DIR ${${VG_CMAKE_KIT_PREFIX_DIR}}/cmake/vg
BINARY_DIR ${${VG_CMAKE_KIT_PREFIX_DIR}}/cmake/vg-build
SUBBUILD_DIR ${${VG_CMAKE_KIT_PREFIX_DIR}}/cmake/vg-subbuild
Expand Down
4 changes: 2 additions & 2 deletions external/boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ if (NOT TARGET Boost::boost OR NOT TARGET Boost::serialization)
# try config first
# OPTIONAL_COMPONENTS in FindBoost available since 3.11
cmake_minimum_required(VERSION 3.11.0)
find_package(Boost CONFIG OPTIONAL_COMPONENTS ${Boost_BTAS_DEPS_LIBRARIES})
find_package(Boost ${BTAS_TRACKED_BOOST_VERSION} CONFIG OPTIONAL_COMPONENTS ${Boost_BTAS_DEPS_LIBRARIES})
if (NOT TARGET Boost::boost)
find_package(Boost OPTIONAL_COMPONENTS ${Boost_BTAS_DEPS_LIBRARIES})
find_package(Boost ${BTAS_TRACKED_BOOST_VERSION} OPTIONAL_COMPONENTS ${Boost_BTAS_DEPS_LIBRARIES})
if (TARGET Boost::boost)
set(Boost_USE_CONFIG FALSE)
endif(TARGET Boost::boost)
Expand Down
7 changes: 7 additions & 0 deletions external/versions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(BTAS_TRACKED_VGCMAKEKIT_TAG d6746098e63deab4032309c4455bb084a17ff51a)

# likely can use earlier, but
# - as of oct 2023 tested with 1.71 and up only
# - avoids the need to avoid 1.70 in which Boost.Container is broken
# - matches the version provided by https://github.com/Orphis/boost-cmake as of oct 2023
set(BTAS_TRACKED_BOOST_VERSION 1.71)

0 comments on commit 5025a3d

Please sign in to comment.