Skip to content

Commit

Permalink
add flann and eigen submodule, fix flann for cpp .so compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahabaz-Bagwan committed Oct 9, 2021
1 parent 940a650 commit abfcb82
Show file tree
Hide file tree
Showing 6 changed files with 40,271 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[Bb]uild/
.vscode/
input/
.cache/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "thirdparty/flann"]
path = thirdparty/flann
url = [email protected]:Shahabaz-Bagwan/flann.git
[submodule "thirdparty/eigen"]
path = thirdparty/eigen
url = https://gitlab.com/libeigen/eigen.git
19 changes: 6 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# min. version of cmake required for this project
CMAKE_MINIMUM_REQUIRED( VERSION 3.18)
CMAKE_MINIMUM_REQUIRED( VERSION 3.10)

# name of the project
PROJECT(pointCloudFilters)

find_package( Eigen3 3.3 REQUIRED NO_MODULE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(FLANN_INCLUDE_DIR "/usr/local/include/flann")
# set(EIGEN3_INCLUDE_DIR "/usr/include/eigen3")
set(EIGEN3_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/eigen")
set(FLANN_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/flann/src/cpp")

# specify the C++ standard
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED True)

# collect all the .cxx needed for executable
Expand All @@ -23,11 +23,4 @@ INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/include" "${EIGEN3_INCLUDE_DIR}
ADD_EXECUTABLE (${PROJECT_NAME} ${SOURCES})

# Link dependencies
TARGET_LINK_LIBRARIES (${PROJECT_NAME} Eigen3::Eigen /usr/local/lib/libflann_cpp.so)

# Provide other include dirs required for the project
# TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} ${HEADERS} )

# When installing where to install
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ~/.local/bin)
INSTALL(FILES ${cmake_current_source_dir}/include DESTINATION ~/.local/include)
TARGET_LINK_LIBRARIES (${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/flann/build/lib/libflann.so)
Loading

0 comments on commit abfcb82

Please sign in to comment.