diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/colmap | |
Diffstat (limited to 'vcpkg/ports/colmap')
| -rw-r--r-- | vcpkg/ports/colmap/no-glu.diff | 13 | ||||
| -rw-r--r-- | vcpkg/ports/colmap/portfile.cmake | 107 | ||||
| -rw-r--r-- | vcpkg/ports/colmap/usage | 10 | ||||
| -rw-r--r-- | vcpkg/ports/colmap/vcpkg.json | 75 |
4 files changed, 205 insertions, 0 deletions
diff --git a/vcpkg/ports/colmap/no-glu.diff b/vcpkg/ports/colmap/no-glu.diff new file mode 100644 index 0000000..44f1920 --- /dev/null +++ b/vcpkg/ports/colmap/no-glu.diff @@ -0,0 +1,13 @@ +diff --git a/src/thirdparty/SiftGPU/GlobalUtil.cpp b/src/thirdparty/SiftGPU/GlobalUtil.cpp +index e98ef6b..39435db 100644 +--- a/src/thirdparty/SiftGPU/GlobalUtil.cpp ++++ b/src/thirdparty/SiftGPU/GlobalUtil.cpp +@@ -137,7 +137,7 @@ void GlobalUtil::CheckErrorsGL(const char* location) + const char *errstr; + while (errnum = glGetError()) + { +- errstr = (const char *)(gluErrorString(errnum)); ++ errstr = nullptr; // just print errnum + if(errstr) { + std::cerr << errstr; + } diff --git a/vcpkg/ports/colmap/portfile.cmake b/vcpkg/ports/colmap/portfile.cmake new file mode 100644 index 0000000..622af9c --- /dev/null +++ b/vcpkg/ports/colmap/portfile.cmake @@ -0,0 +1,107 @@ +# Update both, literally. +set(COLMAP_REF 3.12.6 "4d5b60e19ad268072adaf1267d21fa38a9a828ca") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO colmap/colmap + REF "${VERSION}" + SHA512 718e4542a128fbe39dd36a5e2e6d013c201ef7e23d0f6f38acc10aa5f505185389d8c9b8a75f02846cac4fd426adb75250cc32d32d427496b275ad4632a05ddb + HEAD_REF main + PATCHES + no-glu.diff +) + +if (NOT TRIPLET_SYSTEM_ARCH STREQUAL "x64" AND ("cuda" IN_LIST FEATURES OR "cuda-redist" IN_LIST FEATURES)) + message(FATAL_ERROR "Feature cuda and cuda-redist require x64 triplet.") +endif() + +# set GIT_COMMIT_ID and GIT_COMMIT_DATE +if(DEFINED VCPKG_HEAD_VERSION) + set(GIT_COMMIT_ID "${VCPKG_HEAD_VERSION}") +elseif(NOT VERSION IN_LIST COLMAP_REF) + message(FATAL_ERROR "Version ${VERSION} missing in COLMAP_REF (${COLMAP_REF})") +else() + list(GET COLMAP_REF 1 GIT_COMMIT_ID) +endif() + +string(TIMESTAMP COLMAP_GIT_COMMIT_DATE "%Y-%m-%d") + +foreach(FEATURE ${FEATURE_OPTIONS}) + message(STATUS "${FEATURE}") +endforeach() + +set(CUDA_ENABLED OFF) +set(GUI_ENABLED OFF) +set(CGAL_ENABLED OFF) +set(OPENMP_ENABLED ON) + +if("cuda" IN_LIST FEATURES) + set(CUDA_ENABLED ON) + set(CUDA_ARCHITECTURES "native") +endif() + +if("cuda-redist" IN_LIST FEATURES) + set(CUDA_ENABLED ON) + set(CUDA_ARCHITECTURES "all-major") +endif() + +if("gui" IN_LIST FEATURES) + set(GUI_ENABLED ON) +endif() + +if("cgal" IN_LIST FEATURES) + set(CGAL_ENABLED ON) +endif() + +if (VCPKG_TARGET_IS_OSX AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm") + set(OPENMP_ENABLED OFF) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + DISABLE_PARALLEL_CONFIGURE + OPTIONS + -DCUDA_ENABLED=${CUDA_ENABLED} + -DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHITECTURES} + -DGUI_ENABLED=${GUI_ENABLED} + -DGIT_COMMIT_ID=${GIT_COMMIT_ID} + -DGIT_COMMIT_DATE=${COLMAP_GIT_COMMIT_DATE} + -DOPENMP_ENABLED=${OPENMP_ENABLED} + -DCGAL_ENABLED=${CGAL_ENABLED} + -DTESTS_ENABLED=OFF + -DFETCH_POSELIB=OFF + -DFETCH_FAISS=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup() + +file(GLOB TOOL_FILENAMES "${CURRENT_PACKAGES_DIR}/bin/*") +foreach(TOOL_FILENAME ${TOOL_FILENAMES}) + get_filename_component(TEST_TOOL_NAME ${TOOL_FILENAME} NAME_WLE) + list(APPEND COLMAP_TOOL_NAMES "${TEST_TOOL_NAME}") +endforeach() + +vcpkg_copy_tools(TOOL_NAMES ${COLMAP_TOOL_NAMES} AUTO_CLEAN) + +# remove empty folders and unused files +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/include/colmap/exe" + "${CURRENT_PACKAGES_DIR}/include/colmap/tools" + "${CURRENT_PACKAGES_DIR}/include/colmap/ui/media" + "${CURRENT_PACKAGES_DIR}/include/colmap/ui/shaders" + "${CURRENT_PACKAGES_DIR}/COLMAP.bat" + "${CURRENT_PACKAGES_DIR}/RUN_TESTS.bat" + "${CURRENT_PACKAGES_DIR}/debug/COLMAP.bat" + "${CURRENT_PACKAGES_DIR}/debug/RUN_TESTS.bat" + "${CURRENT_PACKAGES_DIR}/debug/bin" +) + +vcpkg_copy_pdbs() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.txt") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/vcpkg/ports/colmap/usage b/vcpkg/ports/colmap/usage new file mode 100644 index 0000000..75f9331 --- /dev/null +++ b/vcpkg/ports/colmap/usage @@ -0,0 +1,10 @@ +For example, under Windows, execute COLMAP as: + + <VCPKG-ROOT>\packages\colmap_<TRIPLET>\tools\colmap\colmap.exe gui + <VCPKG-ROOT>\packages\colmap_<TRIPLET>\tools\colmap\colmap.exe mapper + <VCPKG-ROOT>\packages\colmap_<TRIPLET>\tools\colmap\colmap.exe ... + +The package colmap provides CMake integration: + + find_package(COLMAP REQUIRED) + target_link_libraries(main colmap::colmap) diff --git a/vcpkg/ports/colmap/vcpkg.json b/vcpkg/ports/colmap/vcpkg.json new file mode 100644 index 0000000..a66e547 --- /dev/null +++ b/vcpkg/ports/colmap/vcpkg.json @@ -0,0 +1,75 @@ +{ + "name": "colmap", + "version": "3.12.6", + "description": "COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline with a graphical and command-line interface. It offers a wide range of features for reconstruction of ordered and unordered image collections. The software is licensed under the new BSD license.", + "homepage": "https://colmap.github.io/", + "license": "BSD-3-Clause", + "supports": "(linux | (windows & !static) | osx) & (x86 | x64 | arm64)", + "dependencies": [ + "boost-algorithm", + "boost-graph", + "boost-heap", + "boost-program-options", + "boost-property-map", + "boost-property-tree", + { + "name": "ceres", + "features": [ + "lapack", + "suitesparse" + ] + }, + "eigen3", + "faiss", + "freeimage", + "gflags", + "glog", + { + "name": "jasper", + "default-features": false + }, + "metis", + "poselib", + "sqlite3", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "gui" + ], + "features": { + "cgal": { + "description": "Build with CGAL.", + "dependencies": [ + "cgal" + ] + }, + "cuda": { + "description": "Build with CUDA.", + "dependencies": [ + "cuda", + "glew" + ] + }, + "cuda-redist": { + "description": "Redistributable CUDA support for common supported compute architectures.", + "dependencies": [ + "cuda", + "glew" + ] + }, + "gui": { + "description": "Build the GUI.", + "dependencies": [ + "glew", + "qt5-base" + ] + } + } +} |