Skip to content

Commit

Permalink
Update third-party: JLinkage and use FetchContent for it (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
B1ueber2y authored Nov 28, 2024
1 parent e890eba commit 6b5a6f0
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
[submodule "third-party/Hierarchical-Localization"]
path = third-party/Hierarchical-Localization
url = https://github.com/cvg/Hierarchical-Localization.git
[submodule "third-party/JLinkage"]
path = third-party/JLinkage
url = https://github.com/B1ueber2y/JLinkage
[submodule "third-party/RansacLib"]
path = third-party/RansacLib
url = https://github.com/B1ueber2y/RansacLib.git
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ option(INTERPOLATION_ENABLED "Whether to enable interpolation-based pixel-perfec
option(FETCH_POSELIB "Whether to use PoseLib with FetchContent or with self-installed software" ON)
option(FETCH_COLMAP "Whether to use COLMAP with FetchContent or with self-installed software" ON)
option(CUDA_ENABLED "Whether to use CUDA (only for the third-party COLMAP)" OFF)
option(FETCH_JLINKAGE "Whether to use JLinkage with FetchContent or with self-installed software" ON)

include(cmake/FindDependencies.cmake)
include(cmake/InitVariables.cmake)
Expand All @@ -41,7 +42,6 @@ link_directories(${LIMAP_LINK_DIRS})

# Add sources
add_subdirectory(third-party)
include_directories(${JLINKAGE_INCLUDE_DIRS})
include_directories(${RANSACLIB_INCLUDE_DIRS})
add_subdirectory(limap)

Expand Down
13 changes: 13 additions & 0 deletions cmake/FindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,16 @@ else()
endif()
message(STATUS "Configuring COLMAP... done")

# JLinkage
FetchContent_Declare(JLinkage
GIT_REPOSITORY https://github.com/B1ueber2y/JLinkage.git
GIT_TAG 452d67eda005db01a02071a5af8f0eced0a02079
EXCLUDE_FROM_ALL
)
message(STATUS "Configuring JLinkage...")
if (FETCH_JLINKAGE)
FetchContent_MakeAvailable(JLinkage)
else()
find_package(JLinkage REQUIRED)
endif()
message(STATUS "Configuring JLinkage... done")
7 changes: 6 additions & 1 deletion cmake/InitVariables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ else()
list(APPEND LIMAP_EXTERNAL_LIBRARIES PoseLib)
endif()

if(NOT FETCH_JLINKAGE)
list(APPEND LIMAP_EXTERNAL_LIBRARIES JLinkage::JLinkage)
else()
list(APPEND LIMAP_EXTERNAL_LIBRARIES JLinkage)
endif()

# Internal libraries
set(LIMAP_INTERNAL_LIBRARIES
HighFive
pybind11::module
JLinkage
igl::core
)

Expand Down
4 changes: 2 additions & 2 deletions limap/vplib/JLinkage/JLinkage.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "vplib/JLinkage/JLinkage.h"

#include <VPCluster.h>
#include <VPSample.h>
#include <JLinkage/include/VPCluster.h>
#include <JLinkage/include/VPSample.h>
#include <third-party/progressbar.hpp>

namespace limap {
Expand Down
1 change: 0 additions & 1 deletion third-party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
add_subdirectory(HighFive)
add_subdirectory(pybind11)
add_subdirectory(JLinkage)
add_subdirectory(libigl)
add_subdirectory(RansacLib)
2 changes: 1 addition & 1 deletion third-party/GlueStick
1 change: 0 additions & 1 deletion third-party/JLinkage
Submodule JLinkage deleted from 3787a8
2 changes: 1 addition & 1 deletion third-party/pytlsd

0 comments on commit 6b5a6f0

Please sign in to comment.