Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cb92cc5

Browse files
author
werewolf
committed
change readme
1 parent a17f078 commit cb92cc5

File tree

21 files changed

+292
-205
lines changed

21 files changed

+292
-205
lines changed

‎.gitattributes‎

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

‎.gitignore‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ Module.symvers
5050
Mkfile.old
5151
dkms.conf
5252

53-
.vscode
53+
# CMake Files
54+
CMakeLists.txt.*
55+
56+
# MacOS files
5457
.DS_Store
55-
build*
56-
CMakeLists.txt.*
58+
59+
# IDE files
60+
.idea
61+
.vscode
62+
63+
# Directory
64+
build*

‎.gitkeep‎

Whitespace-only changes.

‎CMakeLists.txt‎

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.15)
22

3-
project(DNA_Analyzer VERSION 1.0 LANGUAGES CXX)
3+
project(TextAlgorithms VERSION 1.0.0 LANGUAGES CXX)
44

55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -11,20 +11,81 @@ include_directories(
1111
)
1212

1313
set(HEADERS
14-
algorithm/DNA_Analyzer.h
15-
interface/ainterface.h
16-
interface/interface.h
14+
${CMAKE_SOURCE_DIR}/algorithm/model.h
15+
${CMAKE_SOURCE_DIR}/interface/ainterface.h
16+
${CMAKE_SOURCE_DIR}/interface/interface.h
1717
)
1818

1919
set(SOURCES
20-
algorithm/DNA_Analyzer.cc
21-
interface/ainterface.cc
22-
interface/interface.cc
20+
${CMAKE_SOURCE_DIR}/algorithm/model.cc
21+
${CMAKE_SOURCE_DIR}/interface/ainterface.cc
22+
${CMAKE_SOURCE_DIR}/interface/interface.cc
2323
)
2424

2525
add_executable(
2626
${PROJECT_NAME}
2727
${HEADERS}
2828
${SOURCES}
29-
main.cc
30-
)
29+
${CMAKE_SOURCE_DIR}/main.cc
30+
)
31+
32+
target_compile_options(
33+
${PROJECT_NAME}
34+
PRIVATE
35+
-Wall
36+
-Werror
37+
-Wextra
38+
-Wpedantic
39+
-fsanitize=address
40+
)
41+
42+
target_link_libraries(${PROJECT_NAME} PRIVATE
43+
-fsanitize=address
44+
)
45+
46+
# Add cppcheck
47+
find_program(CPPCHECK cppcheck)
48+
49+
if(CPPCHECK)
50+
message(STATUS "cppcheck found: ${CPPCHECK}")
51+
list(
52+
APPEND CPPCHECK_ARGS
53+
"--enable=all"
54+
"--inconclusive"
55+
"--quiet"
56+
"--language=c++"
57+
"--std=c++17"
58+
"--suppress=unusedFunction"
59+
"--suppress=missingInclude"
60+
"--suppress=unusedStructMember"
61+
"--suppress=functionStatic"
62+
"--suppress=invalidScanfArgType_int"
63+
"--suppress=ignoredReturnValue"
64+
"--suppress=*:${PROJECT_SOURCE_DIR}/lib/*"
65+
)
66+
add_custom_target(
67+
cppcheck
68+
COMMAND ${CPPCHECK} ${CPPCHECK_ARGS} ${HEADERS} ${SOURCES}
69+
)
70+
else()
71+
message(STATUS "cppcheck not found")
72+
endif()
73+
74+
# Add clang-format
75+
find_program(CLANG_FORMAT clang-format)
76+
77+
if(CLANG_FORMAT)
78+
message(STATUS "clang-format found: ${CLANG_FORMAT}")
79+
list(
80+
APPEND CLANG_ARGS
81+
"-i"
82+
"-style=Google"
83+
"--verbose"
84+
)
85+
add_custom_target(
86+
clang-format
87+
COMMAND ${CLANG_FORMAT} ${CLANG_ARGS} ${HEADERS} ${SOURCES}
88+
)
89+
else()
90+
message(STATUS "clang-format not found")
91+
endif()

‎Makefile‎

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
all: clean app
1+
all: build
22

3-
clean:
3+
build: install
4+
5+
rebuild: clean install
6+
7+
install:
8+
cmake -S . -B ./build
9+
cmake --build ./build
10+
11+
unistall:
412
find ./ -name "build" -type d -exec rm -rf {} +
513

6-
test:
7-
cmake -S ./tests -B ./tests/build
8-
cmake --build ./tests/build
9-
./tests/build/TEST
14+
clean: unistall
15+
rm -rf ./lib/*
16+
17+
tests:
18+
cmake -S ./test/ -B ./test/build
19+
cmake --build ./test/build
20+
./test/build/TEST
21+
22+
cppcheck: install
23+
@cd build/; make cppcheck
1024

11-
app:
12-
cmake -S . -B build
13-
cmake --build build
25+
clang-format: install
26+
@cd build/; make clang-format
1427

15-
run:
16-
./build/DNA_Analyzer
28+
.PHONY: all build rebuild unistall clean cppcheck clang-format tests

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /