Skip to content

Commit

Permalink
Merge pull request #994 from alicevision/cmake/opengvModern
Browse files Browse the repository at this point in the history
[cmake] Use modern cmake to manage OpenGV
  • Loading branch information
fabiencastan authored Feb 24, 2021
2 parents 5335754 + f23f179 commit 47fef5a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 76 deletions.
11 changes: 3 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -620,20 +620,15 @@ set(ALICEVISION_HAVE_OPENGV 0)

if(ALICEVISION_BUILD_SFM)
if(NOT ALICEVISION_USE_OPENGV STREQUAL "OFF")
find_package(OpenGV)

if(OPENGV_FOUND)
find_package(opengv 1.0 CONFIG)
if(opengv_FOUND)
set(ALICEVISION_HAVE_OPENGV 1)
message(STATUS "OpenGV found.")
message(STATUS "OpenGV ${opengv_VERSION} found.")
elseif(ALICEVISION_USE_OPENGV STREQUAL "ON")
message(SEND_ERROR "Failed to find OpenGV.")
endif()
endif()

if(ALICEVISION_HAVE_OPENGV)
include_directories(${OPENGV_INCLUDE_DIR})
link_directories(${OPENGV_LIBRARY_DIR})
endif()
endif()

# ==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/aliceVision/localization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if(ALICEVISION_HAVE_CCTAG)
endif()

if(ALICEVISION_HAVE_OPENGV)
target_link_libraries(aliceVision_localization PRIVATE ${OPENGV_LIBRARY})
target_link_libraries(aliceVision_localization PRIVATE opengv)
endif()

# Unit tests
Expand Down
9 changes: 8 additions & 1 deletion src/cmake/AliceVisionConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,20 @@ if(ALICEVISION_HAVE_CCTAG)
find_dependency(CCTag 1.0.0)
endif()

# whether it is built with CCTags
# whether it is built with Popsift
set(ALICEVISION_HAVE_POPSIFT @ALICEVISION_HAVE_POPSIFT@)

if(ALICEVISION_HAVE_POPSIFT)
find_dependency(PopSift 1.0.0)
endif()

# whether it is built with OpenGV
set(ALICEVISION_HAVE_OPENGV @ALICEVISION_HAVE_OPENGV@)

if(ALICEVISION_HAVE_OPENGV)
find_dependency(opengv 1.0)
endif()

# whether it is built with OpenCV
set(ALICEVISION_HAVE_OPENCV @ALICEVISION_HAVE_OPENCV@)

Expand Down
66 changes: 0 additions & 66 deletions src/cmake/FindOpenGV.cmake

This file was deleted.

0 comments on commit 47fef5a

Please sign in to comment.