Skip to content

Commit f04ad7d

Browse files
committed
format cmake
1 parent be7dc25 commit f04ad7d

14 files changed

+89
-111
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ add_subdirectory(src)
3939
include(CTest)
4040
if(BUILD_TESTING)
4141
add_subdirectory(tests)
42-
endif()
42+
endif()
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
find_program(
22
clang_doc_exe
33
NAMES clang-doc
4-
DOC
5-
"clang-doc: generates C/C++ code documentation from source. Install: 'sudo dnf install clang-tools-extra', 'sudo apt install clang-tools-extra', 'brew install llvm', or 'choco install llvm'. Required for 'clang_doc' target."
6-
)
4+
DOC "clang-doc: generates C/C++ code documentation from source. Install: 'sudo dnf install clang-tools-extra', 'sudo apt install clang-tools-extra', 'brew install llvm', or 'choco install llvm'. Required for 'clang_doc' target."
5+
)
76

87
if(clang_doc_exe)
98
add_custom_target(
@@ -15,12 +14,11 @@ if(clang_doc_exe)
1514
VERBATIM
1615
COMMENT
1716
"running clang-doc to generate HTML documentation for all sources"
18-
USES_TERMINAL
19-
)
17+
USES_TERMINAL)
2018
else()
2119
message(
2220
NOTICE
2321
"clang-doc not found. 'clang_doc' target will not be available.\n"
2422
"install: sudo dnf install clang-tools-extra | sudo apt install clang-tools-extra | brew install llvm | choco install llvm"
25-
)
26-
endif()
23+
)
24+
endif()
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
find_program(
22
clang_format_exe
33
NAMES clang-format
4-
DOC
5-
"clang-format: automatic C/C++ code formatter. Install: 'sudo dnf install clang-tools-extra', 'sudo apt install clang-format', 'brew install llvm', or 'choco install llvm'. Required for 'clang_format' target."
6-
)
4+
DOC "clang-format: automatic C/C++ code formatter. Install: 'sudo dnf install clang-tools-extra', 'sudo apt install clang-format', 'brew install llvm', or 'choco install llvm'. Required for 'clang_format' target."
5+
)
76

87
if(clang_format_exe)
98
add_custom_target(
@@ -15,12 +14,11 @@ if(clang_format_exe)
1514
VERBATIM
1615
COMMENT
1716
"running clang-format (automatic code style formatting) on all sources"
18-
USES_TERMINAL
19-
)
17+
USES_TERMINAL)
2018
else()
2119
message(
2220
NOTICE
2321
"clang-format not found. 'clang_format' target will not be available.\n"
2422
"install: sudo dnf install clang-tools-extra | sudo apt install clang-format | brew install llvm | choco install llvm"
25-
)
26-
endif()
23+
)
24+
endif()
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
find_program(
22
clang_tidy_exe
33
NAMES clang-tidy
4-
DOC
5-
"clang-tidy: clang-based C++ linter. Install: 'sudo dnf install clang-tools-extra', 'sudo apt install clang-tidy', 'brew install llvm', or 'choco install llvm'. Required for 'clang_tidy' target."
6-
)
4+
DOC "clang-tidy: clang-based C++ linter. Install: 'sudo dnf install clang-tools-extra', 'sudo apt install clang-tidy', 'brew install llvm', or 'choco install llvm'. Required for 'clang_tidy' target."
5+
)
76

87
if(clang_tidy_exe)
98
add_custom_target(
@@ -14,12 +13,11 @@ if(clang_tidy_exe)
1413
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
1514
VERBATIM
1615
COMMENT "running clang-tidy (static analysis and lint) on all sources"
17-
USES_TERMINAL
18-
)
16+
USES_TERMINAL)
1917
else()
2018
message(
2119
NOTICE
2220
"clang-tidy not found. 'clang_tidy' target will not be available.\n"
2321
"install: sudo dnf install clang-tools-extra | sudo apt install clang-tidy | brew install llvm | choco install llvm"
24-
)
25-
endif()
22+
)
23+
endif()
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
find_program(
22
cpplint_exe
33
NAMES cpplint
4-
DOC
5-
"cpplint: C++ style checker. Install via 'pip install cpplint', 'sudo dnf install cpplint', or 'brew install cpplint'. Required for 'cpplint' target."
6-
)
4+
DOC "cpplint: C++ style checker. Install via 'pip install cpplint', 'sudo dnf install cpplint', or 'brew install cpplint'. Required for 'cpplint' target."
5+
)
76

87
if(cpplint_exe)
98
add_custom_target(
@@ -12,12 +11,11 @@ if(cpplint_exe)
1211
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
1312
VERBATIM
1413
COMMENT "running cpplint (google C++ style checker) on all sources"
15-
USES_TERMINAL
16-
)
14+
USES_TERMINAL)
1715
else()
1816
message(
1917
NOTICE
2018
"cpplint not found. 'cpplint' target will not be available.\n"
2119
"install: pip install cpplint | sudo dnf install cpplint | brew install cpplint"
22-
)
23-
endif()
20+
)
21+
endif()

cmake/code-quality/doxygen-config.cmake

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,20 @@ if(DOXYGEN_FOUND)
3333
set(DOXYGEN_MATHJAX_FORMAT TeX)
3434
set(DOXYGEN_USE_MATHJAX YES)
3535

36-
doxygen_add_docs(
37-
doxygen
38-
${PROJECT_SOURCE_DIR}
39-
ALL
40-
COMMENT "Building API documentation"
41-
)
42-
43-
install(
44-
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/generated-docs"
45-
DESTINATION "share/doc/${PROJECT_NAME}"
46-
COMPONENT documentation
47-
)
36+
doxygen_add_docs(doxygen ${PROJECT_SOURCE_DIR} ALL
37+
COMMENT "Building API documentation")
38+
39+
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/generated-docs"
40+
DESTINATION "share/doc/${PROJECT_NAME}" COMPONENT documentation)
4841
else()
4942
message(
50-
WARNING
51-
"Doxygen not found - documentation targets disabled\n"
52-
"Installation commands:\n"
53-
"\n"
54-
" Fedora: sudo dnf install doxygen graphviz\n"
55-
" Ubuntu: sudo apt install doxygen doxygen-latex\n"
56-
" macOS: brew install doxygen\n"
57-
" Windows: choco install doxygen.install\n"
58-
"\n"
59-
"Regenerate project after installation"
60-
)
43+
WARNING "Doxygen not found - documentation targets disabled\n"
44+
"Installation commands:\n"
45+
"\n"
46+
" Fedora: sudo dnf install doxygen graphviz\n"
47+
" Ubuntu: sudo apt install doxygen doxygen-latex\n"
48+
" macOS: brew install doxygen\n"
49+
" Windows: choco install doxygen.install\n"
50+
"\n"
51+
"Regenerate project after installation")
6152
endif()

cmake/cpm/doctest-config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ else()
2424
endif()
2525

2626
list(APPEND CMAKE_MODULE_PATH "${doctest_cmake_path}")
27-
message(STATUS "doctest (${doctest_source}) -> '${doctest_cmake_path}'")
27+
message(STATUS "doctest (${doctest_source}) -> '${doctest_cmake_path}'")

cmake/cpm/entt-config.cmake

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
CPMAddPackage(
2-
NAME entt
3-
GITHUB_REPOSITORY skypjack/entt
4-
GIT_TAG v3.16.0
1+
cpmaddpackage(
2+
NAME
3+
entt
4+
GITHUB_REPOSITORY
5+
skypjack/entt
6+
GIT_TAG
7+
v3.16.0
58
OPTIONS
6-
"ENTT_USE_LIBCPP ON"
7-
"ENTT_BUILD_TESTING OFF"
8-
"ENTT_BUILD_DOCS OFF"
9-
"ENTT_BUILD_BENCHMARK OFF"
10-
"ENTT_BUILD_EXAMPLES OFF"
11-
)
9+
"ENTT_USE_LIBCPP ON"
10+
"ENTT_BUILD_TESTING OFF"
11+
"ENTT_BUILD_DOCS OFF"
12+
"ENTT_BUILD_BENCHMARK OFF"
13+
"ENTT_BUILD_EXAMPLES OFF")

cmake/cpm/freetype-config.cmake

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@ cpmaddpackage(
99
VER-2-10-0
1010
VERSION
1111
2.10.0
12-
SYSTEM ON
13-
GIT_SHALLOW
12+
SYSTEM
13+
ON
14+
GIT_SHALLOW
1415
ON
1516
OPTIONS
1617
"FT_DISABLE_BZIP2 ON"
1718
"FT_DISABLE_PNG ON"
1819
"FT_DISABLE_HARFBUZZ ON"
1920
"FT_DISABLE_BROTLI ON"
2021
"FT_WITH_ZLIB OFF"
21-
"FT_ENABLE_ERROR_STRINGS OFF"
22-
)
22+
"FT_ENABLE_ERROR_STRINGS OFF")
2323

2424
set_target_properties(
25-
freetype
26-
PROPERTIES
27-
CMAKE_RC_FLAGS "$<$<C_COMPILER_ID:MSVC>:${CMAKE_RC_FLAGS} /c65001>"
28-
)
25+
freetype PROPERTIES CMAKE_RC_FLAGS
26+
"$<$<C_COMPILER_ID:MSVC>:${CMAKE_RC_FLAGS} /c65001>")
2927

3028
target_compile_options(freetype PRIVATE "$<$<C_COMPILER_ID:MSVC>:/c65001>")
3129
# Or, if you want to append, use a generator expression to only apply for MSVC:
@@ -36,4 +34,4 @@ target_compile_definitions(freetype PRIVATE "$<$<C_COMPILER_ID:MSVC>:_UNICODE>")
3634
add_library(Freetype::Freetype ALIAS freetype)
3735
set(FREETYPE_FOUND TRUE)
3836
set(FREETYPE_INCLUDE_DIRS "")
39-
set(FREETYPE_LIBRARIES Freetype::Freetype)
37+
set(FREETYPE_LIBRARIES Freetype::Freetype)

cmake/cpm/glm-config.cmake

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ cpmaddpackage(
66
GIT_TAG
77
1.0.2
88
OPTIONS
9-
"GLM_BUILD_TESTS OFF"
10-
"GLM_BUILD_INSTALL OFF"
11-
"GLM_ENABLE_CXX_20 ON"
12-
"GLM_ENABLE_LANG_EXTENSIONS ON"
13-
)
9+
"GLM_BUILD_TESTS OFF"
10+
"GLM_BUILD_INSTALL OFF"
11+
"GLM_ENABLE_CXX_20 ON"
12+
"GLM_ENABLE_LANG_EXTENSIONS ON")

0 commit comments

Comments
 (0)