fixed formating

This commit is contained in:
2026-02-20 08:52:26 +03:00
parent 7021d9d365
commit e0904690e6
4 changed files with 36 additions and 21 deletions

View File

@@ -15,7 +15,10 @@ endif()
set(EXAMPLES_BIN_DIR "${PROJECT_ROOT}/out/${CMAKE_BUILD_TYPE}")
if(NOT EXISTS "${EXAMPLES_BIN_DIR}")
message(FATAL_ERROR "Examples binary directory not found: ${EXAMPLES_BIN_DIR}. Please build the project first.")
message(
FATAL_ERROR
"Examples binary directory not found: ${EXAMPLES_BIN_DIR}. Please build the project first."
)
endif()
message(STATUS "Looking for benchmark executables in: ${EXAMPLES_BIN_DIR}")
@@ -48,11 +51,8 @@ foreach(EXAMPLE_PATH ${EXAMPLE_FILES})
message(STATUS "Running benchmark: ${FILENAME}")
message(STATUS "-------------------------------------------------")
execute_process(
COMMAND "${EXAMPLE_PATH}"
WORKING_DIRECTORY "${PROJECT_ROOT}"
RESULT_VARIABLE EXIT_CODE
)
execute_process(COMMAND "${EXAMPLE_PATH}" WORKING_DIRECTORY "${PROJECT_ROOT}"
RESULT_VARIABLE EXIT_CODE)
if(NOT EXIT_CODE EQUAL 0)
message(WARNING "Benchmark ${FILENAME} exited with error code: ${EXIT_CODE}")

View File

@@ -15,7 +15,10 @@ endif()
set(EXAMPLES_BIN_DIR "${PROJECT_ROOT}/out/${CMAKE_BUILD_TYPE}")
if(NOT EXISTS "${EXAMPLES_BIN_DIR}")
message(FATAL_ERROR "Examples binary directory not found: ${EXAMPLES_BIN_DIR}. Please build the project first.")
message(
FATAL_ERROR
"Examples binary directory not found: ${EXAMPLES_BIN_DIR}. Please build the project first."
)
endif()
message(STATUS "Looking for example executables in: ${EXAMPLES_BIN_DIR}")
@@ -48,11 +51,8 @@ foreach(EXAMPLE_PATH ${EXAMPLE_FILES})
message(STATUS "Running example: ${FILENAME}")
message(STATUS "-------------------------------------------------")
execute_process(
COMMAND "${EXAMPLE_PATH}"
WORKING_DIRECTORY "${PROJECT_ROOT}"
RESULT_VARIABLE EXIT_CODE
)
execute_process(COMMAND "${EXAMPLE_PATH}" WORKING_DIRECTORY "${PROJECT_ROOT}"
RESULT_VARIABLE EXIT_CODE)
if(NOT EXIT_CODE EQUAL 0)
message(WARNING "Example ${FILENAME} exited with error code: ${EXIT_CODE}")

View File

@@ -15,7 +15,10 @@ endif()
set(EXAMPLES_BIN_DIR "${PROJECT_ROOT}/out/${CMAKE_BUILD_TYPE}")
if(NOT EXISTS "${EXAMPLES_BIN_DIR}")
message(FATAL_ERROR "Examples binary directory not found: ${EXAMPLES_BIN_DIR}. Please build the project first.")
message(
FATAL_ERROR
"Examples binary directory not found: ${EXAMPLES_BIN_DIR}. Please build the project first."
)
endif()
message(STATUS "Looking for unit test executables in: ${EXAMPLES_BIN_DIR}")
@@ -48,11 +51,8 @@ foreach(EXAMPLE_PATH ${EXAMPLE_FILES})
message(STATUS "Running unit_tests: ${FILENAME}")
message(STATUS "-------------------------------------------------")
execute_process(
COMMAND "${EXAMPLE_PATH}"
WORKING_DIRECTORY "${PROJECT_ROOT}"
RESULT_VARIABLE EXIT_CODE
)
execute_process(COMMAND "${EXAMPLE_PATH}" WORKING_DIRECTORY "${PROJECT_ROOT}"
RESULT_VARIABLE EXIT_CODE)
if(NOT EXIT_CODE EQUAL 0)
message(WARNING "Example ${FILENAME} exited with error code: ${EXIT_CODE}")

15
scripts/cmake-format.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
# Format all CMakeLists.txt and *.cmake files in the repo (excluding common build dirs)
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$REPO_ROOT"
find . \
-path "./build" -prune -o \
-path "./cmake-build-*" -prune -o \
-path "./out" -prune -o \
-path "./.git" -prune -o \
\( -name "CMakeLists.txt" -o -name "*.cmake" \) -print0 \
| xargs -0 cmake-format -i