Skip to content

Commit 01c5456

Browse files
author
Your Name
committed
renew project
1 parent acf23ce commit 01c5456

Some content is hidden

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

63 files changed

+103
-573
lines changed

CMakeLists.txt

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ if (WIN32)
1818
endif ()
1919

2020
include(GNUInstallDirs)
21+
include_directories(${PROJECT_SOURCE_DIR}/include/)
22+
23+
if (APPLE)
24+
# for mac M1
25+
include_directories(/opt/homebrew/include/)
26+
endif()
2127

2228
if (USE_CV_EX)
2329
include_directories(/usr/include/freetype2/)
@@ -29,7 +35,6 @@ if (USE_EIGEN)
2935
add_definitions(-DUSE_EIGEN)
3036
endif ()
3137

32-
3338
if (USE_OPENCV)
3439
find_package(OpenCV 4.0 REQUIRED)
3540
if (OpenCV_FOUND)
@@ -47,7 +52,6 @@ if (USE_OPENCV)
4752
endif ()
4853
endif ()
4954

50-
5155
if (USE_CURL)
5256
find_package(CURL REQUIRED)
5357
if (NOT CURL_FOUND)
@@ -100,19 +104,17 @@ if (USE_PROTOBUF)
100104
endif ()
101105
endif ()
102106

103-
104107
message(STATUS "USE_OPENCV: " ${USE_OPENCV})
105108
message(STATUS "USE_EIGEN: " ${USE_EIGEN})
106109
message(STATUS "USE_PROTOBUF: " ${USE_PROTOBUF})
107110
message(STATUS "USE_CV_EX: " ${USE_CV_EX})
108111
message(STATUS "USE_CURL: " ${USE_CURL})
109112
message(STATUS "BUILD_STATIC: " ${BUILD_STATIC})
110113

111-
112114
file(GLOB_RECURSE thor_SRCS "src/*.cpp" "src/*.cc" "include/proto/*.cc")
113-
file(GLOB_RECURSE thor_HEADERS "include/*.h" "include/*.hpp" "include/proto/*.h")
115+
file(GLOB_RECURSE thor_HEADERS "include/*.h" "include/*.hpp" "include/thor/proto/*.h")
114116

115-
add_library(thor SHARED ${thor_SRCS} ${thor_HEADERS} include/utils.h)
117+
add_library(thor SHARED ${thor_SRCS} ${thor_HEADERS})
116118
if (BUILD_STATIC)
117119
add_library(thor_static STATIC ${thor_SRCS} ${thor_HEADERS})
118120
endif()
@@ -133,9 +135,6 @@ if (USE_CURL)
133135
target_link_libraries(thor ${CURL_LIBRARIES})
134136
endif ()
135137

136-
137-
138-
139138
set_target_properties(
140139
thor
141140
PROPERTIES
@@ -149,23 +148,20 @@ set_target_properties(
149148
PUBLIC_HEADER "${thor_HEADERS}")
150149
target_include_directories(thor_static PRIVATE .)
151150
endif()
152-
153-
154151
configure_file(thor.pc thor.pc @ONLY)
155152

153+
add_subdirectory(examples)
156154

157155
install(TARGETS thor
158156
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
159157
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
160158
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thor)
161-
162159
if (BUILD_STATIC)
163160
install(TARGETS thor_static
164161
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
165162
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
166163
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thor)
167164
endif()
168-
169165
message(STATUS "Proto headers: " ${PROTO_HDRS})
170166
install(FILES ${PROTO_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thor/proto)
171167
install(FILES include/thor.pc

build_full.sh

100644100755
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@
2525
# this script build cao library automatically
2626

2727
#sudo apt install -y libopencv-dev
28-
sudo apt install -y libfreetype6-dev
29-
sudo apt install -y libcurl4-openssl-dev
30-
sudo apt install -y libeigen3-dev
31-
sudo apt-get install -y libprotobuf-dev
32-
sudo apt install -y protobuf-compiler
33-
34-
35-
sudo chmod -R 777 *
3628
if [ "$(uname)" == "Darwin" ]; then
3729
# Do something under Mac OS X platform
3830
printf "======== installing dependencies on macOS ============"
@@ -44,6 +36,11 @@ if [ "$(uname)" == "Darwin" ]; then
4436
make all -j8
4537
sudo make install
4638
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
39+
sudo apt install -y libfreetype6-dev
40+
sudo apt install -y libcurl4-openssl-dev
41+
sudo apt install -y libeigen3-dev
42+
sudo apt-get install -y libprotobuf-dev
43+
sudo apt install -y protobuf-compiler
4744
# Do something under GNU/Linux platform
4845
printf "======== installing dependencies on linux ============"
4946
sudo apt install -y libglog-dev

build_simple.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ case "$(uname -s)" in
2727

2828
Darwin)
2929
echo 'macOS'
30-
rm include/proto/*.pb.cc
31-
rm include/proto/*.pb.h
30+
rm include/thor/proto/*.pb.cc
31+
rm include/thor/proto/*.pb.h
3232
# brew install protobuf
3333

3434
;;

examples/000000576031.jpg

100644100755
File mode changed.

examples/CMakeLists.txt

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
1-
cmake_minimum_required(VERSION 3.5)
2-
project(thor_example VERSION 1.0.1 LANGUAGES CXX )
31

42

5-
set(CMAKE_CXX_STANDARD 14)
3+
add_executable(thor_demo thor_demo.cc)
4+
target_link_libraries(thor_demo thor)
5+
if (USE_OPENCV)
6+
target_link_libraries(thor_demo ${OpenCV_LIBS})
7+
endif ()
68

7-
include_directories(/usr/include/freetype2/)
8-
9-
10-
file(GLOB_RECURSE SOURCES src/*.cpp lib/*.cpp )
11-
file(GLOB_RECURSE HEADERS include/*.h lib/*.h)
12-
13-
find_package(Protobuf REQUIRED)
14-
find_package(OpenCV REQUIRED)
15-
16-
message(STATUS "${Protobuf_LIBRARIES}")
17-
18-
add_executable(thor_simple thor_simple.cpp)
19-
target_link_libraries(thor_simple thor ${Protobuf_LIBRARIES})
20-
21-
# add_executable(tests tests.cpp)
22-
# target_link_libraries(tests thor ${Protobuf_LIBRARY} ${OpenCV_LIBS})

examples/include/dog.h

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

examples/result_ins.pb

100644100755
File mode changed.

examples/src/dog.cpp

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

examples/test.tar

100644100755
File mode changed.

examples/tests.cpp

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

0 commit comments

Comments
 (0)