mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-18 15:23:26 +00:00
fixed formating
This commit is contained in:
@@ -15,7 +15,10 @@ endif()
|
|||||||
set(EXAMPLES_BIN_DIR "${PROJECT_ROOT}/out/${CMAKE_BUILD_TYPE}")
|
set(EXAMPLES_BIN_DIR "${PROJECT_ROOT}/out/${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
if(NOT EXISTS "${EXAMPLES_BIN_DIR}")
|
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()
|
endif()
|
||||||
|
|
||||||
message(STATUS "Looking for benchmark executables in: ${EXAMPLES_BIN_DIR}")
|
message(STATUS "Looking for benchmark executables in: ${EXAMPLES_BIN_DIR}")
|
||||||
@@ -43,16 +46,13 @@ foreach(EXAMPLE_PATH ${EXAMPLE_FILES})
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# On Linux/macOS, check permissions or just try to run it.
|
# On Linux/macOS, check permissions or just try to run it.
|
||||||
|
|
||||||
message(STATUS "-------------------------------------------------")
|
message(STATUS "-------------------------------------------------")
|
||||||
message(STATUS "Running benchmark: ${FILENAME}")
|
message(STATUS "Running benchmark: ${FILENAME}")
|
||||||
message(STATUS "-------------------------------------------------")
|
message(STATUS "-------------------------------------------------")
|
||||||
|
|
||||||
execute_process(
|
execute_process(COMMAND "${EXAMPLE_PATH}" WORKING_DIRECTORY "${PROJECT_ROOT}"
|
||||||
COMMAND "${EXAMPLE_PATH}"
|
RESULT_VARIABLE EXIT_CODE)
|
||||||
WORKING_DIRECTORY "${PROJECT_ROOT}"
|
|
||||||
RESULT_VARIABLE EXIT_CODE
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT EXIT_CODE EQUAL 0)
|
if(NOT EXIT_CODE EQUAL 0)
|
||||||
message(WARNING "Benchmark ${FILENAME} exited with error code: ${EXIT_CODE}")
|
message(WARNING "Benchmark ${FILENAME} exited with error code: ${EXIT_CODE}")
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ endif()
|
|||||||
set(EXAMPLES_BIN_DIR "${PROJECT_ROOT}/out/${CMAKE_BUILD_TYPE}")
|
set(EXAMPLES_BIN_DIR "${PROJECT_ROOT}/out/${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
if(NOT EXISTS "${EXAMPLES_BIN_DIR}")
|
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()
|
endif()
|
||||||
|
|
||||||
message(STATUS "Looking for example executables in: ${EXAMPLES_BIN_DIR}")
|
message(STATUS "Looking for example executables in: ${EXAMPLES_BIN_DIR}")
|
||||||
@@ -43,16 +46,13 @@ foreach(EXAMPLE_PATH ${EXAMPLE_FILES})
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# On Linux/macOS, check permissions or just try to run it.
|
# On Linux/macOS, check permissions or just try to run it.
|
||||||
|
|
||||||
message(STATUS "-------------------------------------------------")
|
message(STATUS "-------------------------------------------------")
|
||||||
message(STATUS "Running example: ${FILENAME}")
|
message(STATUS "Running example: ${FILENAME}")
|
||||||
message(STATUS "-------------------------------------------------")
|
message(STATUS "-------------------------------------------------")
|
||||||
|
|
||||||
execute_process(
|
execute_process(COMMAND "${EXAMPLE_PATH}" WORKING_DIRECTORY "${PROJECT_ROOT}"
|
||||||
COMMAND "${EXAMPLE_PATH}"
|
RESULT_VARIABLE EXIT_CODE)
|
||||||
WORKING_DIRECTORY "${PROJECT_ROOT}"
|
|
||||||
RESULT_VARIABLE EXIT_CODE
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT EXIT_CODE EQUAL 0)
|
if(NOT EXIT_CODE EQUAL 0)
|
||||||
message(WARNING "Example ${FILENAME} exited with error code: ${EXIT_CODE}")
|
message(WARNING "Example ${FILENAME} exited with error code: ${EXIT_CODE}")
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ endif()
|
|||||||
set(EXAMPLES_BIN_DIR "${PROJECT_ROOT}/out/${CMAKE_BUILD_TYPE}")
|
set(EXAMPLES_BIN_DIR "${PROJECT_ROOT}/out/${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
if(NOT EXISTS "${EXAMPLES_BIN_DIR}")
|
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()
|
endif()
|
||||||
|
|
||||||
message(STATUS "Looking for unit test executables in: ${EXAMPLES_BIN_DIR}")
|
message(STATUS "Looking for unit test executables in: ${EXAMPLES_BIN_DIR}")
|
||||||
@@ -43,16 +46,13 @@ foreach(EXAMPLE_PATH ${EXAMPLE_FILES})
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# On Linux/macOS, check permissions or just try to run it.
|
# On Linux/macOS, check permissions or just try to run it.
|
||||||
|
|
||||||
message(STATUS "-------------------------------------------------")
|
message(STATUS "-------------------------------------------------")
|
||||||
message(STATUS "Running unit_tests: ${FILENAME}")
|
message(STATUS "Running unit_tests: ${FILENAME}")
|
||||||
message(STATUS "-------------------------------------------------")
|
message(STATUS "-------------------------------------------------")
|
||||||
|
|
||||||
execute_process(
|
execute_process(COMMAND "${EXAMPLE_PATH}" WORKING_DIRECTORY "${PROJECT_ROOT}"
|
||||||
COMMAND "${EXAMPLE_PATH}"
|
RESULT_VARIABLE EXIT_CODE)
|
||||||
WORKING_DIRECTORY "${PROJECT_ROOT}"
|
|
||||||
RESULT_VARIABLE EXIT_CODE
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT EXIT_CODE EQUAL 0)
|
if(NOT EXIT_CODE EQUAL 0)
|
||||||
message(WARNING "Example ${FILENAME} exited with error code: ${EXIT_CODE}")
|
message(WARNING "Example ${FILENAME} exited with error code: ${EXIT_CODE}")
|
||||||
|
|||||||
15
scripts/cmake-format.sh
Normal file
15
scripts/cmake-format.sh
Normal 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
|
||||||
Reference in New Issue
Block a user