diff --git a/.gitmodules b/.gitmodules index 051e7c95..98e7cd09 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 740c1f8e..4df0d700 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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) diff --git a/cmake/FindDependencies.cmake b/cmake/FindDependencies.cmake index 17cef13c..539a7285 100644 --- a/cmake/FindDependencies.cmake +++ b/cmake/FindDependencies.cmake @@ -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") diff --git a/cmake/InitVariables.cmake b/cmake/InitVariables.cmake index 262830fd..d941e33c 100644 --- a/cmake/InitVariables.cmake +++ b/cmake/InitVariables.cmake @@ -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 ) diff --git a/limap/vplib/JLinkage/JLinkage.cc b/limap/vplib/JLinkage/JLinkage.cc index e8997736..118a0098 100644 --- a/limap/vplib/JLinkage/JLinkage.cc +++ b/limap/vplib/JLinkage/JLinkage.cc @@ -1,7 +1,7 @@ #include "vplib/JLinkage/JLinkage.h" -#include -#include +#include +#include #include namespace limap { diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 8e13161e..122e191d 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -1,5 +1,4 @@ add_subdirectory(HighFive) add_subdirectory(pybind11) -add_subdirectory(JLinkage) add_subdirectory(libigl) add_subdirectory(RansacLib) diff --git a/third-party/GlueStick b/third-party/GlueStick index 40d71d5f..0a6a1ae4 160000 --- a/third-party/GlueStick +++ b/third-party/GlueStick @@ -1 +1 @@ -Subproject commit 40d71d5f4adc7f4fccae4cd7675a49daee3e873e +Subproject commit 0a6a1ae4569164d8fd1e4d24755d4dec6d9d7d60 diff --git a/third-party/JLinkage b/third-party/JLinkage deleted file mode 160000 index 3787a84b..00000000 --- a/third-party/JLinkage +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3787a84b3bf1cf7ec6bd7cf0f243bf53740a2129 diff --git a/third-party/pytlsd b/third-party/pytlsd index 21381ca4..37ac5833 160000 --- a/third-party/pytlsd +++ b/third-party/pytlsd @@ -1 +1 @@ -Subproject commit 21381ca4c5c8da297ef44ce07dda115075c5a648 +Subproject commit 37ac583341cbca74c2bbb1e07b82e1447f7cdf5f