Skip to content

Commit

Permalink
fix build without installing because no system deps are present
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Uecker committed Nov 20, 2024
1 parent a5c5f22 commit d402bee
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
13 changes: 10 additions & 3 deletions cpp/kiss_icp/3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,22 @@ if(TARGET tsl::robin_map)
message("Found package tsl-robin-map locally")
endif()

if(NOT (TARGET Eigen3::Eigen AND TARGET Sophus::Sophus AND TARGET tsl::robin_map AND TARGET TBB::tbb))
if(INSTALL_KISS_ICP_CPP AND NOT (TARGET Eigen3::Eigen AND TARGET Sophus::Sophus AND TARGET tsl::robin_map AND TARGET
TBB::tbb))
message(
WARNING
"
Exporting fetched dependencies is currently broken
Exporting fetched dependencies is currently broken.
I have no idea how to do it automatically ¯\\_(ツ)_/¯
If you want to do this, please set DOWNLOAD_MISSING_DEPS to OFF in the main CMakeLists.txt and install the dependencies yourself.
If you want to make the kiss_icp c++ library available system-wide,
please set DOWNLOAD_MISSING_DEPS to OFF in the main CMakeLists.txt and install the dependencies yourself.
The find_dependencies file lists the corresponding installation instructions.
")
set(INSTALL_KISS_ICP_CPP OFF)
else()
if(INSTALL_KISS_ICP_CPP)
message("All system dependencies found! Installing kiss_icp as a c++ library is possible.")
endif()
endif()

if(DOWNLOAD_MISSING_DEPS)
Expand Down
25 changes: 14 additions & 11 deletions cpp/kiss_icp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ option(USE_SYSTEM_EIGEN3 "Use system pre-installed Eigen" ON)
option(USE_SYSTEM_SOPHUS "Use system pre-installed Sophus" ON)
option(USE_SYSTEM_TSL-ROBIN-MAP "Use system pre-installed tsl_robin" ON)
option(USE_SYSTEM_TBB "Use system pre-installed oneAPI/tbb" ON)
option(DOWNLOAD_MISSING_DEPS "try and download missing depedencies from repos" ON)
option(DOWNLOAD_MISSING_DEPS "Try and download missing depedencies from repos" ON)
option(INSTALL_KISS_ICP_CPP "Install kiss_icp c++ library, requires all dependencies to be installed system-wide" ON)

# ccache setup
if(USE_CCACHE)
Expand All @@ -54,17 +55,19 @@ include(${CMAKE_CURRENT_LIST_DIR}/cmake/CompilerOptions.cmake)

add_subdirectory(src)

install(EXPORT kiss_icpTargets FILE kiss_icpTargets.cmake NAMESPACE kiss_icp:: DESTINATION "share/cmake/kiss_icp")
if(INSTALL_KISS_ICP_CPP)
install(EXPORT kiss_icpTargets FILE kiss_icpTargets.cmake NAMESPACE kiss_icp:: DESTINATION "share/cmake/kiss_icp")

configure_package_config_file(
${CMAKE_CURRENT_LIST_DIR}/cmake/Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/kiss_icpConfig.cmake"
INSTALL_DESTINATION "share/cmake/kiss_icp")
configure_package_config_file(
${CMAKE_CURRENT_LIST_DIR}/cmake/Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/kiss_icpConfig.cmake"
INSTALL_DESTINATION "share/cmake/kiss_icp")

# generate the version file for the config file
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/kiss_icpConfigVersion.cmake" VERSION "${version}"
COMPATIBILITY SameMinorVersion)
# generate the version file for the config file
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/kiss_icpConfigVersion.cmake" VERSION "${version}"
COMPATIBILITY SameMinorVersion)

install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/include/kiss_icp" DESTINATION "include")
install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/include/kiss_icp" DESTINATION "include")

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kiss_icpConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/kiss_icpConfigVersion.cmake" DESTINATION "share/cmake/kiss_icp")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kiss_icpConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/kiss_icpConfigVersion.cmake" DESTINATION "share/cmake/kiss_icp")
endif()
6 changes: 3 additions & 3 deletions cpp/kiss_icp/include/kiss_icp/pipeline/KissICP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#include <tuple>
#include <vector>

#include "kiss_icp/core/Registration.hpp"
#include "kiss_icp/core/Threshold.hpp"
#include "kiss_icp/core/VoxelHashMap.hpp"
#include "Registration.hpp"
#include "Threshold.hpp"
#include "VoxelHashMap.hpp"

namespace kiss_icp::pipeline {

Expand Down
10 changes: 5 additions & 5 deletions cpp/kiss_icp/src/pipeline/KissICP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#include "kiss_icp/pipeline/KissICP.hpp"
#include "KissICP.hpp"

#include <Eigen/Core>
#include <vector>

#include "kiss_icp/core/Deskew.hpp"
#include "kiss_icp/core/Preprocessing.hpp"
#include "kiss_icp/core/Registration.hpp"
#include "kiss_icp/core/VoxelHashMap.hpp"
#include "Deskew.hpp"
#include "Preprocessing.hpp"
#include "Registration.hpp"
#include "VoxelHashMap.hpp"

namespace kiss_icp::pipeline {

Expand Down

0 comments on commit d402bee

Please sign in to comment.