aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/boost-cmake
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/boost-cmake
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/boost-cmake')
-rw-r--r--vcpkg/ports/boost-cmake/0001-vcpkg-build.patch95
-rw-r--r--vcpkg/ports/boost-cmake/0002-remove-prefix-and-suffix.patch76
-rw-r--r--vcpkg/ports/boost-cmake/CMakeLists.txt.in14
-rw-r--r--vcpkg/ports/boost-cmake/portfile.cmake34
-rw-r--r--vcpkg/ports/boost-cmake/usage4
-rw-r--r--vcpkg/ports/boost-cmake/vcpkg-port-config.cmake3
-rw-r--r--vcpkg/ports/boost-cmake/vcpkg.json18
7 files changed, 244 insertions, 0 deletions
diff --git a/vcpkg/ports/boost-cmake/0001-vcpkg-build.patch b/vcpkg/ports/boost-cmake/0001-vcpkg-build.patch
new file mode 100644
index 0000000..5164c7e
--- /dev/null
+++ b/vcpkg/ports/boost-cmake/0001-vcpkg-build.patch
@@ -0,0 +1,95 @@
+diff --git a/include/BoostRoot.cmake b/include/BoostRoot.cmake
+index 98a19df..5054d6c 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
+@@ -200,6 +200,8 @@ endfunction()
+ function(__boost_scan_dependencies lib var)
+
+ set(result "")
++ set(required_components "")
++ set(optional_components "")
+
+ if(EXISTS "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/${lib}/CMakeLists.txt")
+
+@@ -209,6 +211,13 @@ function(__boost_scan_dependencies lib var)
+
+ 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})
++
++ elseif(line MATCHES "^[ ]*\\$<TARGET_NAME_IF_EXISTS:Boost::([A-Za-z0-9_]+)>[ ]*$")
++
++ list(APPEND optional_components ${CMAKE_MATCH_1})
+ string(REGEX REPLACE "^numeric_" "numeric/" dep ${CMAKE_MATCH_1})
+ list(APPEND result ${dep})
+
+@@ -218,6 +227,12 @@ function(__boost_scan_dependencies lib var)
+
+ endif()
+
++ list(REMOVE_DUPLICATES required_components)
++ list(REMOVE_DUPLICATES optional_components)
++ list(REMOVE_ITEM required_components boost ${lib}) # due to property_tree and python
++ if(required_components OR optional_components)
++ find_package(Boost COMPONENTS ${required_components} OPTIONAL_COMPONENTS ${optional_components} REQUIRED CONFIG)
++ endif()
+ set(${var} ${result} PARENT_SCOPE)
+
+ endfunction()
+@@ -280,10 +295,10 @@ 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})
+@@ -429,33 +444,3 @@ if(CMAKE_SKIP_INSTALL_RULES)
+ return()
+
+ endif()
+-
+-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)
+-
+-else()
+-
+- set(OLD_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
+- set(CMAKE_SIZEOF_VOID_P "")
+-
+- write_basic_package_version_file("${CONFIG_VERSION_FILE_NAME}" COMPATIBILITY SameMajorVersion)
+-
+- set(CMAKE_SIZEOF_VOID_P ${OLD_CMAKE_SIZEOF_VOID_P})
+-
+-endif()
+-
+-install(FILES "${CONFIG_VERSION_FILE_NAME}" DESTINATION "${CONFIG_INSTALL_DIR}")
+-
+-set(CPACK_PACKAGE_VENDOR "Boost")
+-set(CPACK_GENERATOR "TGZ")
+-set(CPACK_RESOURCE_FILE_LICENSE "${Boost_SOURCE_DIR}/LICENSE_1_0.txt")
+-set(CPACK_RESOURCE_FILE_README "${Boost_SOURCE_DIR}/README.md")
+-include(CPack)
diff --git a/vcpkg/ports/boost-cmake/0002-remove-prefix-and-suffix.patch b/vcpkg/ports/boost-cmake/0002-remove-prefix-and-suffix.patch
new file mode 100644
index 0000000..96559fe
--- /dev/null
+++ b/vcpkg/ports/boost-cmake/0002-remove-prefix-and-suffix.patch
@@ -0,0 +1,76 @@
+diff --git a/include/BoostInstall.cmake b/include/BoostInstall.cmake
+index 1127c6f..91d3a86 100644
+--- a/include/BoostInstall.cmake
++++ b/include/BoostInstall.cmake
+@@ -67,11 +67,6 @@ function(__boost_install_set_output_name LIB TYPE VERSION)
+ set(name_debug ${LIB})
+ set(name_release ${LIB})
+
+- # prefix
+- if(WIN32 AND TYPE STREQUAL "STATIC_LIBRARY")
+- set_target_properties(${LIB} PROPERTIES PREFIX "lib")
+- endif()
+-
+ # toolset
+ if(BOOST_INSTALL_LAYOUT STREQUAL versioned)
+
+@@ -289,14 +284,6 @@ function(boost_install_target)
+
+ set(CONFIG_INSTALL_DIR "${BOOST_INSTALL_CMAKEDIR}/${LIB}-${__VERSION}")
+
+- if(TYPE STREQUAL "SHARED_LIBRARY")
+- string(APPEND CONFIG_INSTALL_DIR "-shared")
+- endif()
+-
+- if(TYPE STREQUAL "STATIC_LIBRARY")
+- string(APPEND CONFIG_INSTALL_DIR "-static")
+- endif()
+-
+ install(TARGETS ${LIB} EXPORT ${LIB}-targets
+ # explicit destination specification required for 3.13, 3.14 no longer needs it
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+@@ -466,44 +453,6 @@ function(boost_install_target)
+
+ endif()
+
+- if("${LIB}" STREQUAL "boost_exception" OR "${LIB}" STREQUAL "boost_test_exec_monitor")
+-
+- # These two libraries are hardcoded to STATIC
+-
+- else()
+-
+- if(TYPE STREQUAL "SHARED_LIBRARY")
+-
+- file(APPEND "${CONFIG_VERSION_FILE_NAME}"
+-
+- "\n"
+- "# Do not return shared libraries when Boost_USE_STATIC_LIBS is ON\n"
+- "if(NOT PACKAGE_VERSION_UNSUITABLE AND Boost_USE_STATIC_LIBS)\n"
+- " set(PACKAGE_VERSION_UNSUITABLE TRUE)\n"
+- " set(PACKAGE_VERSION \"\${PACKAGE_VERSION} (shared)\")\n"
+- " return()\n"
+- "endif()\n"
+- )
+-
+- endif()
+-
+- if(TYPE STREQUAL "STATIC_LIBRARY")
+-
+- file(APPEND "${CONFIG_VERSION_FILE_NAME}"
+-
+- "\n"
+- "# Do not return static libraries when Boost_USE_STATIC_LIBS is OFF\n"
+- "if(NOT PACKAGE_VERSION_UNSUITABLE AND DEFINED Boost_USE_STATIC_LIBS AND NOT Boost_USE_STATIC_LIBS)\n"
+- " set(PACKAGE_VERSION_UNSUITABLE TRUE)\n"
+- " set(PACKAGE_VERSION \"\${PACKAGE_VERSION} (static)\")\n"
+- " return()\n"
+- "endif()\n"
+- )
+-
+- endif()
+-
+- endif()
+-
+ install(FILES "${CONFIG_VERSION_FILE_NAME}" DESTINATION "${CONFIG_INSTALL_DIR}")
+
+ endfunction()
diff --git a/vcpkg/ports/boost-cmake/CMakeLists.txt.in b/vcpkg/ports/boost-cmake/CMakeLists.txt.in
new file mode 100644
index 0000000..26cfac7
--- /dev/null
+++ b/vcpkg/ports/boost-cmake/CMakeLists.txt.in
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.21)
+
+include(CMakePackageConfigHelpers)
+
+project(Boost VERSION @SEMVER_VERSION@ LANGUAGES NONE)
+
+set(CONFIG_VERSION_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/tmpinst/BoostConfigVersion.cmake")
+
+write_basic_package_version_file("${CONFIG_VERSION_FILE_NAME}" COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)
+
+install(FILES
+ "${CONFIG_VERSION_FILE_NAME}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/config/BoostConfig.cmake"
+ DESTINATION "share/boost") \ No newline at end of file
diff --git a/vcpkg/ports/boost-cmake/portfile.cmake b/vcpkg/ports/boost-cmake/portfile.cmake
new file mode 100644
index 0000000..a3a9492
--- /dev/null
+++ b/vcpkg/ports/boost-cmake/portfile.cmake
@@ -0,0 +1,34 @@
+# Automatically generated by scripts/boost/generate-ports.ps1
+
+set(VCPKG_POLICY_CMAKE_HELPER_PORT enabled)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO boostorg/cmake
+ REF boost-${VERSION}
+ SHA512 dd17731fb03d634aa4751e5f36acd124d04eb71341c000df2a0f0b49d5bea0db50e54d1bf820e066a07a22fcaecc97dbe8caaf2883b6a2c1eb2b941938c67d25
+ HEAD_REF master
+ PATCHES
+ 0001-vcpkg-build.patch
+ 0002-remove-prefix-and-suffix.patch
+)
+
+# Beta builds contains a text in the version string
+string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" SEMVER_VERSION "${VERSION}")
+configure_file("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in" "${SOURCE_PATH}/CMakeLists.txt" @ONLY)
+
+vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
+vcpkg_cmake_install()
+
+file(INSTALL "${SOURCE_PATH}/include/" DESTINATION "${CURRENT_PACKAGES_DIR}/share/boost/cmake-build")
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+vcpkg_download_distfile(BOOST_LICENSE
+ URLS "https://raw.githubusercontent.com/boostorg/boost/refs/tags/boost-${VERSION}/LICENSE_1_0.txt"
+ FILENAME "boost-${VERSION}-LICENSE_1_0.txt"
+ SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8
+)
+vcpkg_install_copyright(FILE_LIST "${BOOST_LICENSE}")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
diff --git a/vcpkg/ports/boost-cmake/usage b/vcpkg/ports/boost-cmake/usage
new file mode 100644
index 0000000..d246f42
--- /dev/null
+++ b/vcpkg/ports/boost-cmake/usage
@@ -0,0 +1,4 @@
+All boost packages are compatible with built-in CMake targets of FindBoost.cmake:
+
+ find_package(Boost REQUIRED [COMPONENTS <libs>...])
+ target_link_libraries(main PRIVATE Boost::boost Boost::<lib1> Boost::<lib2> ...)
diff --git a/vcpkg/ports/boost-cmake/vcpkg-port-config.cmake b/vcpkg/ports/boost-cmake/vcpkg-port-config.cmake
new file mode 100644
index 0000000..2f67672
--- /dev/null
+++ b/vcpkg/ports/boost-cmake/vcpkg-port-config.cmake
@@ -0,0 +1,3 @@
+include_guard(GLOBAL)
+
+include("${CURRENT_HOST_INSTALLED_DIR}/share/vcpkg-boost/vcpkg-port-config.cmake")
diff --git a/vcpkg/ports/boost-cmake/vcpkg.json b/vcpkg/ports/boost-cmake/vcpkg.json
new file mode 100644
index 0000000..5e1c258
--- /dev/null
+++ b/vcpkg/ports/boost-cmake/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "$comment": "Automatically generated by scripts/boost/generate-ports.ps1",
+ "name": "boost-cmake",
+ "version": "1.89.0",
+ "description": "Boost cmake module",
+ "homepage": "https://github.com/boostorg/cmake",
+ "license": "BSL-1.0",
+ "dependencies": [
+ {
+ "name": "boost-uninstall",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "vcpkg-boost",
+ "host": true
+ }
+ ]
+}