[colmap] Fix LNK2019 in x64-windows-static triplet (#21937)

* [colmap] Fix LNK2019 in x64-windows-static triplet

* [libraw] Add find lcms2 in the cmake wrapper file

Co-authored-by: Cheney-Wang <v-xincwa@microsoft.com>
This commit is contained in:
Cheney Wang 2022-01-07 05:46:36 +08:00 committed by GitHub
parent e0ee67c88f
commit 9117f195fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 48 additions and 32 deletions

View File

@ -6,7 +6,8 @@ vcpkg_from_github(
REF ${COLMAP_REF} REF ${COLMAP_REF}
SHA512 9a4b4f2a49891ce8ac32ab1f2e9b859336326bada889e6de49c017a069884bb6c8ab8a2ae430d955e58fc22377c63e8fba9ce80ff959713e2878e29814d44632 SHA512 9a4b4f2a49891ce8ac32ab1f2e9b859336326bada889e6de49c017a069884bb6c8ab8a2ae430d955e58fc22377c63e8fba9ce80ff959713e2878e29814d44632
HEAD_REF dev HEAD_REF dev
PATCHES fix-dependency-freeimage.patch PATCHES
fix-dependency-freeimage.patch
) )
if (NOT TRIPLET_SYSTEM_ARCH STREQUAL "x64" AND ("cuda" IN_LIST FEATURES OR "cuda-redist" IN_LIST FEATURES)) if (NOT TRIPLET_SYSTEM_ARCH STREQUAL "x64" AND ("cuda" IN_LIST FEATURES OR "cuda-redist" IN_LIST FEATURES))
@ -38,9 +39,9 @@ if("tests" IN_LIST FEATURES)
set(TESTS_ENABLED ON) set(TESTS_ENABLED ON)
endif() endif()
vcpkg_configure_cmake( vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH "${SOURCE_PATH}"
PREFER_NINJA DISABLE_PARALLEL_CONFIGURE
OPTIONS OPTIONS
-DCUDA_ENABLED=${CUDA_ENABLED} -DCUDA_ENABLED=${CUDA_ENABLED}
-DCUDA_ARCHS=${CUDA_ARCHS} -DCUDA_ARCHS=${CUDA_ARCHS}
@ -49,9 +50,9 @@ vcpkg_configure_cmake(
-DGIT_COMMIT_DATE=${COLMAP_GIT_COMMIT_DATE} -DGIT_COMMIT_DATE=${COLMAP_GIT_COMMIT_DATE}
) )
vcpkg_install_cmake() vcpkg_cmake_install()
vcpkg_fixup_cmake_targets() vcpkg_cmake_config_fixup()
file(GLOB TOOL_FILENAMES "${CURRENT_PACKAGES_DIR}/bin/*") file(GLOB TOOL_FILENAMES "${CURRENT_PACKAGES_DIR}/bin/*")
foreach(TOOL_FILENAME ${TOOL_FILENAMES}) foreach(TOOL_FILENAME ${TOOL_FILENAMES})
@ -63,28 +64,20 @@ vcpkg_copy_tools(TOOL_NAMES ${COLMAP_TOOL_NAMES} AUTO_CLEAN)
# remove empty folders and unused files # remove empty folders and unused files
file(REMOVE_RECURSE file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include "${CURRENT_PACKAGES_DIR}/debug/include"
${CURRENT_PACKAGES_DIR}/debug/share "${CURRENT_PACKAGES_DIR}/debug/share"
${CURRENT_PACKAGES_DIR}/debug/include/colmap/exe "${CURRENT_PACKAGES_DIR}/include/colmap/exe"
${CURRENT_PACKAGES_DIR}/debug/include/colmap/lib/Graclus/multilevelLib "${CURRENT_PACKAGES_DIR}/include/colmap/lib/Graclus/multilevelLib"
${CURRENT_PACKAGES_DIR}/debug/include/colmap/tools "${CURRENT_PACKAGES_DIR}/include/colmap/tools"
${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/media "${CURRENT_PACKAGES_DIR}/include/colmap/ui/media"
${CURRENT_PACKAGES_DIR}/debug/include/colmap/ui/shaders "${CURRENT_PACKAGES_DIR}/include/colmap/ui/shaders"
${CURRENT_PACKAGES_DIR}/include/colmap/exe "${CURRENT_PACKAGES_DIR}/COLMAP.bat"
${CURRENT_PACKAGES_DIR}/include/colmap/lib/Graclus/multilevelLib "${CURRENT_PACKAGES_DIR}/RUN_TESTS.bat"
${CURRENT_PACKAGES_DIR}/include/colmap/tools "${CURRENT_PACKAGES_DIR}/debug/COLMAP.bat"
${CURRENT_PACKAGES_DIR}/include/colmap/ui/media "${CURRENT_PACKAGES_DIR}/debug/RUN_TESTS.bat"
${CURRENT_PACKAGES_DIR}/include/colmap/ui/shaders "${CURRENT_PACKAGES_DIR}/debug/bin"
${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_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/COPYING.txt file(INSTALL "${SOURCE_PATH}/COPYING.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
RENAME copyright
)

View File

@ -1,7 +1,7 @@
{ {
"name": "colmap", "name": "colmap",
"version-string": "3.6", "version-string": "3.6",
"port-version": 1, "port-version": 2,
"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.", "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/", "homepage": "https://colmap.github.io/",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
@ -31,7 +31,15 @@
"glew", "glew",
"glog", "glog",
"qt5-base", "qt5-base",
"suitesparse" "suitesparse",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
], ],
"features": { "features": {
"cuda": { "cuda": {

View File

@ -17,4 +17,9 @@ if (@VCPKG_LIBRARY_LINKAGE@ STREQUAL "static")
list(APPEND LibRaw_LIBRARIES ${JASPER_LIBRARIES}) list(APPEND LibRaw_LIBRARIES ${JASPER_LIBRARIES})
list(APPEND LibRaw_r_LIBRARIES ${JASPER_LIBRARIES}) list(APPEND LibRaw_r_LIBRARIES ${JASPER_LIBRARIES})
endif () endif ()
find_package(lcms2 CONFIG REQUIRED)
if (lcms2_FOUND)
list(APPEND LibRaw_LIBRARIES lcms2::lcms2)
list(APPEND LibRaw_r_LIBRARIES lcms2::lcms2)
endif ()
endif() endif()

View File

@ -1,7 +1,7 @@
{ {
"name": "libraw", "name": "libraw",
"version-string": "201903", "version-string": "201903",
"port-version": 6, "port-version": 7,
"description": "raw image decoder library", "description": "raw image decoder library",
"homepage": "https://www.libraw.org", "homepage": "https://www.libraw.org",
"dependencies": [ "dependencies": [

View File

@ -1462,7 +1462,7 @@
}, },
"colmap": { "colmap": {
"baseline": "3.6", "baseline": "3.6",
"port-version": 1 "port-version": 2
}, },
"comms": { "comms": {
"baseline": "3.4.0", "baseline": "3.4.0",
@ -3842,7 +3842,7 @@
}, },
"libraw": { "libraw": {
"baseline": "201903", "baseline": "201903",
"port-version": 6 "port-version": 7
}, },
"librdkafka": { "librdkafka": {
"baseline": "1.8.2", "baseline": "1.8.2",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "7d3a2a8f71b464856f91f3b8b7e2362ec27d6487",
"version-string": "3.6",
"port-version": 2
},
{ {
"git-tree": "1f88c10f0bc3819bae7c197375bba335106726f1", "git-tree": "1f88c10f0bc3819bae7c197375bba335106726f1",
"version-string": "3.6", "version-string": "3.6",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "aeb0a198c349fb336ad7cd710aeaf0b1017679a1",
"version-string": "201903",
"port-version": 7
},
{ {
"git-tree": "e05fbd81dbe6b44b09c9aae106f4dc7df708ce49", "git-tree": "e05fbd81dbe6b44b09c9aae106f4dc7df708ce49",
"version-string": "201903", "version-string": "201903",