Skip to content

Commit

Permalink
[tobias-loew-flags] add new port (#41282)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayuehua authored Oct 15, 2024
1 parent f097a78 commit 9b44f14
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 0 deletions.
62 changes: 62 additions & 0 deletions ports/tobias-loew-flags/add-install-configuration.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 78d96ff..3215aca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,39 @@ endif()
##################################################
add_library(boost_flags INTERFACE)
#target_include_directories(boost_flags PUBLIC ${Boost_INCLUDE_DIRS})
-target_include_directories(boost_flags INTERFACE ${CMAKE_SOURCE_DIR}/include)
+target_include_directories(boost_flags
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:include>
+ )
+set_target_properties(boost_flags PROPERTIES
+ EXPORT_NAME flags
+)
+include(CMakePackageConfigHelpers)
+
+configure_package_config_file(
+ cmake/unofficial-tobias-loew-flags-config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake/unofficial-tobias-loew-flags-config.cmake"
+ INSTALL_DESTINATION share/unofficial-tobias-loew-flags/
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO)
+
+# Install.
+install(TARGETS boost_flags EXPORT unofficial-tobias-loew-flags)
+
+install(
+ EXPORT unofficial-tobias-loew-flags
+ NAMESPACE unofficial::tobias-loew-flags::
+ FILE unofficial-tobias-loew-flags-targets.cmake
+ DESTINATION share/unofficial-tobias-loew-flags/)
+
+install(DIRECTORY include/boost DESTINATION include)
+
+install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake/unofficial-tobias-loew-flags-config.cmake"
+ DESTINATION share/unofficial-tobias-loew-flags)
+
+if(0)
if (Boost_FOUND)
target_include_directories(boost_flags INTERFACE ${Boost_INCLUDE_DIRS})
endif()
@@ -79,4 +111,5 @@ endif()
# Subdirectories
##################################################
add_subdirectory(test)
+endif()
# add_subdirectory(example)
diff --git a/cmake/unofficial-tobias-loew-flags-config.cmake.in b/cmake/unofficial-tobias-loew-flags-config.cmake.in
new file mode 100644
index 0000000..9a784e1
--- /dev/null
+++ b/cmake/unofficial-tobias-loew-flags-config.cmake.in
@@ -0,0 +1,5 @@
+
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/unofficial-tobias-loew-flags-targets.cmake")
+
18 changes: 18 additions & 0 deletions ports/tobias-loew-flags/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO tobias-loew/flags
REF 7a3cb950b79e7ab596ae22da30fa685c70ef497b
SHA512 a7835c3508830c1e215c301588ca26be84a6e1ca6ed4bfb5a3225bb390bf0637ac368bd7214e56809b24f6ac26a9e6f9478adf03d8e9140c2bd430c88f1c8f26
HEAD_REF main
PATCHES add-install-configuration.patch
)

set(VCPKG_BUILD_TYPE release) # header-only

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_cmake_install()

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
13 changes: 13 additions & 0 deletions ports/tobias-loew-flags/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "tobias-loew-flags",
"version-date": "2024-09-10",
"description": "type-safe bitwise operations in C++, to be proposed for Boost",
"homepage": "https://tobias-loew.github.io/flags/doc/html/flags.html",
"license": "BSL-1.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9012,6 +9012,10 @@
"baseline": "2019-10-14",
"port-version": 1
},
"tobias-loew-flags": {
"baseline": "2024-09-10",
"port-version": 0
},
"toml11": {
"baseline": "4.2.0",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/t-/tobias-loew-flags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "2de8995b035f3c2fa68d55eaec02d657c835cfbd",
"version-date": "2024-09-10",
"port-version": 0
}
]
}

0 comments on commit 9b44f14

Please sign in to comment.