Skip to content

Commit fed6c97

Browse files
committed
Added docs, comments, and some general improvements
1 parent 88a3538 commit fed6c97

147 files changed

Lines changed: 23210 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# ---- C++ build files ----
2+
*.o
3+
*.obj
4+
*.lo
5+
*.la
6+
*.al
7+
*.out
8+
*.a
9+
*.so
10+
*.so.*
11+
*.dylib
12+
*.dll
13+
*.exe
14+
15+
# ---- Debug files ----
16+
*.dSYM/
17+
*.stackdump
18+
*.core
19+
*.pdb
20+
*.idb
21+
22+
# ---- Build directories ----
23+
/build/
24+
/bin/
25+
/lib/
26+
/dist/
27+
/CMakeFiles/
28+
/CMakeCache.txt
29+
/cmake_install.cmake
30+
/Makefile
31+
/*.make
32+
33+
# Project-specific builds
34+
/examples/build/
35+
/examples/.cache/
36+
/examples/bin/
37+
/examples/lib/
38+
39+
# ---- Logs ----
40+
*.log
41+
42+
# ---- Editor / IDE files ----
43+
# VSCode
44+
.vscode/
45+
*.code-workspace
46+
.cache
47+
48+
# CLion / JetBrains
49+
.idea/
50+
51+
# Eclipse
52+
.project
53+
.cproject
54+
.settings/
55+
56+
# Visual Studio
57+
*.vcxproj*
58+
*.sln
59+
*.user
60+
*.aps
61+
*.ncb
62+
*.opendb
63+
*.suo
64+
*.cachefile
65+
66+
# ---- OS junk files ----
67+
.DS_Store
68+
Thumbs.db

‎CMakeLists.txt‎

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# ------------ Variables ------------
2+
set(PROJECT_NAME StringSLAM)
3+
set(PROJECT_VERSION 0.01)
4+
set(DESCRIPTION "A SLAM Library meant for low powered hardware, built with customization in mind!")
5+
6+
7+
# ------------ Project Definition ------------
8+
cmake_minimum_required(VERSION 3.16)
9+
project(${PROJECT_NAME}
10+
VERSION ${PROJECT_VERSION}
11+
DESCRIPTION ${DESCRIPTION}
12+
LANGUAGES CXX
13+
)
14+
15+
# ------------ Compiler Settings ------------
16+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
17+
set(CMAKE_CXX_STANDARD 17)
18+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
19+
set(CMAKE_CXX_EXTENSIONS OFF)
20+
21+
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
22+
if (NOT CMAKE_BUILD_TYPE)
23+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
24+
message(STATUS "No previous build - default to Release build")
25+
endif()
26+
endif()
27+
28+
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter -faligned-new -Werror -Wfatal-errors -Wno-c11-extensions)
29+
add_definitions(-D_FILE_OFFSET_BITS=64)
30+
31+
if (CMAKE_COMPILER_IS_GNUCXX)
32+
add_compile_options(-Wno-psabi)
33+
endif()
34+
35+
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
36+
37+
IF (NOT ENABLE_COMPILE_FLAGS_FOR_TARGET)
38+
# On a Pi this will give us armhf or arm64.
39+
execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH
40+
OUTPUT_VARIABLE ENABLE_COMPILE_FLAGS_FOR_TARGET OUTPUT_STRIP_TRAILING_WHITESPACE)
41+
endif()
42+
message(STATUS "Platform: ${ENABLE_COMPILE_FLAGS_FOR_TARGET}")
43+
if ("${ENABLE_COMPILE_FLAGS_FOR_TARGET}" STREQUAL "arm64")
44+
add_definitions(-ftree-vectorize)
45+
elseif ("${ENABLE_COMPILE_FLAGS_FOR_TARGET}" STREQUAL "armv8-neon")
46+
add_definitions(-mfpu=neon-fp-armv8 -ftree-vectorize)
47+
endif()
48+
49+
# Source package generation setup.
50+
set(CPACK_GENERATOR "TXZ")
51+
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-build")
52+
set(CPACK_SOURCE_GENERATOR "TXZ")
53+
set(CPACK_INSTALL_SCRIPTS ${CMAKE_SOURCE_DIR}/package.cmake)
54+
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-src")
55+
set(CPACK_SOURCE_IGNORE_FILES "/\.git*;/build;")
56+
include(CPack)
57+
58+
# ------------ Sources / Headers ------------
59+
file(GLOB_RECURSE SOURCES
60+
"${PROJECT_SOURCE_DIR}/src/*.cpp"
61+
)
62+
63+
file(GLOB_RECURSE HEADERS
64+
"${PROJECT_SOURCE_DIR}/include/*.hpp"
65+
)
66+
67+
# ------------ Dependencies ------------
68+
find_package(PkgConfig REQUIRED)
69+
70+
# Look For OpenCV and Eigen
71+
pkg_check_modules(OPENCV REQUIRED opencv4)
72+
pkg_check_modules(EIGEN3 REQUIRED eigen3)
73+
find_package(OpenEXR QUIET)
74+
include(GNUInstallDirs)
75+
76+
# ------------ Build Library ------------
77+
add_library(${PROJECT_NAME} ${SOURCES})
78+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" IMPORT_PREFIX "")
79+
80+
target_include_directories(${PROJECT_NAME}
81+
PUBLIC
82+
include
83+
${OPENCV_INCLUDE_DIRS}
84+
${EIGEN3_INCLUDE_DIRS}
85+
)
86+
87+
target_link_libraries(${PROJECT_NAME}
88+
pthread
89+
${OPENCV_LIBRARIES}
90+
${EIGEN3_LIBRARIES}
91+
)
92+
93+
# ------------ DOxygen ------------
94+
find_package(Doxygen REQUIRED)
95+
96+
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)
97+
set(DOXYGEN_OUT ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile)
98+
99+
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
100+
101+
add_custom_target(docs
102+
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
103+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
104+
COMMENT "Generating API documentation with Doxygen"
105+
VERBATIM
106+
)

0 commit comments

Comments
 (0)