Skip to content

Commit

Permalink
Add glog without gflags (#4)
Browse files Browse the repository at this point in the history
add glog as submodule
integrate glog into CMake
use in one of the files
  • Loading branch information
ovysotska authored Sep 19, 2022
1 parent 9b107aa commit 0631d5b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "src/external/googletest"]
path = src/external/googletest
url = https://github.com/google/googletest.git
[submodule "src/external/glog"]
path = src/external/glog
url = https://github.com/google/glog
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ cmake_minimum_required(VERSION 3.10)

project(image_sequence_localizer)


include(cmake/UpdateSubmodules.cmake)
include(GoogleTest)
include(cmake/UpdateSubmodules.cmake)


option(PACKAGE_TESTS "Build the tests" ON)
if(PACKAGE_TESTS)
enable_testing()
add_subdirectory(src/external/googletest)
endif()

# Options for glog
option(WITH_GFLAGS "Use gflags" OFF)
option(WITH_GTEST "Use Google Test" OFF)
option(BUILD_TESTING "Use Build testing" OFF)
add_subdirectory(src/external/glog)
add_subdirectory(src)

2 changes: 2 additions & 0 deletions src/apps/cost_matrix_based_matching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ find_package(OpenCV REQUIRED)

add_executable(cost_matrix_based_matching_lsh cost_matrix_based_matching_lsh.cpp)
target_link_libraries( cost_matrix_based_matching_lsh
glog::glog
online_localizer
cost_matrix_database
successor_manager
config_parser
lsh_cv_hashing
cnn_feature
${OpenCV_LIBS}

)
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include "successor_manager/successor_manager.h"
#include "tools/config_parser/config_parser.h"

#include <glog/logging.h>

using std::make_shared;

std::vector<iBinarizableFeature::Ptr>
Expand All @@ -57,7 +59,9 @@ loadFeatures(const std::string &path2folder) {
}

int main(int argc, char *argv[]) {
printf("===== Online place recognition cost matrix based LSH ====\n");
google::InitGoogleLogging(argv[0]);
FLAGS_logtostderr = 1;
LOG(INFO) << "===== Online place recognition cost matrix based LSH ====\n";
if (argc < 2) {
printf("[ERROR] Not enough input parameters.\n");
printf("Proper usage: ./cost_matrix_based_matching_lsh config_file.yaml\n");
Expand Down
1 change: 1 addition & 0 deletions src/external/glog
Submodule glog added at b33e3b
5 changes: 2 additions & 3 deletions src/localization/features/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
add_library(cnn_feature cnn_feature.cpp)
target_link_libraries(cnn_feature PUBLIC protos)

add_library(feature_factory feature_factory.cpp)
target_link_libraries( feature_factory
cnn_feature
)
target_link_libraries(feature_factory PUBLIC cnn_feature)

add_library(feature_buffer feature_buffer.cpp)

0 comments on commit 0631d5b

Please sign in to comment.