Skip to content

Commit 8ed9464

Browse files
Automatic CMake Format: Standardized formatting automatically
1 parent 4a075d6 commit 8ed9464

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

Autogen/CAN/CANfigurator.cmake

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,41 @@
11
# --- 1. Define Paths ---
2-
set(CAN_DIR "${CMAKE_CURRENT_LIST_DIR}")
2+
set(CAN_DIR "${CMAKE_CURRENT_LIST_DIR}")
33
set(YAML_INPUT "${CAN_DIR}/Doc/format.CANdo")
4-
set(INC_DIR "${CAN_DIR}/Inc")
4+
set(INC_DIR "${CAN_DIR}/Inc")
55
set(SCRIPT_DIR "${CAN_DIR}/Src")
66

77
# error handling
88
function(run_can_parser script_name output_file)
9-
execute_process(
10-
COMMAND perl "${SCRIPT_DIR}/${script_name}" "${YAML_INPUT}" "${INC_DIR}/${output_file}"
11-
RESULT_VARIABLE result
12-
ERROR_VARIABLE error_output
13-
)
14-
15-
if(NOT result EQUAL 0)
16-
message(FATAL_ERROR
17-
"\n[CANfigurator] FAILED to run ${script_name}\n"
18-
"Exit Code: ${result}\n"
19-
"Error Message: ${error_output}\n"
20-
)
21-
endif()
9+
execute_process(
10+
COMMAND
11+
perl "${SCRIPT_DIR}/${script_name}" "${YAML_INPUT}"
12+
"${INC_DIR}/${output_file}"
13+
RESULT_VARIABLE result
14+
ERROR_VARIABLE error_output
15+
)
16+
17+
if(NOT result EQUAL 0)
18+
message(
19+
FATAL_ERROR
20+
"\n[CANfigurator] FAILED to run ${script_name}\n"
21+
"Exit Code: ${result}\n"
22+
"Error Message: ${error_output}\n"
23+
)
24+
endif()
2225
endfunction()
2326

2427
function(run_perl_files)
25-
run_can_parser("CANdlerparser.pl" "CANDler.h")
26-
run_can_parser("CANparser.pl" "Custom_CAN_ID.h")
27-
run_can_parser("GRparser.pl" "GR_IDS.h")
28-
run_can_parser("MSGparser.pl" "can_msg_ids.h")
28+
run_can_parser("CANdlerparser.pl" "CANDler.h")
29+
run_can_parser("CANparser.pl" "Custom_CAN_ID.h")
30+
run_can_parser("GRparser.pl" "GR_IDS.h")
31+
run_can_parser("MSGparser.pl" "can_msg_ids.h")
2932
endfunction()
3033

3134
# --- 3. Execute Commands --
32-
execute_process(COMMAND mkdir -p "${INC_DIR}")
35+
execute_process(
36+
COMMAND
37+
mkdir -p "${INC_DIR}"
38+
)
3339

3440
message(STATUS "CANfigurator: Generating headers in ${INC_DIR}")
3541

@@ -38,8 +44,4 @@ run_perl_files()
3844
# --- 4. The Interface Library ---
3945
add_library(CANfigurator INTERFACE)
4046

41-
target_include_directories(
42-
CANfigurator
43-
INTERFACE
44-
"${INC_DIR}"
45-
)
47+
target_include_directories(CANfigurator INTERFACE "${INC_DIR}")

0 commit comments

Comments
 (0)