From ed7a5d72bd20142c0e3a675da54de0e4bec4816e Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Mon, 6 Jan 2025 22:20:17 +0200 Subject: [PATCH] add sdflib port Signed-off-by: Tal Regev --- ports/sdflib/add_export.patch | 47 +++++++++++++++++++++++++++++++++++ ports/sdflib/portfile.cmake | 28 +++++++++++++++++++++ ports/sdflib/vcpkg.json | 20 +++++++++++++++ versions/baseline.json | 4 +++ versions/s-/sdflib.json | 9 +++++++ 5 files changed, 108 insertions(+) create mode 100644 ports/sdflib/add_export.patch create mode 100644 ports/sdflib/portfile.cmake create mode 100644 ports/sdflib/vcpkg.json create mode 100644 versions/s-/sdflib.json diff --git a/ports/sdflib/add_export.patch b/ports/sdflib/add_export.patch new file mode 100644 index 00000000000000..bff2a86618f2b8 --- /dev/null +++ b/ports/sdflib/add_export.patch @@ -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 $ $) + 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 $ $) + + if(SDFLIB_BUILD_APPS OR SDFLIB_BUILD_DEBUG_APPS) + # glfw diff --git a/ports/sdflib/portfile.cmake b/ports/sdflib/portfile.cmake new file mode 100644 index 00000000000000..e06c6b94c348fe --- /dev/null +++ b/ports/sdflib/portfile.cmake @@ -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") diff --git a/ports/sdflib/vcpkg.json b/ports/sdflib/vcpkg.json new file mode 100644 index 00000000000000..52a8370f7848ce --- /dev/null +++ b/ports/sdflib/vcpkg.json @@ -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 + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index c517b3bd5fb398..e110ebc61c5bd0 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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 diff --git a/versions/s-/sdflib.json b/versions/s-/sdflib.json new file mode 100644 index 00000000000000..5c45ac4dc64c67 --- /dev/null +++ b/versions/s-/sdflib.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "25fc7289e4ff909a4e8dbcbb31f6747461fe4fc3", + "version-date": "2024-09-06", + "port-version": 0 + } + ] +}