From 9542abbb9ae09d41a5c78ef3f6c56d725af634c8 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Tue, 16 Apr 2024 17:21:13 +0200 Subject: [PATCH 01/31] EXCLUDE_FROM_ALL goes into the FetchContent_Declare so that we can use MakeAvailable and let cmake do is thing --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 16 +++------------- cpp/kiss_icp/3rdparty/tbb/tbb.cmake | 16 +++------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index c17460e7..e350b58d 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -32,16 +32,6 @@ set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") include(FetchContent) -FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz) -if(NOT eigen_POPULATED) - FetchContent_Populate(eigen) - if(${CMAKE_VERSION} GREATER_EQUAL 3.25) - add_subdirectory(${eigen_SOURCE_DIR} ${eigen_BINARY_DIR} SYSTEM EXCLUDE_FROM_ALL) - else() - # Emulate the SYSTEM flag introduced in CMake 3.25. Withouth this flag the compiler will - # consider this 3rdparty headers as source code and fail due the -Werror flag. - add_subdirectory(${eigen_SOURCE_DIR} ${eigen_BINARY_DIR} EXCLUDE_FROM_ALL) - get_target_property(eigen_include_dirs eigen INTERFACE_INCLUDE_DIRECTORIES) - set_target_properties(eigen PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${eigen_include_dirs}") - endif() -endif() +FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz EXCLUDE_FROM_ALL + TRUE) +FetchContent_MakeAvailable(eigen) diff --git a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake index 64482ceb..25b298b5 100644 --- a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake +++ b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake @@ -28,16 +28,6 @@ option(TBB_STRICT OFF) option(TBB_TEST OFF) include(FetchContent) -FetchContent_Declare(tbb URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz) -if(NOT tbb_POPULATED) - FetchContent_Populate(tbb) - if(${CMAKE_VERSION} GREATER_EQUAL 3.25) - add_subdirectory(${tbb_SOURCE_DIR} ${tbb_BINARY_DIR} SYSTEM EXCLUDE_FROM_ALL) - else() - # Emulate the SYSTEM flag introduced in CMake 3.25. Withouth this flag the compiler will - # consider this 3rdparty headers as source code and fail due the -Werror flag. - add_subdirectory(${tbb_SOURCE_DIR} ${tbb_BINARY_DIR} EXCLUDE_FROM_ALL) - get_target_property(tbb_include_dirs tbb INTERFACE_INCLUDE_DIRECTORIES) - set_target_properties(tbb PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${tbb_include_dirs}") - endif() -endif() +FetchContent_Declare(tbb URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz EXCLUDE_FROM_ALL + TRUE) +FetchContent_MakeAvailable(tbb) From aedac45c306f59fe3ec661a26592e0f04ea67536 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Tue, 16 Apr 2024 17:45:00 +0200 Subject: [PATCH 02/31] Getting closer, now SYSTEM flag is not FetchContent_Declare --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 4 ++-- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 1 + cpp/kiss_icp/3rdparty/tbb/tbb.cmake | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index e350b58d..7902041f 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -31,7 +31,7 @@ set(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "Don't build Eigen pkg-config") set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") +set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL YES) include(FetchContent) -FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz EXCLUDE_FROM_ALL - TRUE) +FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz SYSTEM) FetchContent_MakeAvailable(eigen) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index c5524018..922f5150 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,6 +25,7 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") +# set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL YES) # TODO: after https://github.com/strasdat/Sophus/pull/502 gets merged go back to mainstream FetchContent_Declare(sophus SYSTEM URL https://github.com/nachovizzo/Sophus/archive/refs/tags/1.22.11.tar.gz) FetchContent_MakeAvailable(sophus) diff --git a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake index 25b298b5..66a8bb61 100644 --- a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake +++ b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake @@ -27,7 +27,7 @@ option(TBB_EXAMPLES OFF) option(TBB_STRICT OFF) option(TBB_TEST OFF) +set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL YES) include(FetchContent) -FetchContent_Declare(tbb URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz EXCLUDE_FROM_ALL - TRUE) +FetchContent_Declare(tbb URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz SYSTEM) FetchContent_MakeAvailable(tbb) From 45e1f4e3718452474788410af10613c14650ce93 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Tue, 16 Apr 2024 17:47:50 +0200 Subject: [PATCH 03/31] Now it should be done --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 4 ++-- cpp/kiss_icp/3rdparty/tbb/tbb.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index 7902041f..edc206fa 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -31,7 +31,7 @@ set(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "Don't build Eigen pkg-config") set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") -set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL YES) include(FetchContent) -FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz SYSTEM) +FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz EXCLUDE_FROM_ALL + SYSTEM) FetchContent_MakeAvailable(eigen) diff --git a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake index 66a8bb61..5ec8c657 100644 --- a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake +++ b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake @@ -27,7 +27,7 @@ option(TBB_EXAMPLES OFF) option(TBB_STRICT OFF) option(TBB_TEST OFF) -set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL YES) include(FetchContent) -FetchContent_Declare(tbb URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz SYSTEM) +FetchContent_Declare(tbb URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz EXCLUDE_FROM_ALL + SYSTEM) FetchContent_MakeAvailable(tbb) From faeba7a4e0dcb8567b2d80c2cae8075c0680c1e6 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Tue, 16 Apr 2024 17:50:38 +0200 Subject: [PATCH 04/31] Final cleaning --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 1 - cpp/kiss_icp/3rdparty/tbb/tbb.cmake | 1 - 2 files changed, 2 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 922f5150..c5524018 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,7 +25,6 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -# set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL YES) # TODO: after https://github.com/strasdat/Sophus/pull/502 gets merged go back to mainstream FetchContent_Declare(sophus SYSTEM URL https://github.com/nachovizzo/Sophus/archive/refs/tags/1.22.11.tar.gz) FetchContent_MakeAvailable(sophus) diff --git a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake index 5ec8c657..e007b533 100644 --- a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake +++ b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake @@ -20,7 +20,6 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# option(BUILD_SHARED_LIBS ON) option(BUILD_SHARED_LIBS OFF) option(TBBMALLOC_BUILD OFF) option(TBB_EXAMPLES OFF) From 4a5d1655b3873e32d27dcb14bac5c3a784cd0ba6 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Wed, 17 Apr 2024 09:40:57 +0200 Subject: [PATCH 05/31] TO BE REVERTED -> Remove personal repos --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 3 +-- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index edc206fa..cc56e043 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -32,6 +32,5 @@ set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") include(FetchContent) -FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz EXCLUDE_FROM_ALL - SYSTEM) +FetchContent_Declare(eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen GIT_TAG 3.4 EXCLUDE_FROM_ALL SYSTEM) FetchContent_MakeAvailable(eigen) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index c5524018..8f7eda7a 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,6 +25,5 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -# TODO: after https://github.com/strasdat/Sophus/pull/502 gets merged go back to mainstream -FetchContent_Declare(sophus SYSTEM URL https://github.com/nachovizzo/Sophus/archive/refs/tags/1.22.11.tar.gz) +FetchContent_Declare(sophus SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG 1.22.10) FetchContent_MakeAvailable(sophus) From 3215d298dde4df7a91c38076e71decb01eb610e8 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Wed, 17 Apr 2024 09:48:56 +0200 Subject: [PATCH 06/31] lets see if sophus got fixed, otherwise revert --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 8f7eda7a..80d490aa 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,5 +25,5 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -FetchContent_Declare(sophus SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG 1.22.10) +FetchContent_Declare(sophus SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG main-1.x) FetchContent_MakeAvailable(sophus) From 54386c43dc24e59f6d783e0106471b94811906b0 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Wed, 17 Apr 2024 09:58:32 +0200 Subject: [PATCH 07/31] Try again other ciao ciao --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 80d490aa..758cdf58 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,5 +25,5 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -FetchContent_Declare(sophus SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG main-1.x) +FetchContent_Declare(sophus SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG v1.0.0) FetchContent_MakeAvailable(sophus) From d44a092b89e4adbf68817ea4539d2a3bf99f6714 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Wed, 17 Apr 2024 10:01:49 +0200 Subject: [PATCH 08/31] Revert "TO BE REVERTED -> Remove personal repos" This reverts commit 4a5d1655b3873e32d27dcb14bac5c3a784cd0ba6. --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 3 ++- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index cc56e043..edc206fa 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -32,5 +32,6 @@ set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") include(FetchContent) -FetchContent_Declare(eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen GIT_TAG 3.4 EXCLUDE_FROM_ALL SYSTEM) +FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz EXCLUDE_FROM_ALL + SYSTEM) FetchContent_MakeAvailable(eigen) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 758cdf58..c5524018 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,5 +25,6 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -FetchContent_Declare(sophus SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG v1.0.0) +# TODO: after https://github.com/strasdat/Sophus/pull/502 gets merged go back to mainstream +FetchContent_Declare(sophus SYSTEM URL https://github.com/nachovizzo/Sophus/archive/refs/tags/1.22.11.tar.gz) FetchContent_MakeAvailable(sophus) From a1564818a29528450802b835ee511de5c60cee15 Mon Sep 17 00:00:00 2001 From: tizianoGuadagnino Date: Wed, 17 Apr 2024 09:40:57 +0200 Subject: [PATCH 09/31] TO BE REVERTED -> Remove personal repos --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 3 +-- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index edc206fa..cc56e043 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -32,6 +32,5 @@ set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") include(FetchContent) -FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz EXCLUDE_FROM_ALL - SYSTEM) +FetchContent_Declare(eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen GIT_TAG 3.4 EXCLUDE_FROM_ALL SYSTEM) FetchContent_MakeAvailable(eigen) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index c5524018..8f7eda7a 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,6 +25,5 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -# TODO: after https://github.com/strasdat/Sophus/pull/502 gets merged go back to mainstream -FetchContent_Declare(sophus SYSTEM URL https://github.com/nachovizzo/Sophus/archive/refs/tags/1.22.11.tar.gz) +FetchContent_Declare(sophus SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG 1.22.10) FetchContent_MakeAvailable(sophus) From 3b11a28eac667d957e1ca840ac9825fb88cd9684 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 10:21:26 +0200 Subject: [PATCH 10/31] Apply sophus patch --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 7 ++++++- cpp/kiss_icp/3rdparty/sophus/sophus.patch | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 cpp/kiss_icp/3rdparty/sophus/sophus.patch diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 8f7eda7a..220916a2 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,5 +25,10 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -FetchContent_Declare(sophus SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG 1.22.10) +FetchContent_Declare(sophus SYSTEM + GIT_REPOSITORY https://github.com/strasdat/Sophus.git + GIT_TAG 1.22.10 + PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/sophus.patch + UPDATE_DISCONNECTED 1 + ) FetchContent_MakeAvailable(sophus) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch new file mode 100644 index 00000000..588ece88 --- /dev/null +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.patch @@ -0,0 +1,13 @@ +diff --git a/sophus/common.hpp b/sophus/common.hpp +index 5634d35b..56a1b590 100644 +--- a/sophus/common.hpp ++++ b/sophus/common.hpp +@@ -18,7 +18,7 @@ + #define SOPHUS_FMT_CSTR(description, ...) description + #define SOPHUS_FMT_STR(description, ...) std::string(description) + #define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description) +-#define SOPHUS_FMT_ARG(arg) ++#define SOPHUS_FMT_ARG(arg) arg + + #else // !SOPHUS_USE_BASIC_LOGGING + From d1a491879f0f933b5f3052a9703a59294a960933 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 10:27:13 +0200 Subject: [PATCH 11/31] Format --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 220916a2..aef8a3cf 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,10 +25,12 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -FetchContent_Declare(sophus SYSTEM +FetchContent_Declare( + sophus + SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG 1.22.10 - PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/sophus.patch - UPDATE_DISCONNECTED 1 - ) + PATCH_COMMAND git apply ${CMAKE_CURRENT_SOURCE_DIR}/sophus.patch + UPDATE_DISCONNECTED 1) + FetchContent_MakeAvailable(sophus) From 8b932d6f0c724f1e70a8aebd35e8280d05d47305 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 10:28:54 +0200 Subject: [PATCH 12/31] Add back todo --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index aef8a3cf..0e4f8438 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,6 +25,7 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") +# TODO: Remove patch in case https://github.com/strasdat/Sophus/pull/502 gets merged FetchContent_Declare( sophus SYSTEM From 2009c5c9ca661926b3e3cf23d0e2a4a30654b28a Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 10:29:15 +0200 Subject: [PATCH 13/31] Fix patch file not found --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 0e4f8438..77e01d10 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -31,7 +31,7 @@ FetchContent_Declare( SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG 1.22.10 - PATCH_COMMAND git apply ${CMAKE_CURRENT_SOURCE_DIR}/sophus.patch + PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/sophus.patch UPDATE_DISCONNECTED 1) FetchContent_MakeAvailable(sophus) From 9484f180601378375444bbaf9c8c8b62136aaaac Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 10:32:28 +0200 Subject: [PATCH 14/31] I finally use pre-commit :) --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 6 +++--- cpp/kiss_icp/3rdparty/sophus/sophus.patch | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 77e01d10..1178fab8 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -27,9 +27,9 @@ set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") # TODO: Remove patch in case https://github.com/strasdat/Sophus/pull/502 gets merged FetchContent_Declare( - sophus - SYSTEM - GIT_REPOSITORY https://github.com/strasdat/Sophus.git + sophus + SYSTEM + GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG 1.22.10 PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/sophus.patch UPDATE_DISCONNECTED 1) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch index 588ece88..abf75916 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.patch +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.patch @@ -8,6 +8,5 @@ index 5634d35b..56a1b590 100644 #define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description) -#define SOPHUS_FMT_ARG(arg) +#define SOPHUS_FMT_ARG(arg) arg - + #else // !SOPHUS_USE_BASIC_LOGGING - From 91133403779ec1438d9e2a875f95b999b7aff3b6 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 10:36:38 +0200 Subject: [PATCH 15/31] patch got corrupted --- cpp/kiss_icp/3rdparty/sophus/sophus.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch index abf75916..588ece88 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.patch +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.patch @@ -8,5 +8,6 @@ index 5634d35b..56a1b590 100644 #define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description) -#define SOPHUS_FMT_ARG(arg) +#define SOPHUS_FMT_ARG(arg) arg - + #else // !SOPHUS_USE_BASIC_LOGGING + From 528d196e30a0c884de2d0eef9dcaa27ba4aa510e Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 10:55:13 +0200 Subject: [PATCH 16/31] Let's see if this path passes pre-commits and the build --- cpp/kiss_icp/3rdparty/sophus/sophus.patch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch index 588ece88..fd120d91 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.patch +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.patch @@ -2,12 +2,11 @@ diff --git a/sophus/common.hpp b/sophus/common.hpp index 5634d35b..56a1b590 100644 --- a/sophus/common.hpp +++ b/sophus/common.hpp -@@ -18,7 +18,7 @@ +@@ -18,6 +18,6 @@ #define SOPHUS_FMT_CSTR(description, ...) description #define SOPHUS_FMT_STR(description, ...) std::string(description) #define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description) -#define SOPHUS_FMT_ARG(arg) +#define SOPHUS_FMT_ARG(arg) arg - + #else // !SOPHUS_USE_BASIC_LOGGING - From 809f71c8300888e6532c309e19318d288465eaba Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 11:04:05 +0200 Subject: [PATCH 17/31] Back to original patch --- cpp/kiss_icp/3rdparty/sophus/sophus.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch index fd120d91..588ece88 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.patch +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.patch @@ -2,11 +2,12 @@ diff --git a/sophus/common.hpp b/sophus/common.hpp index 5634d35b..56a1b590 100644 --- a/sophus/common.hpp +++ b/sophus/common.hpp -@@ -18,6 +18,6 @@ +@@ -18,7 +18,7 @@ #define SOPHUS_FMT_CSTR(description, ...) description #define SOPHUS_FMT_STR(description, ...) std::string(description) #define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description) -#define SOPHUS_FMT_ARG(arg) +#define SOPHUS_FMT_ARG(arg) arg - + #else // !SOPHUS_USE_BASIC_LOGGING + From ab1f9f52afcede78f971d5dd90097e0f8665e706 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 11:06:00 +0200 Subject: [PATCH 18/31] remove whitespace --- cpp/kiss_icp/3rdparty/sophus/sophus.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch index 588ece88..4f611649 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.patch +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.patch @@ -8,6 +8,6 @@ index 5634d35b..56a1b590 100644 #define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description) -#define SOPHUS_FMT_ARG(arg) +#define SOPHUS_FMT_ARG(arg) arg - + #else // !SOPHUS_USE_BASIC_LOGGING From daf19eaab1e9b112f34d35a3a4b82826db7b72ae Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 11:27:54 +0200 Subject: [PATCH 19/31] Ignore patch in pre-commit eof check --- .pre-commit-config.yaml | 1 + cpp/kiss_icp/3rdparty/sophus/sophus.patch | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ced02460..d323e1d3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,7 @@ repos: hooks: - id: trailing-whitespace - id: end-of-file-fixer + exclude: \.patch$ - id: check-yaml - id: check-added-large-files - repo: https://github.com/pre-commit/mirrors-clang-format diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch index 4f611649..589298ba 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.patch +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.patch @@ -10,4 +10,4 @@ index 5634d35b..56a1b590 100644 +#define SOPHUS_FMT_ARG(arg) arg #else // !SOPHUS_USE_BASIC_LOGGING - + From 3f42610b57eb40992a41243df25a0fa8e312d09d Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 11:34:19 +0200 Subject: [PATCH 20/31] Try this for Windows --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 1178fab8..f6bd2119 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -31,7 +31,7 @@ FetchContent_Declare( SYSTEM GIT_REPOSITORY https://github.com/strasdat/Sophus.git GIT_TAG 1.22.10 - PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/sophus.patch + PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/sophus.patch UPDATE_DISCONNECTED 1) FetchContent_MakeAvailable(sophus) From 6ca8fdd3d9c3ddca7681dc6cb1a278cb8157a896 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 12:15:18 +0200 Subject: [PATCH 21/31] Next try --- .pre-commit-config.yaml | 1 + cpp/kiss_icp/3rdparty/sophus/sophus.patch | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d323e1d3..1b6fd38d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,7 @@ repos: rev: v4.4.0 hooks: - id: trailing-whitespace + exclude: \.patch$ - id: end-of-file-fixer exclude: \.patch$ - id: check-yaml diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch index 589298ba..588ece88 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.patch +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.patch @@ -8,6 +8,6 @@ index 5634d35b..56a1b590 100644 #define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description) -#define SOPHUS_FMT_ARG(arg) +#define SOPHUS_FMT_ARG(arg) arg - + #else // !SOPHUS_USE_BASIC_LOGGING - + From 88cc2a762754cc6f52151b68ecfe5e1b7ff1a3ec Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 12:36:59 +0200 Subject: [PATCH 22/31] Revert up to "TO BE REVERTED -> Remove personal repos" This reverts commit a1564818a29528450802b835ee511de5c60cee15. --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 3 ++- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 11 ++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index cc56e043..edc206fa 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -32,5 +32,6 @@ set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") include(FetchContent) -FetchContent_Declare(eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen GIT_TAG 3.4 EXCLUDE_FROM_ALL SYSTEM) +FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz EXCLUDE_FROM_ALL + SYSTEM) FetchContent_MakeAvailable(eigen) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index f6bd2119..c5524018 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,13 +25,6 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -# TODO: Remove patch in case https://github.com/strasdat/Sophus/pull/502 gets merged -FetchContent_Declare( - sophus - SYSTEM - GIT_REPOSITORY https://github.com/strasdat/Sophus.git - GIT_TAG 1.22.10 - PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/sophus.patch - UPDATE_DISCONNECTED 1) - +# TODO: after https://github.com/strasdat/Sophus/pull/502 gets merged go back to mainstream +FetchContent_Declare(sophus SYSTEM URL https://github.com/nachovizzo/Sophus/archive/refs/tags/1.22.11.tar.gz) FetchContent_MakeAvailable(sophus) From c1491c02664005a79f56b79d8d1a5d0403d3d149 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 12:40:34 +0200 Subject: [PATCH 23/31] Remove these, will be separate PR --- .pre-commit-config.yaml | 2 -- cpp/kiss_icp/3rdparty/sophus/sophus.patch | 13 ------------- 2 files changed, 15 deletions(-) delete mode 100644 cpp/kiss_icp/3rdparty/sophus/sophus.patch diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b6fd38d..ced02460 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,9 +3,7 @@ repos: rev: v4.4.0 hooks: - id: trailing-whitespace - exclude: \.patch$ - id: end-of-file-fixer - exclude: \.patch$ - id: check-yaml - id: check-added-large-files - repo: https://github.com/pre-commit/mirrors-clang-format diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch deleted file mode 100644 index 588ece88..00000000 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/sophus/common.hpp b/sophus/common.hpp -index 5634d35b..56a1b590 100644 ---- a/sophus/common.hpp -+++ b/sophus/common.hpp -@@ -18,7 +18,7 @@ - #define SOPHUS_FMT_CSTR(description, ...) description - #define SOPHUS_FMT_STR(description, ...) std::string(description) - #define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description) --#define SOPHUS_FMT_ARG(arg) -+#define SOPHUS_FMT_ARG(arg) arg - - #else // !SOPHUS_USE_BASIC_LOGGING - From 91deba380461d84fdf8b22a47acbfed992466149 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 12:52:24 +0200 Subject: [PATCH 24/31] Remove personal repos --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 3 +-- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 11 +++++++++-- cpp/kiss_icp/3rdparty/sophus/sophus.patch | 13 +++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 cpp/kiss_icp/3rdparty/sophus/sophus.patch diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index edc206fa..cc56e043 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -32,6 +32,5 @@ set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") include(FetchContent) -FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz EXCLUDE_FROM_ALL - SYSTEM) +FetchContent_Declare(eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen GIT_TAG 3.4 EXCLUDE_FROM_ALL SYSTEM) FetchContent_MakeAvailable(eigen) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index c5524018..f6bd2119 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,6 +25,13 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -# TODO: after https://github.com/strasdat/Sophus/pull/502 gets merged go back to mainstream -FetchContent_Declare(sophus SYSTEM URL https://github.com/nachovizzo/Sophus/archive/refs/tags/1.22.11.tar.gz) +# TODO: Remove patch in case https://github.com/strasdat/Sophus/pull/502 gets merged +FetchContent_Declare( + sophus + SYSTEM + GIT_REPOSITORY https://github.com/strasdat/Sophus.git + GIT_TAG 1.22.10 + PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/sophus.patch + UPDATE_DISCONNECTED 1) + FetchContent_MakeAvailable(sophus) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.patch b/cpp/kiss_icp/3rdparty/sophus/sophus.patch new file mode 100644 index 00000000..588ece88 --- /dev/null +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.patch @@ -0,0 +1,13 @@ +diff --git a/sophus/common.hpp b/sophus/common.hpp +index 5634d35b..56a1b590 100644 +--- a/sophus/common.hpp ++++ b/sophus/common.hpp +@@ -18,7 +18,7 @@ + #define SOPHUS_FMT_CSTR(description, ...) description + #define SOPHUS_FMT_STR(description, ...) std::string(description) + #define SOPHUS_FMT_PRINT(description, ...) std::printf("%s\n", description) +-#define SOPHUS_FMT_ARG(arg) ++#define SOPHUS_FMT_ARG(arg) arg + + #else // !SOPHUS_USE_BASIC_LOGGING + From 0f24290baa638c8c1d5a274a3f37d51f70a6095e Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 13:09:23 +0200 Subject: [PATCH 25/31] Can remove, because has been cherry-picked in https://gitlab.com/libeigen/eigen/-/commit/75ebef26b64f4fc172f68eca57cb4ca5107ab4b9 --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index cc56e043..79a46ee3 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -21,10 +21,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# TODO: Yet another manual release dne by nacho. This should be updated whenever the Eigen team -# release a new version that is not 3.4. That version does not include this necessary changes: -# - https://gitlab.com/libeigen/eigen/-/merge_requests/893/diffs - set(EIGEN_BUILD_DOC OFF CACHE BOOL "Don't build Eigen docs") set(EIGEN_BUILD_TESTING OFF CACHE BOOL "Don't build Eigen tests") set(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "Don't build Eigen pkg-config") From 34a87f8b66196ca500c31d4cb3ce0b72e9a091f8 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 13:19:27 +0200 Subject: [PATCH 26/31] Skip patch files --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ced02460..1b6fd38d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,9 @@ repos: rev: v4.4.0 hooks: - id: trailing-whitespace + exclude: \.patch$ - id: end-of-file-fixer + exclude: \.patch$ - id: check-yaml - id: check-added-large-files - repo: https://github.com/pre-commit/mirrors-clang-format From 356fc9213439ada58c7135a3423a92a86204bdfc Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 13:33:12 +0200 Subject: [PATCH 27/31] For now keep this separated --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 19 +++++++++++++++++-- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 11 ++--------- cpp/kiss_icp/3rdparty/tbb/tbb.cmake | 17 ++++++++++++++--- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index 79a46ee3..097120e5 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -21,6 +21,10 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +# TODO: Yet another manual release dne by nacho. This should be updated whenever the Eigen team +# release a new version that is not 3.4. That version does not include this necessary changes: +# - https://gitlab.com/libeigen/eigen/-/merge_requests/893/diffs + set(EIGEN_BUILD_DOC OFF CACHE BOOL "Don't build Eigen docs") set(EIGEN_BUILD_TESTING OFF CACHE BOOL "Don't build Eigen tests") set(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "Don't build Eigen pkg-config") @@ -28,5 +32,16 @@ set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") include(FetchContent) -FetchContent_Declare(eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen GIT_TAG 3.4 EXCLUDE_FROM_ALL SYSTEM) -FetchContent_MakeAvailable(eigen) +FetchContent_Declare(eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen GIT_TAG 3.4) +if(NOT eigen_POPULATED) + FetchContent_Populate(eigen) + if(${CMAKE_VERSION} GREATER_EQUAL 3.25) + add_subdirectory(${eigen_SOURCE_DIR} ${eigen_BINARY_DIR} SYSTEM EXCLUDE_FROM_ALL) + else() + # Emulate the SYSTEM flag introduced in CMake 3.25. Withouth this flag the compiler will + # consider this 3rdparty headers as source code and fail due the -Werror flag. + add_subdirectory(${eigen_SOURCE_DIR} ${eigen_BINARY_DIR} EXCLUDE_FROM_ALL) + get_target_property(eigen_include_dirs eigen INTERFACE_INCLUDE_DIRECTORIES) + set_target_properties(eigen PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${eigen_include_dirs}") + endif() +endif() diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index f6bd2119..c5524018 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,13 +25,6 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -# TODO: Remove patch in case https://github.com/strasdat/Sophus/pull/502 gets merged -FetchContent_Declare( - sophus - SYSTEM - GIT_REPOSITORY https://github.com/strasdat/Sophus.git - GIT_TAG 1.22.10 - PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/sophus.patch - UPDATE_DISCONNECTED 1) - +# TODO: after https://github.com/strasdat/Sophus/pull/502 gets merged go back to mainstream +FetchContent_Declare(sophus SYSTEM URL https://github.com/nachovizzo/Sophus/archive/refs/tags/1.22.11.tar.gz) FetchContent_MakeAvailable(sophus) diff --git a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake index e007b533..64482ceb 100644 --- a/cpp/kiss_icp/3rdparty/tbb/tbb.cmake +++ b/cpp/kiss_icp/3rdparty/tbb/tbb.cmake @@ -20,6 +20,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +# option(BUILD_SHARED_LIBS ON) option(BUILD_SHARED_LIBS OFF) option(TBBMALLOC_BUILD OFF) option(TBB_EXAMPLES OFF) @@ -27,6 +28,16 @@ option(TBB_STRICT OFF) option(TBB_TEST OFF) include(FetchContent) -FetchContent_Declare(tbb URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz EXCLUDE_FROM_ALL - SYSTEM) -FetchContent_MakeAvailable(tbb) +FetchContent_Declare(tbb URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.8.0.tar.gz) +if(NOT tbb_POPULATED) + FetchContent_Populate(tbb) + if(${CMAKE_VERSION} GREATER_EQUAL 3.25) + add_subdirectory(${tbb_SOURCE_DIR} ${tbb_BINARY_DIR} SYSTEM EXCLUDE_FROM_ALL) + else() + # Emulate the SYSTEM flag introduced in CMake 3.25. Withouth this flag the compiler will + # consider this 3rdparty headers as source code and fail due the -Werror flag. + add_subdirectory(${tbb_SOURCE_DIR} ${tbb_BINARY_DIR} EXCLUDE_FROM_ALL) + get_target_property(tbb_include_dirs tbb INTERFACE_INCLUDE_DIRECTORIES) + set_target_properties(tbb PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${tbb_include_dirs}") + endif() +endif() From 928ef9789b2a5a3a8d3816bea8bd0b2fb20101d2 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 13:37:02 +0200 Subject: [PATCH 28/31] Remove comment --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index 097120e5..a6f1177f 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -21,10 +21,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# TODO: Yet another manual release dne by nacho. This should be updated whenever the Eigen team -# release a new version that is not 3.4. That version does not include this necessary changes: -# - https://gitlab.com/libeigen/eigen/-/merge_requests/893/diffs - set(EIGEN_BUILD_DOC OFF CACHE BOOL "Don't build Eigen docs") set(EIGEN_BUILD_TESTING OFF CACHE BOOL "Don't build Eigen tests") set(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "Don't build Eigen pkg-config") From e5db6ab9734606cd77531fa69075eb290a118ff8 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 13:37:17 +0200 Subject: [PATCH 29/31] Add back --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index c5524018..027ebb02 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,6 +25,12 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -# TODO: after https://github.com/strasdat/Sophus/pull/502 gets merged go back to mainstream -FetchContent_Declare(sophus SYSTEM URL https://github.com/nachovizzo/Sophus/archive/refs/tags/1.22.11.tar.gz) +FetchContent_Declare( + sophus + SYSTEM + GIT_REPOSITORY https://github.com/strasdat/Sophus.git + GIT_TAG 1.22.10 + PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/sophus.patch + UPDATE_DISCONNECTED 1) + FetchContent_MakeAvailable(sophus) From c1b383655be58a42644a32f81a983efeb4ea817c Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 15:15:41 +0200 Subject: [PATCH 30/31] Patch Sophus without git --- cpp/kiss_icp/3rdparty/sophus/sophus.cmake | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake index 027ebb02..13e5baa8 100644 --- a/cpp/kiss_icp/3rdparty/sophus/sophus.cmake +++ b/cpp/kiss_icp/3rdparty/sophus/sophus.cmake @@ -25,12 +25,7 @@ set(SOPHUS_USE_BASIC_LOGGING ON CACHE BOOL "Don't use fmt for Sophus libraru") set(BUILD_SOPHUS_TESTS OFF CACHE BOOL "Don't build Sophus tests") set(BUILD_SOPHUS_EXAMPLES OFF CACHE BOOL "Don't build Sophus Examples") -FetchContent_Declare( - sophus - SYSTEM - GIT_REPOSITORY https://github.com/strasdat/Sophus.git - GIT_TAG 1.22.10 - PATCH_COMMAND git apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/sophus.patch - UPDATE_DISCONNECTED 1) +FetchContent_Declare(sophus SYSTEM URL https://github.com/strasdat/Sophus/archive/refs/tags/1.22.10.tar.gz + PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/sophus.patch UPDATE_DISCONNECTED 1) FetchContent_MakeAvailable(sophus) From 35a706350a71a6a74daba48948ea9069000e2786 Mon Sep 17 00:00:00 2001 From: Benedikt Mersch Date: Wed, 17 Apr 2024 15:23:18 +0200 Subject: [PATCH 31/31] Patch Eigen without git --- cpp/kiss_icp/3rdparty/eigen/eigen.cmake | 3 +- cpp/kiss_icp/3rdparty/eigen/eigen.patch | 74 +++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 cpp/kiss_icp/3rdparty/eigen/eigen.patch diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake index edd7ce0e..d83eb32f 100644 --- a/cpp/kiss_icp/3rdparty/eigen/eigen.cmake +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.cmake @@ -28,7 +28,8 @@ set(EIGEN_BUILD_BLAS OFF CACHE BOOL "Don't build blas module") set(EIGEN_BUILD_LAPACK OFF CACHE BOOL "Don't build lapack module") include(FetchContent) -FetchContent_Declare(eigen URL https://github.com/nachovizzo/eigen/archive/refs/tags/3.4.90.tar.gz) +FetchContent_Declare(eigen URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz + PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_LIST_DIR}/eigen.patch UPDATE_DISCONNECTED 1) FetchContent_GetProperties(eigen) if(NOT eigen_POPULATED) FetchContent_Populate(eigen) diff --git a/cpp/kiss_icp/3rdparty/eigen/eigen.patch b/cpp/kiss_icp/3rdparty/eigen/eigen.patch new file mode 100644 index 00000000..6eb341cb --- /dev/null +++ b/cpp/kiss_icp/3rdparty/eigen/eigen.patch @@ -0,0 +1,74 @@ +commit cf82186416d04ea5df2a397d8fe09dc78d40ca65 +Author: Antonio Sánchez +Date: Sat Mar 5 05:49:45 2022 +0000 + + Adds new CMake Options for controlling build components. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index de1c23e91..0af36a53a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -477,6 +477,9 @@ if(EIGEN_BUILD_TESTING) + add_subdirectory(failtest) + endif() + ++include(CMakeDetermineFortranCompiler) ++option(EIGEN_BUILD_BLAS "Toggles the building of the Eigen Blas library" ${CMAKE_Fortran_COMPILER}) ++option(EIGEN_BUILD_LAPACK "Toggles the building of the included Eigen LAPACK library" ${CMAKE_Fortran_COMPILER}) + if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) + add_subdirectory(blas) + add_subdirectory(lapack) +@@ -611,6 +614,8 @@ set_target_properties (eigen PROPERTIES EXPORT_NAME Eigen) + + install (TARGETS eigen EXPORT Eigen3Targets) + ++option(EIGEN_BUILD_CMAKE_PACKAGE "Enables the creation of EigenConfig.cmake and related files" ON) ++if(EIGEN_BUILD_CMAKE_PACKAGE) + configure_package_config_file ( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Eigen3Config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake +@@ -655,6 +660,7 @@ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake + # Add uninstall target + add_custom_target ( uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/EigenUninstall.cmake) ++endif() + + if (EIGEN_SPLIT_TESTSUITE) + ei_split_testsuite("${EIGEN_SPLIT_TESTSUITE}") +diff --git a/blas/CMakeLists.txt b/blas/CMakeLists.txt +index 8d3cb86dc..c530957fb 100644 +--- a/blas/CMakeLists.txt ++++ b/blas/CMakeLists.txt +@@ -1,6 +1,7 @@ + + project(EigenBlas CXX) + ++if(EIGEN_BUILD_BLAS) + include(CheckLanguage) + check_language(Fortran) + if(CMAKE_Fortran_COMPILER) +@@ -59,4 +60,4 @@ if(EIGEN_BUILD_TESTING) + endif() + + endif() +- ++endif() +diff --git a/lapack/CMakeLists.txt b/lapack/CMakeLists.txt +index c8ca64001..8d6d75401 100644 +--- a/lapack/CMakeLists.txt ++++ b/lapack/CMakeLists.txt +@@ -1,5 +1,7 @@ + project(EigenLapack CXX) + ++if(EIGEN_BUILD_LAPACK AND EIGEN_BUILD_BLAS) ++ + include(CheckLanguage) + check_language(Fortran) + if(CMAKE_Fortran_COMPILER) +@@ -457,3 +459,6 @@ if(EXISTS ${eigen_full_path_to_testing_lapack}) + + endif() + ++elseif(EIGEN_BUILD_LAPACK AND NOT EIGEN_BUILD_BLAS) ++ message(FATAL_ERROR "EIGEN_BUILD_LAPACK requires EIGEN_BUILD_BLAS") ++endif() #EIGEN_BUILD_LAPACK