Skip to content

Commit

Permalink
clang format style microsoft
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-khwarizmi-780 committed Apr 28, 2024
1 parent 2a5568f commit c10a0e6
Show file tree
Hide file tree
Showing 38 changed files with 3,082 additions and 2,844 deletions.
28 changes: 28 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
BasedOnStyle: Microsoft
AccessModifierOffset: '-1'
AlignAfterOpenBracket: Align
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: 'Yes'
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: '80'
ContinuationIndentWidth: '4'
IncludeBlocks: Preserve
IndentPPDirectives: None
IndentWidth: '2'
Language: Cpp
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: None
PointerAlignment: Left
SpaceBeforeParens: ControlStatements
SpacesBeforeTrailingComments: '2'
TabWidth: '4'
UseTab: Never

...
14 changes: 14 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: clang-format Check
on: [push, pull_request]
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '13'
check-path: 'src'
fallback-style: 'Microsoft' # optional
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.formatOnSave": true,
"editor.formatOnType": true,
"clang-format.executable": "${workspaceFolder}/.clang-format",
"clang-format.style": "file",
"clang-format.fallbackStyle": "Google",
"clang-format.language.cpp.enable": true,
}
143 changes: 93 additions & 50 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,52 +1,95 @@
cmake_minimum_required(VERSION 3.4)

# ============================================================================================
# VCPKG Toolchain
# ============================================================================================
if(WIN32)
# use vcpkg as packages manager in windows platform
# environment variable needs to be added for the path to vcpkg installation "VCPKG_ROOT"
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
endif(WIN32)

# ============================================================================================
# ============================================================================================
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/build/package)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
set(BUILD_GTEST ON CACHE BOOL "" FORCE)

project(OpenKF)

set(INCLUDE_FOLDER "include")
set(LIBRARY_INSTALL_DIR "lib")
set(INCLUDE_INSTALL_DIR "${INCLUDE_FOLDER}/${PROJECT_NAME}")
set(CONFIG_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/cmake/${PROJECT_NAME}")
set(namespace "%{PROJECT_NAME}::")
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")

enable_language(C CXX)

if (NOT MSVC)
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra")
endif(NOT MSVC)

if (MSVC)
# https://stackoverflow.com/a/18635749
add_compile_options(-MTd)
endif (MSVC)

find_package(Eigen3 3.3 REQUIRED NO_MODULE)

include(CTest)

add_subdirectory(src/third_party/googletest)
add_subdirectory(src/openkf)
add_subdirectory(src/examples)
add_subdirectory(tests)
#== == == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == ==
#VCPKG Toolchain
#== == == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == ==
if (WIN32)
#use vcpkg as packages manager in windows platform
#environment variable needs to be added for the path to vcpkg installation \
"VCPKG_ROOT"
set(CMAKE_TOOLCHAIN_FILE
"$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake") endif(WIN32)

#== == == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == ==
#== == == == == == == == == == == == == == == == == == == == == == == == == == \
== == == == == == == == == == == == == == == == == == == ==
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) set(
CMAKE_INCLUDE_CURRENT_DIR
ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR} / build / package)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(BUILD_GMOCK OFF CACHE BOOL
"" FORCE) set(BUILD_GTEST ON CACHE BOOL "" FORCE)

project(OpenKF)

set(INCLUDE_FOLDER "include") set(
LIBRARY_INSTALL_DIR
"lib") set(INCLUDE_INSTALL_DIR "${INCLUDE_"
"FOLDER}/"
"${PROJECT_"
"NAME}") set(CONFIG_INSTALL_DIR
"${"
"LI"
"BR"
"AR"
"Y_"
"IN"
"ST"
"AL"
"L_"
"DI"
"R}"
"/c"
"ma"
"ke"
"/$"
"{P"
"RO"
"JE"
"CT"
"_N"
"AM"
"E"
"}")
set(namespace "%{PROJECT_NAME}::") set(
TARGETS_EXPORT_NAME
"${PROJECT_NAME}Targets")

enable_language(C CXX)

if (NOT MSVC) set(CMAKE_CXX_FLAGS "-O3 "
"-Wal"
"l "
"-Wex"
"tra") set(
CMAKE_CXX_FLAGS_DEBUG
"-g -Wall -Wextra") endif(NOT MSVC)

if (MSVC)
#https: // stackoverflow.com/a/18635749
add_compile_options(-MTd) endif(
MSVC)

find_package(
Eigen3 3.3 REQUIRED
NO_MODULE)

include(CTest)

add_subdirectory(
src /
third_party /
googletest)
add_subdirectory(
src /
openkf)
add_subdirectory(
src /
examples)
add_subdirectory(
tests)
104 changes: 61 additions & 43 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,33 +173,47 @@ and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.

3. Protecting Users' Legal Rights From Anti-Circumvention Law.

No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

4. Conveying Verbatim Copies.

You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
the conditions stated below. Sublicensing is not allowed;
section 10 makes it unnecessary.

3. Protecting Users' Legal Rights From Anti-Circumvention Law.

No covered work shall be deemed part of an effective
technological measure under any applicable law
fulfilling obligations under article 11 of the
WIPO copyright treaty adopted
on 20 December 1996,
or similar laws prohibiting or
restricting circumvention of such measures.

When you convey a covered work,
you waive any legal power to forbid circumvention of
technological measures to the extent such
circumvention is effected by exercising rights
under this License with respect to the
covered work,
and you disclaim any intention to limit operation or
modification of the work as a means of enforcing,
against the work's users,
your or
third
parties' legal rights to forbid circumvention of technological
measures
.

4. Conveying Verbatim Copies.

You may convey verbatim copies of the
Program's source code as you receive it,
in any medium,
provided that you conspicuously and appropriately
publish on each copy an appropriate copyright
notice;
keep intact all notices stating that this License and any
non -
permissive terms added in accord with section 7 apply to
the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

You may charge any price or no price for each copy that you convey,
Expand Down Expand Up @@ -628,18 +642,21 @@ free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
state the exclusion of warranty;
and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
<one line to give the
program's name and a brief idea of what it does.> Copyright(C) <
year><name of author>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software : you can redistribute it and /
or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation,
either version 3 of the License,
or (at your option) any later version.

This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Expand All @@ -653,13 +670,14 @@ Also add information on how to contact you by electronic and paper mail.
notice like this when it starts in an interactive mode:

<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
This program comes with ABSOLUTELY NO WARRANTY; for
details type `show w'. This is free software,
and you are welcome to redistribute it under certain conditions;
type `show c' for details.

The hypothetical commands `show w ' and `show c' should show the appropriate
parts of the General Public License.Of course,
your program's commands might be different; for a GUI interface, you would use an "about box".

You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenKF (The Kalman Filter Library)
#OpenKF(The Kalman Filter Library)

This is an open source C++ Kalman filter library based on Eigen3 library for matrix operations.

Expand Down
28 changes: 14 additions & 14 deletions bootstrap-openkf.bat
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
@echo off

if not exist ".\cpp\build" (
echo Creating ./cpp/build Folder
md ./cpp/build
) else (
echo ./cpp/build folder already exists
)
if not exist
".\cpp\build"(echo Creating./ cpp / build Folder md./ cpp /
build) else(echo./ cpp / build folder already exists)

echo generating meta files
cmake -S ./cpp -B ./cpp/build
echo generating meta files cmake -
S./ cpp -
B./ cpp /
build

echo building ...
cmake --build ./cpp/build
echo building... cmake-- build./
cpp /
build

echo installing ...
cmake --install ./cpp/build --config Debug
::runas /user:Administrator "cmake --install .\cpp\build --config Debug"
echo installing... cmake-- install./
cpp / build-- config Debug ::runas /
user : Administrator "cmake --install .\cpp\build --config Debug"

pause
pause
13 changes: 5 additions & 8 deletions src/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
set(EXAMPLE_EXECUTABLE_PREFIX "example_")

add_subdirectory(kf_state_estimation)
add_subdirectory(ekf_range_sensor)
add_subdirectory(unscented_transform)
add_subdirectory(ukf_range_sensor)
add_subdirectory(test_least_squares)
add_subdirectory(sr_ukf_linear_function)
add_subdirectory(ego_motion_model_adapter)

add_subdirectory(kf_state_estimation) add_subdirectory(ekf_range_sensor)
add_subdirectory(unscented_transform) add_subdirectory(ukf_range_sensor)
add_subdirectory(test_least_squares)
add_subdirectory(sr_ukf_linear_function)
add_subdirectory(ego_motion_model_adapter)
Loading

0 comments on commit c10a0e6

Please sign in to comment.