From 3f5477596d9de60cc24508ba6bc106f8dc0c5672 Mon Sep 17 00:00:00 2001 From: Kino Date: Tue, 11 Jun 2024 11:48:25 +0800 Subject: [PATCH] Fix missing fmt library --- CMakeLists.txt | 5 ++++- setup.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c36bfc6..3a7dae44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,9 @@ endif() # Build python sophus bindings option(BUILD_PYTHON_BINDINGS "Build python sophus bindings." OFF) if(BUILD_PYTHON_BINDINGS) + if(NOT TARGET fmt::fmt) + find_package(fmt REQUIRED) + endif() include(FetchContent) FetchContent_Declare( pybind11 @@ -121,7 +124,7 @@ if(BUILD_PYTHON_BINDINGS) add_subdirectory(${pybind11_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/pybind) pybind11_add_module(sophus_pybind ${CMAKE_CURRENT_SOURCE_DIR}/sophus_pybind/bindings.cpp) - target_link_libraries(sophus_pybind PUBLIC sophus) + target_link_libraries(sophus_pybind PUBLIC sophus fmt::fmt) endif(BUILD_PYTHON_BINDINGS) if(SOPHUS_INSTALL) diff --git a/setup.py b/setup.py index 05bf4db8..d030bee4 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,6 @@ def build_extension(self, ext): cmake_args = [ "-DBUILD_PYTHON_BINDINGS=ON", - "-DBUILD_SOPHUS_EXAMPLES=OFF", "-DBUILD_SOPHUS_TESTS=OFF", ] build_args = []