vcpkg/ports/boost-cmake/vcpkg-build.diff
Alexander Neumann bcf3d00d21
[Boost] use cmake build (#32309)
~~arm64-windows: boost-context builds are blocked by a cmake bug (see
https://gitlab.kitware.com/cmake/cmake/-/issues/24317)~~

closes #32274
closes https://github.com/Neumann-A/my-vcpkg-triplets/issues/5

Questions:
- [x] ~~Move cmake files to `share/cmake/<name>` ?~~ Not doing it
because it is just using `vcpkg_cmake_config_fixup()`
- [x] Fix weak dependencies (uwp|emscripten|android|arm)?
- [x] Fix library names on !x64 (currently hardcoded to x64 or x86;
failure in aricpp since it forces FindBoost module mode.)
- [x] ~~Fix arm64-windows boost-context builds -> requires CMake
(3.19.2?) update due to bug how the assembler is invoked.~~ (-> CI
baseline for now)

TODO:
- [x] adjust generate ports script
- [x] #37457

---------

Co-authored-by: Cheney-Wang <850426846@qq.com>
2024-04-29 15:27:41 -04:00

86 lines
2.6 KiB
Diff

diff --git a/include/BoostRoot.cmake b/include/BoostRoot.cmake
index e93f90712..063032e8a 100644
--- a/include/BoostRoot.cmake
+++ b/include/BoostRoot.cmake
@@ -21,7 +21,7 @@ set(__boost_incompatible_libraries "")
# Define cache variables if root project
-if(CMAKE_SOURCE_DIR STREQUAL Boost_SOURCE_DIR)
+if(1)
# --with-<library>
set(BOOST_INCLUDE_LIBRARIES "" CACHE STRING
@@ -188,6 +188,7 @@ endfunction()
function(__boost_scan_dependencies lib var)
set(result "")
+ set(required_components "")
if(EXISTS "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/${lib}/CMakeLists.txt")
@@ -196,7 +197,8 @@ function(__boost_scan_dependencies lib var)
foreach(line IN LISTS data)
if(line MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$")
+ list(APPEND required_components ${CMAKE_MATCH_1})
string(REGEX REPLACE "^numeric_" "numeric/" dep ${CMAKE_MATCH_1})
list(APPEND result ${dep})
@@ -206,13 +207,18 @@ function(__boost_scan_dependencies lib var)
endif()
+ list(REMOVE_DUPLICATES required_components)
+ list(REMOVE_ITEM required_components boost ${lib}) # due to property_tree and python
+ if(required_components)
+ find_package(Boost COMPONENTS ${required_components} REQUIRED CONFIG)
+ endif()
set(${var} ${result} PARENT_SCOPE)
endfunction()
#
file(GLOB __boost_libraries RELATIVE "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs" "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/*/CMakeLists.txt" "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/numeric/*/CMakeLists.txt")
# Check for mistakes in BOOST_INCLUDE_LIBRARIES
@@ -251,13 +256,13 @@ while(__boost_libs_to_scan)
list(REMOVE_DUPLICATES __boost_dependencies)
- set(__boost_libs_to_scan ${__boost_dependencies})
if(__boost_libs_to_scan)
list(REMOVE_ITEM __boost_libs_to_scan ${__boost_include_libraries})
+ list(REMOVE_ITEM __boost_libs_to_scan ${__boost_lib})
endif()
list(APPEND __boost_include_libraries ${__boost_libs_to_scan})
endwhile()
@@ -362,13 +367,14 @@ if(CMAKE_SKIP_INSTALL_RULES)
endif()
+if(0)
set(CONFIG_INSTALL_DIR "${BOOST_INSTALL_CMAKEDIR}/Boost-${BOOST_SUPERPROJECT_VERSION}")
set(CONFIG_FILE_NAME "${CMAKE_CURRENT_LIST_DIR}/../config/BoostConfig.cmake")
install(FILES "${CONFIG_FILE_NAME}" DESTINATION "${CONFIG_INSTALL_DIR}")
set(CONFIG_VERSION_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/tmpinst/BoostConfigVersion.cmake")
if(NOT CMAKE_VERSION VERSION_LESS 3.14)
write_basic_package_version_file("${CONFIG_VERSION_FILE_NAME}" COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
@@ -385,3 +392,4 @@ else()
endif()
install(FILES "${CONFIG_VERSION_FILE_NAME}" DESTINATION "${CONFIG_INSTALL_DIR}")
+endif()
\ No newline at end of file