Skip to content
46 changes: 46 additions & 0 deletions ports/ntuples/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@


vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO RPeschke/ntuples
REF v0.1.2

SHA512 0cd390e79640f0b03b5ac7b58ab52996a0a69f13cd52b404acf06601c2cf5788fe6ef8c082c35ed734fa4094a0b9543a6c07a1f6deaffd8a69475abbae7268dc
)

# 1) Install headers (copy contents of core/include into <pkg>/include)
file(INSTALL "${SOURCE_PATH}/core/include/" DESTINATION "${CURRENT_PACKAGES_DIR}/include")

# 2) Install a relocatable CMake config so find_package(ntuples CONFIG) works
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/ntuples")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/ntuples/ntuples-config.cmake" "
if (TARGET ntuples::ntuples)
return()
endif()
get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}/../..\" ABSOLUTE)
add_library(ntuples INTERFACE)
add_library(ntuples::ntuples ALIAS ntuples)
target_include_directories(ntuples INTERFACE \"\${_IMPORT_PREFIX}/include\")
target_compile_features(ntuples INTERFACE cxx_std_20)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
target_compile_features(ntuples INTERFACE cxx_std_20)
target_compile_features(ntuples INTERFACE cxx_std_17)

https://github.com/RPeschke/ntuples/blob/e3b124f148678fa3cfa2780579948a62df7da23e/CMakeLists.txt#L28

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I am sorry but it will not compile with c++17

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry but it will not compile with c++17

I see, in that case upstream should be fixed so that we aren't randomly doing something different than upstream. (Doesn't mean upstream needs to change before we would merge this, just that we would want upstream's approval before doing something different)

I made the original comment and pushed the change without realizing that you were also the upstream maintainer 😅. You should probably fix that and remove the attempt to set CMAKE_CXX_STANDARD.

")


vcpkg_install_copyright(FILE_LIST
"${SOURCE_PATH}/LICENSE" "${SOURCE_PATH}/LICENSE.txt"
)

# 4) Clean (harmless for header-only, keeps CI quiet)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")


file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/ntuples")


file(WRITE "${CURRENT_PACKAGES_DIR}/share/ntuples/usage"
"ntuples is header-only.\n
\n
CMake:\n
find_package(ntuples CONFIG REQUIRED)\n
target_link_libraries(<your-target> PRIVATE ntuples::ntuples)\n"
)
11 changes: 11 additions & 0 deletions ports/ntuples/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "ntuples",
"version": "0.1.2",
"description": "A C++ ntuple library for structured data storage and processing",
"homepage": "https://github.com/RPeschke/ntuples",
"license": "MIT",
"dependencies": [
"vcpkg-cmake",
"vcpkg-cmake-config"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be host dependencies.

]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6788,6 +6788,10 @@
"baseline": "2.5.4",
"port-version": 0
},
"ntuples": {
"baseline": "0.1.2",
"port-version": 0
},
"nu-book-zxing-cpp": {
"baseline": "2.3.0",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/n-/ntuples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "5527c55fa416fa094102fc108ce0157d5fc062c4",
"version": "0.1.2",
"port-version": 0
}
]
}