aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/geogram
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/geogram
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/geogram')
-rw-r--r--vcpkg/ports/geogram/Config.cmake.in4
-rw-r--r--vcpkg/ports/geogram/fix-vcpkg-install.patch224
-rw-r--r--vcpkg/ports/geogram/portfile.cmake131
-rw-r--r--vcpkg/ports/geogram/vcpkg.json28
4 files changed, 387 insertions, 0 deletions
diff --git a/vcpkg/ports/geogram/Config.cmake.in b/vcpkg/ports/geogram/Config.cmake.in
new file mode 100644
index 0000000..7280872
--- /dev/null
+++ b/vcpkg/ports/geogram/Config.cmake.in
@@ -0,0 +1,4 @@
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
+check_required_components("@PROJECT_NAME@") \ No newline at end of file
diff --git a/vcpkg/ports/geogram/fix-vcpkg-install.patch b/vcpkg/ports/geogram/fix-vcpkg-install.patch
new file mode 100644
index 0000000..09cb877
--- /dev/null
+++ b/vcpkg/ports/geogram/fix-vcpkg-install.patch
@@ -0,0 +1,224 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6934fca..c2f855d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -68,7 +68,7 @@ set(GEOGRAM_INSTALL_PKGCONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig CACHE PATH "
+ set(GEOGRAM_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/modules CACHE PATH "CMake file install destination")
+
+
+-set(VORPALINE_INCLUDE_SUBPATH geogram${VORPALINE_VERSION_MAJOR})
++set(VORPALINE_INCLUDE_SUBPATH ./)
+
+ # Determine the current Build-OS (Build-platform without the compiler info)
+ string(REGEX REPLACE "-[^-]+$" "" VORPALINE_OS ${VORPALINE_PLATFORM})
+@@ -130,6 +130,7 @@ endif()
+ add_subdirectory(src/lib/third_party)
+
+ if(GEOGRAM_WITH_GRAPHICS)
++find_package(GLFW3 REQUIRED)
+ add_subdirectory(src/lib/geogram_gfx)
+ endif()
+
+@@ -160,7 +161,44 @@ file(REMOVE ${CMAKE_BINARY_DIR}/doc/LICENSE.txt)
+
+ # FindGeogram.cmake
+
+-install(FILES cmake/FindGeogram.cmake DESTINATION ${GEOGRAM_INSTALL_CMAKE_DIR} COMPONENT devkit)
++# This installation is not suitable for vcpkg
++# install(FILES cmake/FindGeogram.cmake DESTINATION lib/cmake/modules COMPONENT devkit)
++
++set(config_install_dir "share/geogram")
++set(include_install_dir "include")
++set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
++
++# Configuration
++set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
++set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
++set(targets_export_name "${PROJECT_NAME}Targets")
++set(namespace "${PROJECT_NAME}::")
++
++# Include module with fuction 'write_basic_package_version_file'
++include(CMakePackageConfigHelpers)
++
++write_basic_package_version_file(
++ "${version_config}" COMPATIBILITY SameMajorVersion VERSION ${VORPALINE_VERSION}
++)
++
++configure_package_config_file(
++ "cmake/Config.cmake.in"
++ "${project_config}"
++ INSTALL_DESTINATION "${config_install_dir}"
++)
++
++# Config
++install(
++ FILES "${project_config}" "${version_config}"
++ DESTINATION "${config_install_dir}"
++)
++
++# Config
++install(
++ EXPORT "${targets_export_name}"
++ NAMESPACE "${namespace}"
++ DESTINATION "${config_install_dir}"
++)
+
+ # Configure CPack
+
+diff --git a/src/lib/geogram/CMakeLists.txt b/src/lib/geogram/CMakeLists.txt
+index d50b3d2..41ec3e4 100644
+--- a/src/lib/geogram/CMakeLists.txt
++++ b/src/lib/geogram/CMakeLists.txt
+@@ -69,7 +69,7 @@ endif()
+ # path for targets that depend on geogram.
+ # See: https://cmake.org/cmake/help/v3.3/command/target_include_directories.html
+ # https://stackoverflow.com/questions/26243169/cmake-target-include-directories-meaning-of-scope
+-target_include_directories(geogram PUBLIC ${PROJECT_SOURCE_DIR}/src/lib)
++target_include_directories(geogram PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/lib>)
+
+ if(ANDROID)
+ target_include_directories(geogram PRIVATE
+@@ -78,6 +78,9 @@ ${ANDROID_NDK}/sources/android/native_app_glue
+ message(STATUS "building for Android")
+ endif()
+
++if(WIN32 AND VORPALINE_BUILD_DYNAMIC)
++ target_compile_definitions(geogram PUBLIC GEO_DYNAMIC_LIBS)
++endif()
+
+ set_target_properties(geogram PROPERTIES
+ VERSION ${VORPALINE_VERSION}
+@@ -101,7 +104,14 @@ target_link_libraries(geogram ${GEOGRAMPLUS_LIBS})
+ endif()
+
+ # Install the library
+-install_devkit_targets(geogram)
++install(
++ TARGETS geogram
++ EXPORT "${PROJECT_NAME}Targets"
++ LIBRARY DESTINATION "lib"
++ ARCHIVE DESTINATION "lib"
++ RUNTIME DESTINATION "bin"
++ INCLUDES DESTINATION "include"
++)
+
+ # Install include files for the standard devkit
+ install(
+diff --git a/src/lib/geogram_gfx/CMakeLists.txt b/src/lib/geogram_gfx/CMakeLists.txt
+index 391e607..13b6bcb 100644
+--- a/src/lib/geogram_gfx/CMakeLists.txt
++++ b/src/lib/geogram_gfx/CMakeLists.txt
+@@ -52,14 +52,21 @@ target_link_libraries(geogram_gfx ${OPENGL_LIBRARIES})
+ endif()
+
+ # Install the library
+-install_devkit_targets(geogram_gfx)
++install(
++ TARGETS geogram_gfx
++ EXPORT "${PROJECT_NAME}Targets"
++ LIBRARY DESTINATION "lib"
++ ARCHIVE DESTINATION "lib"
++ RUNTIME DESTINATION "bin"
++ INCLUDES DESTINATION "include"
++)
+
+ # Install include files for the standard devkit
+ install(
+ DIRECTORY .
+ DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx
+ COMPONENT devkit
+-FILES_MATCHING PATTERN *.h
++FILES_MATCHING PATTERN *.h PATTERN *.xpm # xpm is the colrbar file
+ )
+
+ # Install include files for the full devkit
+@@ -67,7 +74,7 @@ install(
+ DIRECTORY .
+ DESTINATION include/${VORPALINE_INCLUDE_SUBPATH}/geogram_gfx
+ COMPONENT devkit-full
+-FILES_MATCHING PATTERN *.h
++FILES_MATCHING PATTERN *.h PATTERN *.xpm # xpm is the colrbar file
+ )
+
+ install(
+diff --git a/src/lib/third_party/numerics/CMakeLists.txt b/src/lib/third_party/numerics/CMakeLists.txt
+index 5faf2fa..33c9bdd 100644
+--- a/src/lib/third_party/numerics/CMakeLists.txt
++++ b/src/lib/third_party/numerics/CMakeLists.txt
+@@ -14,10 +14,11 @@ endif()
+
+ include_directories(${GEOGRAM_SOURCE_DIR}/src/lib/third_party/numerics/INCLUDE)
+
++set(LAPACK_lapack_WORKS TRUE)
++find_package(BLAS REQUIRED)
++find_package(LAPACK REQUIRED)
+ aux_source_directories(SOURCES "Source Files" .)
+ aux_source_directories(SOURCES "Source Files\\LIBF2C" LIBF2C)
+-aux_source_directories(SOURCES "Source Files\\CBLAS" CBLAS)
+-aux_source_directories(SOURCES "Source Files\\CLAPACK" CLAPACK)
+ aux_source_directories(SOURCES "Source Files\\SUPERLU" SUPERLU)
+ aux_source_directories(SOURCES "Source Files\\ARPACK" ARPACK)
+ aux_source_directories(SOURCES "Source Files\\ARPACK_UTIL" ARPACK_UTIL)
+@@ -28,6 +29,7 @@ list(REMOVE_ITEM SOURCES "LIBF2C/system_.c")
+
+ add_library(geogram_num_3rdparty ${SOURCES})
+
++target_link_libraries(geogram_num_3rdparty ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
+ if(UNIX)
+ target_link_libraries(geogram_num_3rdparty m)
+ endif()
+diff --git a/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c b/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
+index 2b69a1e..a4b4c55 100644
+--- a/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
++++ b/src/lib/third_party/numerics/LIBF2C/libf2c_getarg_.c
+@@ -17,20 +17,21 @@ VOID getarg_(n, s, ls) ftnint *n; char *s; ftnlen ls;
+ void getarg_(ftnint *n, char *s, ftnlen ls)
+ #endif
+ {
+- extern int xargc;
+- extern char **xargv;
+- Const char *t;
+- int i;
++ // extern int xargc;
++ // extern char **xargv;
++ // Const char *t;
++ // int i;
+
+- if(*n>=0 && *n<xargc)
+- t = xargv[*n];
+- else
+- t = "";
+- for(i = 0; i<ls && *t!='\0' ; ++i)
+- *s++ = *t++;
+- for( ; i<ls ; ++i)
+- *s++ = ' ';
+- }
++ // if(*n>=0 && *n<xargc)
++ // t = xargv[*n];
++ // else
++ // t = "";
++ // for(i = 0; i<ls && *t!='\0' ; ++i)
++ // *s++ = *t++;
++ // for( ; i<ls ; ++i)
++ // *s++ = ' ';
++ // }
++}
+ #ifdef __cplusplus
+ }
+ #endif
+diff --git a/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c b/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
+index 2f29da0..48dfd9f 100644
+--- a/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
++++ b/src/lib/third_party/numerics/LIBF2C/libf2c_iargc_.c
+@@ -9,8 +9,9 @@ ftnint iargc_()
+ ftnint iargc_(void)
+ #endif
+ {
+-extern int xargc;
+-return ( xargc - 1 );
++// extern int xargc;
++// return ( xargc - 1 );
++ return -1;
+ }
+ #ifdef __cplusplus
+ }
diff --git a/vcpkg/ports/geogram/portfile.cmake b/vcpkg/ports/geogram/portfile.cmake
new file mode 100644
index 0000000..8f93032
--- /dev/null
+++ b/vcpkg/ports/geogram/portfile.cmake
@@ -0,0 +1,131 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO BrunoLevy/geogram
+ REF "v${VERSION}"
+ SHA512 19cf5720496172a144b2c5725a0a9763fde730ee14af75d92598973ff84106619e564d34746fd7b3da7d56f0cf52654fa656e3228fb32c0897f3aba178421f28
+ PATCHES
+ fix-vcpkg-install.patch
+)
+
+#third_party: amgcl
+vcpkg_from_github(
+ OUT_SOURCE_PATH AMGCL_SOURCE_PATH
+ REPO ddemidov/amgcl
+ REF a705f0822a332e215c41bccbeb6a7d92e90c49f2
+ SHA512 09dda0eb318ee4cd74af9ea67d9fcdce8a4399ab08b08cd72e2c7de953ad584204402b932c2a3222b7c74b25934267230bbc333a377e25f87ad045087ace2000
+)
+
+#third_party: libMeshb
+vcpkg_from_github(
+ OUT_SOURCE_PATH LIBMESHB_SOURCE_PATH
+ REPO LoicMarechal/libMeshb
+ REF e3678731ef14497c720ee7017a14450eba2602d2
+ SHA512 5c8f25805ce02cb48600914893f24ecd2dcbb8226692d47089605ff99db8785781407ec9152e29b0c3bc44d16f6d893cd171e5337c3cb1861468da05471872b6
+)
+
+#third_party: rply
+vcpkg_from_github(
+ OUT_SOURCE_PATH RPLY_SOURCE_PATH
+ REPO diegonehab/rply
+ REF 4296cc91b5c8c26d4e7d7aac0cee2b194ffc5800
+ SHA512 b236279d3f0e6e1062703555415236183da31a9e40c49d478954586725f8dc6c0582aef0db7b605cb7967c3bd4a96d2fe8e6601cc56b8a1d53129a25efa7d1f2
+)
+
+file(REMOVE_RECURSE "${SOURCE_PATH}/src/lib/geogram/third_party/amgcl"
+ "${SOURCE_PATH}/src/lib/geogram/third_party/libMeshb"
+ "${SOURCE_PATH}/src/lib/geogram/third_party/rply")
+file(RENAME "${AMGCL_SOURCE_PATH}" "${SOURCE_PATH}/src/lib/geogram/third_party/amgcl")
+file(RENAME "${LIBMESHB_SOURCE_PATH}" "${SOURCE_PATH}/src/lib/geogram/third_party/libMeshb")
+file(RENAME "${RPLY_SOURCE_PATH}" "${SOURCE_PATH}/src/lib/geogram/third_party/rply")
+
+file(COPY "${CURRENT_PORT_DIR}/Config.cmake.in" DESTINATION "${SOURCE_PATH}/cmake")
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ "graphics" GEOGRAM_WITH_GRAPHICS
+)
+
+if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(VORPALINE_BUILD_DYNAMIC FALSE)
+ if (VCPKG_TARGET_IS_WINDOWS)
+ set(VORPALINE_PLATFORM Win-vs-generic)
+ endif()
+ if (VCPKG_CRT_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS)
+ message("geogram on Windows with CRT dynamic linkage only supports dynamic library linkage. Building dynamic.")
+ set(VCPKG_LIBRARY_LINKAGE dynamic)
+ set(VORPALINE_PLATFORM Win-vs-dynamic-generic)
+ endif()
+ if (VCPKG_TARGET_IS_LINUX)
+ message("geogram on Linux only supports dynamic library linkage. Building dynamic.")
+ set(VCPKG_LIBRARY_LINKAGE dynamic)
+ set(VORPALINE_PLATFORM Linux64-gcc-dynamic )
+ endif()
+ if (VCPKG_TARGET_IS_OSX)
+ message("geogram on Darwin only supports dynamic library linkage. Building dynamic.")
+ set(VCPKG_LIBRARY_LINKAGE dynamic)
+ set(VORPALINE_PLATFORM Darwin-clang-dynamic)
+ endif()
+else()
+ set(VORPALINE_BUILD_DYNAMIC TRUE)
+ if (VCPKG_TARGET_IS_WINDOWS)
+ set(VORPALINE_PLATFORM Win-vs-generic)
+ endif()
+ if (VCPKG_TARGET_IS_LINUX)
+ set(VORPALINE_PLATFORM Linux64-gcc-dynamic )
+ endif()
+ if (VCPKG_TARGET_IS_OSX)
+ set(VORPALINE_PLATFORM Darwin-clang-dynamic)
+ endif()
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ # Geogram cannot be built with ninja because it embeds $(Configuration) in some of the generated paths. These require MSBuild in order to be evaluated.
+ WINDOWS_USE_MSBUILD
+ OPTIONS
+ -DVORPALINE_BUILD_DYNAMIC=${VORPALINE_BUILD_DYNAMIC}
+ -DGEOGRAM_LIB_ONLY=ON
+ -DGEOGRAM_USE_SYSTEM_GLFW3=ON
+ -DVORPALINE_PLATFORM=${VORPALINE_PLATFORM}
+ -DGEOGRAM_WITH_VORPALINE=OFF
+ ${FEATURE_OPTIONS}
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup()
+
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/doc")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/doc")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+# Remove all empty directories.
+function(auto_clean dir)
+ file(GLOB entries "${dir}/*")
+ file(GLOB files LIST_DIRECTORIES false "${dir}/*")
+ foreach(entry IN LISTS entries)
+ if(entry IN_LIST files)
+ continue()
+ endif()
+ file(GLOB_RECURSE children "${entry}/*")
+ if(children)
+ auto_clean("${entry}")
+ else()
+ file(REMOVE_RECURSE "${entry}")
+ endif()
+ endforeach()
+endfunction()
+auto_clean("${CURRENT_PACKAGES_DIR}/include")
+
+vcpkg_replace_string(
+ "${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake"
+ [[INTERFACE_INCLUDE_DIRECTORIES "/src/lib;${_IMPORT_PREFIX}/include"]]
+ [[INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"]]
+ IGNORE_UNCHANGED
+)
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/doc/devkit/license.dox")
+
+vcpkg_fixup_pkgconfig()
diff --git a/vcpkg/ports/geogram/vcpkg.json b/vcpkg/ports/geogram/vcpkg.json
new file mode 100644
index 0000000..e893e59
--- /dev/null
+++ b/vcpkg/ports/geogram/vcpkg.json
@@ -0,0 +1,28 @@
+{
+ "name": "geogram",
+ "version": "1.9.3",
+ "description": "Geogram is a programming library of geometric algorithms.",
+ "homepage": "https://github.com/BrunoLevy/geogram",
+ "license": "BSD-3-Clause",
+ "supports": "!uwp",
+ "dependencies": [
+ "blas",
+ "lapack",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "graphics": {
+ "description": "Build viewers and geogram_gfx library.",
+ "dependencies": [
+ "glfw3"
+ ]
+ }
+ }
+}