Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdflib] new port #43138

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions ports/sdflib/add_export.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 86b6169..bf7f532 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,7 +59,7 @@ add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES} ${PUBLIC_HEA
${SDF_SOURCE_FILES} ${SDF_HEADER_FILES}
${UTILS_SOURCE_FILES} ${UTILS_HEADER_FILES})

-target_include_directories(${PROJECT_NAME} PUBLIC include/)
+target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/> $<INSTALL_INTERFACE:include>)
target_include_directories(${PROJECT_NAME} PRIVATE src/)

# Add shaders
@@ -236,3 +236,20 @@ if(SDFLIB_BUILD_DEBUG_APPS)
# target_link_libraries(ImageQueryTime PUBLIC ${PROJECT_NAME} CGAL::CGAL OpenVDB::openvdb)
target_link_libraries(ImageQueryTime PUBLIC ${PROJECT_NAME})
endif()
+
+install(TARGETS ${PROJECT_NAME} icg EXPORT unofficial-${PROJECT_NAME}Config
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+)
+
+install(EXPORT unofficial-${PROJECT_NAME}Config
+ NAMESPACE unofficial::${PROJECT_NAME}::
+ DESTINATION share/unofficial-sdflib
+)
+install(
+ DIRECTORY "include/" # Trailing slash is important to copy only the contents
+ DESTINATION include # Destination folder in the install directory
+ FILES_MATCHING
+ PATTERN "*.h" # Match header files
+)
diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt
index 1fa9fe7..d1f5014 100644
--- a/libs/CMakeLists.txt
+++ b/libs/CMakeLists.txt
@@ -139,7 +139,7 @@ if(SDFLIB_BUILD_APPS OR SDFLIB_BUILD_DEBUG_APPS)

# icg
add_library(icg INTERFACE)
-target_include_directories(icg INTERFACE InteractiveComputerGraphics)
+target_include_directories(icg INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/InteractiveComputerGraphics> $<INSTALL_INTERFACE:include>)

if(SDFLIB_BUILD_APPS OR SDFLIB_BUILD_DEBUG_APPS)
# glfw
37 changes: 37 additions & 0 deletions ports/sdflib/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO UPC-ViRVIG/SdfLib
REF c32eb7b133f8c05fee5605499b7f5bd36039dd08
SHA512 86c4aeb66da3f59c4110abd96ac659aadddb8f67eacb0c7a5557e3741aeb56c8f5ef464c0d7fbe5853c86b523198dd2876e87473e3903ba00e03e489684ae06f
PATCHES
add_export.patch
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DSDFLIB_USE_ASSIMP=OFF
-DSDFLIB_USE_OPENMP=OFF
-DSDFLIB_USE_ENOKI=OFF
-DSDFLIB_USE_SYSTEM_GLM=ON
-DSDFLIB_USE_SYSTEM_SPDLOG=ON
-DSDFLIB_USE_SYSTEM_CEREAL=ON
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-sdflib CONFIG_PATH share/unofficial-sdflib)

file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-sdflib/unofficial-SdfLibConfig.cmake" SDFLIB_CONFIG)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-sdflib/unofficial-SdfLibConfig.cmake" "
include(CMakeFindDependencyMacro)
find_dependency(glm CONFIG)
find_dependency(spdlog CONFIG)
find_dependency(cereal CONFIG)
${SDFLIB_CONFIG}
")

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
talregev marked this conversation as resolved.
Show resolved Hide resolved

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
20 changes: 20 additions & 0 deletions ports/sdflib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "sdflib",
"version-date": "2024-09-06",
"description": "Library for accelerating the queries of signed distance fields from triangle meshes.",
"homepage": "https://github.com/UPC-ViRVIG/SdfLib",
"license": "MIT",
"dependencies": [
"cereal",
"glm",
"spdlog",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8212,6 +8212,10 @@
"baseline": "2.1.0",
"port-version": 0
},
"sdflib": {
"baseline": "2024-09-06",
"port-version": 0
},
"sdformat10": {
"baseline": "10.0.0",
"port-version": 5
Expand Down
9 changes: 9 additions & 0 deletions versions/s-/sdflib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "8f8433aa1d7a084cd525c5bf86a4463164a20c65",
"version-date": "2024-09-06",
"port-version": 0
}
]
}