diff options
| author | Pablo Speciale <pablospe@users.noreply.github.com> | 2020-08-07 07:15:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-06 22:15:45 -0700 |
| commit | 6289ef0d499151e4ef53c72ce52008b23778b3e9 (patch) | |
| tree | bcb9bea541a723aa48a68b1db9c2bd3f60b39976 | |
| parent | accd1c870cf0bad5be8be0d753f90bdac660c89c (diff) | |
| download | vcpkg-6289ef0d499151e4ef53c72ce52008b23778b3e9.tar.gz vcpkg-6289ef0d499151e4ef53c72ce52008b23778b3e9.zip | |
[colmap] Add port for COLMAP 3.6 (#12410)
* [colmap] Add port for COLMAP 3.6-dev.3
* Fixed some errors in portfile
* Fixing some errors in portfile. These changes also move the binary (and *.bat) to `tools/` otherwise I get `POST_BUILD_CHECKS_FAILED`. I followed this recommendation:
https://github.com/Microsoft/vcpkg/issues/834#issuecomment-288529839
Now the *.bat files need to be fixed with the correct path to `tools/`
* Update ports/colmap/portfile.cmake
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
* Update ports/colmap/portfile.cmake
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
* Update ports/colmap/usage
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
* First working version, the line `vcpkg_copy_tools(TOOL_NAMES colmap AUTO_CLEAN)` helped.
Now it does work running:
> <vcpkg-root>\vcpkg\packages\colmap_x64-windows\tools\colmap\colmap.exe
> <vcpkg-root>\vcpkg\packages\colmap_x64-windows\tools\colmap\colmap.exe gui
ToDo: use `vcpkg.json`.
* Using `vcpkg.json` instead of CONTROL file
* Formatting json file:
./vcpkg.exe x-format-manifest --all
* Changes suggested by @ahojnnes (colmap author). Waiting for the 3.7 release (probably today) to update the `REF` and `SHA512`
* Changes proposed from @ahojnne to handle the internal colmap variables `DGIT_COMMIT_ID` and `DGIT_COMMIT_DATE`
* Enabling TESTS (changes sent by @ahojnnes)
* Updated to lastest tag to 3.6
* Updating to 3.6
* Ceres was missing suitesparse/lapack
* Update ports/colmap/portfile.cmake (commit suggested by JackBoosY)
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
* format manifest
* Update ports/colmap/portfile.cmake
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
| -rw-r--r-- | ports/colmap/portfile.cmake | 89 | ||||
| -rw-r--r-- | ports/colmap/usage | 10 | ||||
| -rw-r--r-- | ports/colmap/vcpkg.json | 55 |
3 files changed, 154 insertions, 0 deletions
diff --git a/ports/colmap/portfile.cmake b/ports/colmap/portfile.cmake new file mode 100644 index 000000000..6b9bf3284 --- /dev/null +++ b/ports/colmap/portfile.cmake @@ -0,0 +1,89 @@ +set(COLMAP_REF "3.6") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO colmap/colmap + REF ${COLMAP_REF} + SHA512 9a4b4f2a49891ce8ac32ab1f2e9b859336326bada889e6de49c017a069884bb6c8ab8a2ae430d955e58fc22377c63e8fba9ce80ff959713e2878e29814d44632 + HEAD_REF dev +) + +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}") +else() + set(GIT_COMMIT_ID "${COLMAP_REF}") +endif() + +string(TIMESTAMP COLMAP_GIT_COMMIT_DATE "%Y-%m-%d") + +set(CUDA_ENABLED OFF) +set(TESTS_ENABLED OFF) + +if("cuda" IN_LIST FEATURES) + set(CUDA_ENABLED ON) +endif() + +if("cuda-redist" IN_LIST FEATURES) + set(CUDA_ENABLED ON) + set(CUDA_ARCHS "Common") +endif() + +if("tests" IN_LIST FEATURES) + set(TESTS_ENABLED ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DCUDA_ENABLED=${CUDA_ENABLED} + -DCUDA_ARCHS=${CUDA_ARCHS} + -DTESTS_ENABLED=${TESTS_ENABLED} + -DGIT_COMMIT_ID=${GIT_COMMIT_ID} + -DGIT_COMMIT_DATE=${COLMAP_GIT_COMMIT_DATE} +) + +vcpkg_install_cmake() + +vcpkg_fixup_cmake_targets() + +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}/debug/include/colmap/exe + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/lib/Graclus/multilevelLib + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/tools + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/media + ${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/shaders + ${CURRENT_PACKAGES_DIR}/include/colmap/exe + ${CURRENT_PACKAGES_DIR}/include/colmap/lib/Graclus/multilevelLib + ${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() + +file(INSTALL ${SOURCE_PATH}/COPYING.txt + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright +) diff --git a/ports/colmap/usage b/ports/colmap/usage new file mode 100644 index 000000000..b71316b3c --- /dev/null +++ b/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_LIBRARIES}) diff --git a/ports/colmap/vcpkg.json b/ports/colmap/vcpkg.json new file mode 100644 index 000000000..565e945ba --- /dev/null +++ b/ports/colmap/vcpkg.json @@ -0,0 +1,55 @@ +{ + "name": "colmap", + "version-string": "3.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", + "dependencies": [ + "boost-filesystem", + "boost-graph", + "boost-program-options", + "boost-regex", + "boost-system", + "boost-test", + { + "name": "ceres", + "features": [ + "lapack", + "suitesparse" + ] + }, + { + "name": "cgal", + "features": [ + "qt" + ] + }, + "eigen3", + "freeimage", + "gflags", + "glew", + "glog", + "qt5-base", + "suitesparse" + ], + "features": [ + { + "name": "cuda", + "description": "CUDA support for current compute architecture of this machine.", + "dependencies": [ + "cuda" + ] + }, + { + "name": "cuda-redist", + "description": "Redistributable CUDA support for common supported compute architectures.", + "dependencies": [ + "cuda" + ] + }, + { + "name": "tests", + "description": "Enable TESTS." + } + ] +} |
