Skip to content

Commit 50b64d3

Browse files
committed
!feat(lib): include ufomap as library directly.
1 parent d3df8fc commit 50b64d3

File tree

128 files changed

+14
-48483
lines changed

Some content is hidden

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

128 files changed

+14
-48483
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "ufomap"]
2+
path = ufomap
3+
url = https://github.com/UnknownFreeOccupied/ufomap

CMakeLists.txt

Lines changed: 4 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -6,77 +6,11 @@ project(dufomap
66
LANGUAGES CXX
77
)
88

9-
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
10-
set(default_build_type "Release")
11-
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
12-
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
13-
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
14-
STRING "Choose the type of build." FORCE)
15-
# Set the possible values of build type for cmake-gui
16-
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
17-
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
18-
endif()
19-
20-
set(SRC_LIST "${PROJECT_SOURCE_DIR}/src/map/io.cpp")
21-
22-
find_package(PkgConfig REQUIRED)
23-
pkg_check_modules(LZ4 REQUIRED liblz4)
24-
pkg_check_modules(LZF REQUIRED liblzf)
25-
26-
find_package(OpenMP)
27-
add_library(Map SHARED ${SRC_LIST} ${HEADER_LIST})
28-
add_library(UFO::Map ALIAS Map)
29-
30-
set_target_properties(Map
31-
PROPERTIES
32-
VERSION ${PROJECT_VERSION}
33-
SOVERSION ${PROJECT_VERSION_MAJOR}
34-
CXX_STANDARD 20
35-
CXX_STANDARD_REQUIRED YES
36-
CXX_EXTENSIONS NO
37-
)
38-
39-
target_include_directories(Map
40-
PUBLIC
41-
$<INSTALL_INTERFACE:include>
42-
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
43-
)
44-
45-
target_link_libraries(Map
46-
PUBLIC
47-
${LZ4_LIBRARIES}
48-
OpenMP::OpenMP_CXX
49-
)
50-
51-
find_package(TBB QUIET)
52-
53-
IF(TBB_FOUND)
54-
message(STATUS "TBB found, enabling parallel execution")
55-
target_compile_definitions(Map
56-
PUBLIC
57-
UFO_PARALLEL=1
58-
)
59-
target_link_libraries(Map
60-
PUBLIC
61-
TBB::tbb
62-
)
63-
ELSE()
64-
message(STATUS "TBB not found, disabling parallel execution")
65-
ENDIF()
66-
67-
target_compile_features(Map
68-
PUBLIC
69-
cxx_std_20
70-
)
71-
72-
target_compile_options(Map
73-
PUBLIC
74-
-fPIC
75-
)
76-
9+
add_subdirectory(ufomap)
10+
include_directories(${CMAKE_SOURCE_DIR}/ufomap)
7711
# add_subdirectory(src)
7812

79-
add_executable(dufomap_run src/dufomap.cpp)
13+
add_executable(dufomap_run dufomap.cpp)
8014
set_target_properties(dufomap_run
8115
PROPERTIES
8216
VERSION ${PROJECT_VERSION}
@@ -109,63 +43,4 @@ target_compile_options(dufomap_run
10943

11044
# -Wshadow
11145
# -march=native
112-
)
113-
114-
115-
set(UFOMAP_BMI2 FALSE CACHE BOOL "Enable/disable BMI2 instructions")
116-
117-
if(DEFINED ENV{UFOMAP_BMI2})
118-
set(UFOMAP_BMI2 $ENV{UFOMAP_BMI2})
119-
endif(DEFINED ENV{UFOMAP_BMI2})
120-
121-
if(UFOMAP_BMI2)
122-
message(STATUS "UFOMAP BMI2 instructions enabled")
123-
target_compile_options(Map
124-
PUBLIC
125-
-mbmi2
126-
)
127-
else()
128-
message(STATUS "UFOMAP BMI2 instructions disabled")
129-
endif(UFOMAP_BMI2)
130-
131-
# IDEs should put the headers in a nice place
132-
source_group(TREE "${PROJECT_SOURCE_DIR}/include" PREFIX "Header Files" FILES ${HEADER_LIST})
133-
134-
install(TARGETS Map
135-
EXPORT ufomapTargets
136-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
137-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
138-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
139-
)
140-
141-
install(EXPORT ufomapTargets
142-
FILE "ufomapTargets.cmake"
143-
NAMESPACE UFO::
144-
DESTINATION lib/cmake/${PROJECT_NAME}
145-
)
146-
147-
include(CMakePackageConfigHelpers)
148-
149-
configure_package_config_file(
150-
"${PROJECT_SOURCE_DIR}/cmake/ufomapConfig.cmake.in"
151-
"${CMAKE_CURRENT_BINARY_DIR}/ufomapConfig.cmake"
152-
INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}
153-
)
154-
155-
write_basic_package_version_file(
156-
"${CMAKE_CURRENT_BINARY_DIR}/ufomapConfigVersion.cmake"
157-
VERSION ${PROJECT_VERSION}
158-
COMPATIBILITY SameMajorVersion
159-
)
160-
161-
INSTALL(
162-
FILES
163-
"${CMAKE_CURRENT_BINARY_DIR}/ufomapConfig.cmake"
164-
"${CMAKE_CURRENT_BINARY_DIR}/ufomapConfigVersion.cmake"
165-
DESTINATION lib/cmake/${PROJECT_NAME}
166-
)
167-
168-
install(
169-
DIRECTORY ${PROJECT_SOURCE_DIR}/include/
170-
DESTINATION include
171-
)
46+
)

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ Quick Demo: Run with the **same parameter setting** without tuning for different
1212

1313
## 0. Setup
1414

15-
16-
### Environment
17-
1815
```bash
1916
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
2017
sudo apt update && apt install gcc-10 g++-10
2118
sudo apt install libtbb-dev liblz4-dev
2219
```
20+
2321
Dockerfile will be soon available.
2422

23+
Clone and init submodules:
24+
```bash
25+
git submodule update --init --recursive
26+
```
27+
2528
## 1. Build & Run
2629

2730
Build:

cmake/ufomapConfig.cmake.in

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.

include/ufo/algorithm/algorithm.hpp

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)