diff --git a/SuperBuild/cmake/External-OpenCV.cmake b/SuperBuild/cmake/External-OpenCV.cmake index 293d788a..de4c0f39 100644 --- a/SuperBuild/cmake/External-OpenCV.cmake +++ b/SuperBuild/cmake/External-OpenCV.cmake @@ -36,7 +36,7 @@ ExternalProject_Add(${_proj_name} STAMP_DIR ${_SB_BINARY_DIR}/stamp #--Download step-------------- DOWNLOAD_DIR ${SB_DOWNLOAD_DIR} - URL https://github.com/opencv/opencv/archive/4.5.0.zip + URL https://github.com/opencv/opencv/archive/4.11.0.zip #--Update/Patch step---------- UPDATE_COMMAND "" #--Configure step------------- diff --git a/SuperBuild/cmake/External-OpenSfM.cmake b/SuperBuild/cmake/External-OpenSfM.cmake index f50c8e85..4423b256 100644 --- a/SuperBuild/cmake/External-OpenSfM.cmake +++ b/SuperBuild/cmake/External-OpenSfM.cmake @@ -5,7 +5,13 @@ ProcessorCount(nproc) set(EXTRA_INCLUDE_DIRS "") if(WIN32) - set(OpenCV_DIR "${SB_INSTALL_DIR}/x64/vc16/lib") + if (MSVC_TOOLSET_VERSION EQUAL 143) + set(OpenCV_DIR "${SB_INSTALL_DIR}/x64/vc17/lib") + elseif(MSVC_TOOLSET_VERSION EQUAL 142) + set(OpenCV_DIR "${SB_INSTALL_DIR}/x64/vc16/lib") + else() + message(FATAL_ERROR "Unsupported MSVC toolset version detected: ${MSVC_TOOLSET_VERSION}") + endif() set(BUILD_CMD ${CMAKE_COMMAND} --build "${SB_BUILD_DIR}/opensfm" --config "${CMAKE_BUILD_TYPE}") else() set(BUILD_CMD make "-j${nproc}") diff --git a/SuperBuild/cmake/External-PDALPython.cmake b/SuperBuild/cmake/External-PDALPython.cmake index 410b77bf..62847854 100644 --- a/SuperBuild/cmake/External-PDALPython.cmake +++ b/SuperBuild/cmake/External-PDALPython.cmake @@ -6,6 +6,12 @@ if (WIN32) -DPython3_NumPy_INCLUDE_DIRS=${PYTHON_HOME}/lib/site-packages/numpy/core/include) endif() +execute_process(COMMAND ${PYTHON_EXE_PATH} "-V" OUTPUT_VARIABLE PYTHON_VERSION) +string(STRIP ${PYTHON_VERSION} PYTHON_VERSION) +if(NOT (${PYTHON_VERSION} MATCHES "Python 3.8.1")) + message(FATAL_ERROR "Python 3.8.1 is bundled with ODM. To avoid version mismatches in built PDALPython libraries, please ensure this exact version is used during the build. Detected version: ${PYTHON_VERSION} (at ${PYTHON_EXE_PATH}).") +endif() + ExternalProject_Add(${_proj_name} DEPENDS pdal PREFIX ${_SB_BINARY_DIR} diff --git a/requirements.txt b/requirements.txt index dbfa3599..bf69f570 100644 --- a/requirements.txt +++ b/requirements.txt @@ -38,3 +38,4 @@ codem==0.24.0 trimesh==3.17.1 pandas==1.5.2 piexif==1.1.3 +python-dateutil==2.9.0 diff --git a/run.py b/run.py index ac9615ea..44d62aef 100755 --- a/run.py +++ b/run.py @@ -6,6 +6,9 @@ if sys.version_info.major < 3: print("Ups! ODM needs to run with Python 3. It seems you launched it with Python 2. Try using: python3 run.py ... ") sys.exit(1) +# Hack: early import cv2 because PIL init will break DLL loading. +import cv2 + import os from opendm import log from opendm import config