CMake: resolve linting issues
Improve indentation according to the .editorconfig style. Write commands in lowercase letters. Break long lines. Remove double keywords (PRIVATE). Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>pull/534/head
parent
465ee7c203
commit
fbd097edf6
101
CMakeLists.txt
101
CMakeLists.txt
|
|
@ -31,71 +31,71 @@ include_directories (./include)
|
||||||
check_function_exists(fork HAVE_FORK)
|
check_function_exists(fork HAVE_FORK)
|
||||||
|
|
||||||
set(PROGRAMS_CANLIB
|
set(PROGRAMS_CANLIB
|
||||||
asc2log
|
asc2log
|
||||||
canbusload
|
canbusload
|
||||||
candump
|
candump
|
||||||
cangen
|
cangen
|
||||||
canplayer
|
canplayer
|
||||||
cansend
|
cansend
|
||||||
cansequence
|
cansequence
|
||||||
log2asc
|
log2asc
|
||||||
log2long
|
log2long
|
||||||
slcanpty
|
slcanpty
|
||||||
)
|
)
|
||||||
|
|
||||||
if(HAVE_FORK)
|
if(HAVE_FORK)
|
||||||
list(APPEND PROGRAMS_CANLIB canlogserver)
|
list(APPEND PROGRAMS_CANLIB canlogserver)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PROGRAMS_J1939
|
set(PROGRAMS_J1939
|
||||||
j1939acd
|
j1939acd
|
||||||
j1939cat
|
j1939cat
|
||||||
j1939spy
|
j1939spy
|
||||||
j1939sr
|
j1939sr
|
||||||
testj1939
|
testj1939
|
||||||
)
|
)
|
||||||
|
|
||||||
set(PROGRAMS_ISOBUSFS
|
set(PROGRAMS_ISOBUSFS
|
||||||
isobusfs-srv
|
isobusfs-srv
|
||||||
isobusfs-cli
|
isobusfs-cli
|
||||||
)
|
)
|
||||||
|
|
||||||
set(PROGRAMS
|
set(PROGRAMS
|
||||||
${PROGRAMS_CANLIB}
|
${PROGRAMS_CANLIB}
|
||||||
canfdtest
|
canfdtest
|
||||||
cangw
|
cangw
|
||||||
cansniffer
|
cansniffer
|
||||||
isotpdump
|
isotpdump
|
||||||
isotpperf
|
isotpperf
|
||||||
isotprecv
|
isotprecv
|
||||||
isotpsend
|
isotpsend
|
||||||
isotpsniffer
|
isotpsniffer
|
||||||
isotptun
|
isotptun
|
||||||
slcan_attach
|
slcan_attach
|
||||||
slcand
|
slcand
|
||||||
)
|
)
|
||||||
|
|
||||||
if(HAVE_FORK)
|
if(HAVE_FORK)
|
||||||
list(APPEND PROGRAMS bcmserver)
|
list(APPEND PROGRAMS bcmserver)
|
||||||
list(APPEND PROGRAMS isotpserver)
|
list(APPEND PROGRAMS isotpserver)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(can-calc-bit-timing
|
add_executable(can-calc-bit-timing
|
||||||
calc-bit-timing/can-calc-bit-timing.c
|
calc-bit-timing/can-calc-bit-timing.c
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(mcp251xfd-dump
|
add_executable(mcp251xfd-dump
|
||||||
mcp251xfd/mcp251xfd-dev-coredump.c
|
mcp251xfd/mcp251xfd-dev-coredump.c
|
||||||
mcp251xfd/mcp251xfd-dump.c
|
mcp251xfd/mcp251xfd-dump.c
|
||||||
mcp251xfd/mcp251xfd-main.c
|
mcp251xfd/mcp251xfd-main.c
|
||||||
mcp251xfd/mcp251xfd-regmap.c
|
mcp251xfd/mcp251xfd-regmap.c
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT ANDROID)
|
if(NOT ANDROID)
|
||||||
list(APPEND PROGRAMS ${PROGRAMS_J1939})
|
list(APPEND PROGRAMS ${PROGRAMS_J1939})
|
||||||
|
|
||||||
add_library(j1939 STATIC
|
add_library(j1939 STATIC
|
||||||
libj1939.c
|
libj1939.c
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(isobusfs SHARED
|
add_library(isobusfs SHARED
|
||||||
|
|
@ -127,8 +127,7 @@ if(NOT ANDROID)
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(isobusfs-cli
|
target_link_libraries(isobusfs-cli
|
||||||
PRIVATE isobusfs
|
PRIVATE isobusfs can
|
||||||
PRIVATE can
|
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(isobusfs-srv
|
add_executable(isobusfs-srv
|
||||||
|
|
@ -142,8 +141,7 @@ if(NOT ANDROID)
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(isobusfs-srv
|
target_link_libraries(isobusfs-srv
|
||||||
PRIVATE isobusfs
|
PRIVATE isobusfs can
|
||||||
PRIVATE can
|
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS
|
install(TARGETS
|
||||||
|
|
@ -153,8 +151,8 @@ if(NOT ANDROID)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(can STATIC
|
add_library(can STATIC
|
||||||
lib.c
|
lib.c
|
||||||
canframelen.c
|
canframelen.c
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(name ${PROGRAMS})
|
foreach(name ${PROGRAMS})
|
||||||
|
|
@ -162,17 +160,24 @@ foreach(name ${PROGRAMS})
|
||||||
|
|
||||||
if("${name}" IN_LIST PROGRAMS_J1939)
|
if("${name}" IN_LIST PROGRAMS_J1939)
|
||||||
target_link_libraries(${name}
|
target_link_libraries(${name}
|
||||||
PRIVATE j1939
|
PRIVATE j1939
|
||||||
)
|
)
|
||||||
elseif("${name}" IN_LIST PROGRAMS_CANLIB)
|
elseif("${name}" IN_LIST PROGRAMS_CANLIB)
|
||||||
target_link_libraries(${name}
|
target_link_libraries(${name}
|
||||||
PRIVATE can
|
PRIVATE can
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
install(TARGETS can-calc-bit-timing mcp251xfd-dump DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS
|
||||||
|
can-calc-bit-timing
|
||||||
|
mcp251xfd-dump
|
||||||
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
)
|
||||||
|
|
||||||
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_SOURCE_DIR}/cmake/make_uninstall.cmake")
|
add_custom_target(uninstall
|
||||||
|
"${CMAKE_COMMAND}" -P "${CMAKE_SOURCE_DIR}/cmake/make_uninstall.cmake"
|
||||||
|
COMMENT "Add uninstall target"
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,24 @@
|
||||||
|
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
|
||||||
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
|
message(FATAL_ERROR
|
||||||
message(FATAL_ERROR "Cannot find install manifest: ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
|
"Cannot find install manifest: \
|
||||||
endif()
|
${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt"
|
||||||
|
)
|
||||||
file(READ "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" files)
|
endif()
|
||||||
string(REGEX REPLACE "[\r\n]" ";" files "${files}")
|
|
||||||
|
file(READ "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt" files)
|
||||||
foreach(file ${files})
|
string(REGEX REPLACE "[\r\n]" ";" files "${files}")
|
||||||
message(STATUS "Uninstalling ${file}")
|
|
||||||
if(EXISTS "${file}")
|
foreach(file ${files})
|
||||||
file(REMOVE ${file})
|
message(STATUS "Uninstalling ${file}")
|
||||||
if (EXISTS "${file}")
|
if(EXISTS "${file}")
|
||||||
message(FATAL_ERROR "Problem when removing ${file}, please check your permissions")
|
file(REMOVE ${file})
|
||||||
endif()
|
if (EXISTS "${file}")
|
||||||
else()
|
message(
|
||||||
message(STATUS "File ${file} does not exist.")
|
FATAL_ERROR "Problem when removing ${file}, \
|
||||||
endif()
|
please check your permissions"
|
||||||
endforeach()
|
)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "File ${file} does not exist.")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue