Skip to content

Commit

Permalink
Fix find_package logic for poselib in support of homebrew/vcpkg (colm…
Browse files Browse the repository at this point in the history
…ap#2971)

👋 add build patch to build against system poselib.

relates to Homebrew/homebrew-core#199371

---------

Signed-off-by: Rui Chen <[email protected]>
Co-authored-by: Johannes Schönberger <[email protected]>
  • Loading branch information
chenrui333 and ahojnnes authored Dec 2, 2024
1 parent e778be6 commit b0f3c6d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ set(COLMAP_EXPORT_LIBS
# Third-party.
colmap_poisson_recon
colmap_vlfeat
PoseLib
)
if(LSD_ENABLED)
list(APPEND COLMAP_EXPORT_LIBS
Expand All @@ -363,6 +362,9 @@ if(GPU_ENABLED)
colmap_sift_gpu
)
endif()
if(FETCH_POSELIB)
list(APPEND COLMAP_EXPORT_LIBS PoseLib)
endif()

# Add unified interface library target to export.
add_library(colmap INTERFACE)
Expand Down
4 changes: 4 additions & 0 deletions cmake/FindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ if(CGAL_FOUND)
list(APPEND COLMAP_LINK_DIRS ${CGAL_LIBRARIES_DIR})
endif()

if(NOT FETCH_POSELIB)
find_package(PoseLib ${COLMAP_FIND_TYPE})
endif()

set(COLMAP_LINK_DIRS ${Boost_LIBRARY_DIRS})

set(CUDA_MIN_VERSION "7.0")
Expand Down
2 changes: 2 additions & 0 deletions cmake/colmap-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ set(GUI_ENABLED @GUI_ENABLED@)

set(CGAL_ENABLED @CGAL_ENABLED@)

set(FETCH_POSELIB @FETCH_POSELIB@)

include(${PACKAGE_PREFIX_DIR}/share/colmap/colmap-targets.cmake)
include(${PACKAGE_PREFIX_DIR}/share/colmap/cmake/FindDependencies.cmake)
check_required_components(colmap)
Expand Down
2 changes: 0 additions & 2 deletions src/colmap/estimators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.


set(FOLDER_NAME "estimators")

COLMAP_ADD_LIBRARY(
Expand Down Expand Up @@ -66,7 +65,6 @@ COLMAP_ADD_LIBRARY(
colmap_optim
Eigen3::Eigen
Ceres::ceres
PRIVATE_LINK_LIBS
PoseLib::PoseLib
)

Expand Down
2 changes: 0 additions & 2 deletions src/thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ if(FETCH_POSELIB)
set(MARCH_NATIVE OFF CACHE BOOL "")
FetchContent_MakeAvailable(poselib)
message(STATUS "Configuring PoseLib... done")
else()
find_package(PoseLib REQUIRED)
endif()

set(CLANG_TIDY_EXE ${CLANG_TIDY_EXE_TEMP})

0 comments on commit b0f3c6d

Please sign in to comment.