Skip to content

Commit

Permalink
add sdflib port
Browse files Browse the repository at this point in the history
Signed-off-by: Tal Regev <[email protected]>
  • Loading branch information
talregev committed Jan 7, 2025
1 parent 65be701 commit ed7a5d7
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 0 deletions.
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 ${PROJECT_NAME}Config
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+)
+
+install(EXPORT ${PROJECT_NAME}Config
+ NAMESPACE ${PROJECT_NAME}::
+ DESTINATION share/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
28 changes: 28 additions & 0 deletions ports/sdflib/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

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": "25fc7289e4ff909a4e8dbcbb31f6747461fe4fc3",
"version-date": "2024-09-06",
"port-version": 0
}
]
}

0 comments on commit ed7a5d7

Please sign in to comment.