Skip to content

Commit 6f934a3

Browse files
Whitespace cleanup
1 parent 308fccb commit 6f934a3

22 files changed

+335
-335
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ set(STLINK_SOURCE
101101
)
102102

103103
if (WIN32 OR MSYS OR MINGW)
104-
set (STLINK_SOURCE "${STLINK_SOURCE};src/mmap.c;src/mingw/mingw.c")
105-
set (STLINK_HEADERS "${STLINK_HEADERS};src/mingw/mingw.h")
104+
set(STLINK_SOURCE "${STLINK_SOURCE};src/mmap.c;src/mingw/mingw.c")
105+
set(STLINK_HEADERS "${STLINK_HEADERS};src/mingw/mingw.h")
106106
endif ()
107107

108108
include_directories(${LIBUSB_INCLUDE_DIR})

cmake/c_flag_overrides.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
if(MSVC)
1+
if (MSVC)
22
message(STATUS "MSVC C Flags override to /MT")
33
set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
44
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
55
set(CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
66
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
7-
endif()
7+
endif ()

cmake/c_flags.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function(add_cflag_if_supported flag)
1111

1212
if (C_SUPPORTS${flagclean})
1313
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE)
14-
endif()
14+
endif ()
1515
endfunction()
1616

1717
add_cflag_if_supported("-std=gnu11")
@@ -41,10 +41,10 @@ if (NOT WIN32)
4141
add_cflag_if_supported("-fPIC")
4242
endif ()
4343

44-
if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
44+
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
4545
add_cflag_if_supported("-ggdb")
4646
add_cflag_if_supported("-O0")
4747
else()
4848
add_cflag_if_supported("-O2")
4949
add_cflag_if_supported("-Werror")
50-
endif()
50+
endif ()

cmake/cpack_config.cmake

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
set (CPACK_PACKAGE_NAME ${PROJECT_NAME})
2-
set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
3-
set (CPACK_SET_DESTDIR "ON")
1+
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
2+
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
3+
set(CPACK_SET_DESTDIR "ON")
44

55
if (APPLE)
66
set(CPACK_GENERATOR "ZIP")
77
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-macosx-amd64")
88
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dist/osx")
9-
set (CPACK_INSTALL_PREFIX "")
9+
set(CPACK_INSTALL_PREFIX "")
1010
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/dist/osx")
1111
elseif (WIN32)
1212
set(CPACK_GENERATOR "ZIP")
1313
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dist/windows")
14-
set (CPACK_INSTALL_PREFIX "")
14+
set(CPACK_INSTALL_PREFIX "")
1515
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/dist/windows")
1616
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND EXISTS "/etc/debian_version")
1717
message(STATUS "Debian-based Linux OS detected")
1818
set(CPACK_GENERATOR "DEB")
1919
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
2020
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}-amd64" )
21-
endif()
21+
endif ()
2222

2323
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/stlink-org/stlink")
2424
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Luca Boccassi")
2525
set(CPACK_PACKAGE_CONTACT "[email protected]")
2626
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "STM32 STlink programmer tools")
27-
endif()
27+
endif ()

cmake/modules/FindLibUSB.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ else () # all other OS
7777
LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
7878
HINTS /usr /usr/local /opt
7979
)
80-
endif()
80+
endif ()
8181

8282
include(FindPackageHandleStandardArgs)
8383
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Libusb DEFAULT_MSG LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR)

cmake/modules/pandocology.cmake

+20-20
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242

4343
include(CMakeParseArguments)
4444

45-
if(NOT EXISTS ${PANDOC_EXECUTABLE})
45+
if (NOT EXISTS ${PANDOC_EXECUTABLE})
4646
find_program(PANDOC_EXECUTABLE pandoc)
4747
mark_as_advanced(PANDOC_EXECUTABLE)
48-
endif()
48+
endif ()
4949

5050
###############################################################################
5151
# Based on code from UseLATEX
@@ -133,7 +133,7 @@ This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
133133
Please delete them:
134134
$ rm -r CMakeFiles/ CmakeCache.txt
135135
")
136-
ENDIF()
136+
ENDif ()
137137
endfunction()
138138

139139
# This builds a document
@@ -171,7 +171,7 @@ function(add_document target_name)
171171
if (NOT PANDOC_EXECUTABLE)
172172
message(WARNING "Pandoc not found. Install Pandoc (http://johnmacfarlane.net/pandoc/) or set cache variable PANDOC_EXECUTABLE.")
173173
return()
174-
endif()
174+
endif ()
175175

176176
set(options EXPORT_ARCHIVE NO_EXPORT_PRODUCT EXPORT_PDF DIRECT_TEX_TO_PDF VERBOSE)
177177
set(oneValueArgs PRODUCT_DIRECTORY)
@@ -188,29 +188,29 @@ function(add_document target_name)
188188
if (NOT "${target_extension}" STREQUAL ".tex" AND NOT "${target_extension}" STREQUAL ".latex")
189189
# if (NOT "${target_extension}" STREQUAL ".tex")
190190
MESSAGE(FATAL_ERROR "Target '${target_name}': Cannot use 'EXPORT_PDF' for target of type '${target_extension}': target type must be '.tex' or '.latex'")
191-
endif()
192-
endif()
191+
endif ()
192+
endif ()
193193
if (${ADD_DOCUMENT_DIRECT_TEX_TO_PDF})
194194
list(LENGTH ${ADD_DOCUMENT_SOURCES} SOURCE_LEN)
195195
if (SOURCE_LEN GREATER 1)
196196
MESSAGE(FATAL_ERROR "Target '${target_name}': Only one source can be specified when using the 'DIRECT_TEX_TO_PDF' option")
197-
endif()
197+
endif ()
198198
# set(ADD_DOCUMENT_SOURCES, list(GET ${ADD_DOCUMENT_SOURCES} 1))
199199
pandocology_get_file_stemname(source_stemname ${ADD_DOCUMENT_SOURCES})
200200
pandocology_get_file_extension(source_extension ${ADD_DOCUMENT_SOURCES})
201201
if (NOT "${source_extension}" STREQUAL ".tex" AND NOT "${source_extension}" STREQUAL ".latex")
202202
MESSAGE(FATAL_ERROR "Target '${target_name}': Cannot use 'DIRECT_TEX_TO_PDF' for source of type '${source_extension}': source type must be '.tex' or '.latex'")
203-
endif()
203+
endif ()
204204
SET(check_target ${source_stemname}.pdf)
205205
IF (NOT ${check_target} STREQUAL ${target_name})
206206
MESSAGE(FATAL_ERROR "Target '${target_name}': Must use target name of '${check_target}' if using 'DIRECT_TEX_TO_PDF'")
207-
endif()
208-
endif()
207+
endif ()
208+
endif ()
209209

210210
## set up output directory
211211
if ("${ADD_DOCUMENT_PRODUCT_DIRECTORY}" STREQUAL "")
212212
set(ADD_DOCUMENT_PRODUCT_DIRECTORY "product")
213-
endif()
213+
endif ()
214214
get_filename_component(product_directory ${CMAKE_BINARY_DIR}/${ADD_DOCUMENT_PRODUCT_DIRECTORY} ABSOLUTE)
215215
# get_filename_component(absolute_product_path ${product_directory}/${target_name} ABSOLUTE)
216216

@@ -232,7 +232,7 @@ function(add_document target_name)
232232
pandocology_add_input_dir(${CMAKE_CURRENT_SOURCE_DIR}/${resource_dir} ${CMAKE_CURRENT_BINARY_DIR} build_resources)
233233
if (${ADD_DOCUMENT_EXPORT_ARCHIVE})
234234
pandocology_add_input_dir(${CMAKE_CURRENT_SOURCE_DIR}/${resource_dir} ${product_directory} exported_resources)
235-
endif()
235+
endif ()
236236
endforeach()
237237

238238
## primary command
@@ -255,7 +255,7 @@ function(add_document target_name)
255255
# we produce the target in the source directory, in case other build targets require it as a source
256256
COMMAND latexmk -gg -halt-on-error -interaction=nonstopmode -file-line-error -pdf ${build_sources} 2>/dev/null >/dev/null || (grep --no-messages -A8 ".*:[0-9]*:.*" ${target_stemname}.log && false)
257257
)
258-
endif()
258+
endif ()
259259
add_to_make_clean(${CMAKE_CURRENT_BINARY_DIR}/${target_name})
260260
else()
261261
add_custom_command(
@@ -267,22 +267,22 @@ function(add_document target_name)
267267
COMMAND ${PANDOC_EXECUTABLE} ${build_sources} ${ADD_DOCUMENT_PANDOC_DIRECTIVES} -o ${target_name}
268268
)
269269
add_to_make_clean(${CMAKE_CURRENT_BINARY_DIR}/${target_name})
270-
endif()
270+
endif ()
271271

272272
## figure out what all is going to be produced by this build set, and set
273273
## those as dependencies of the primary target
274274
set(primary_target_dependencies)
275275
set(primary_target_dependencies ${primary_target_dependencies} ${CMAKE_CURRENT_BINARY_DIR}/${target_name})
276276
if (NOT ${ADD_DOCUMENT_NO_EXPORT_PRODUCT})
277277
set(primary_target_dependencies ${primary_target_dependencies} ${product_directory}/${target_name})
278-
endif()
278+
endif ()
279279
if (${ADD_DOCUMENT_EXPORT_PDF})
280280
set(primary_target_dependencies ${primary_target_dependencies} ${CMAKE_CURRENT_BINARY_DIR}/${target_stemname}.pdf)
281281
set(primary_target_dependencies ${primary_target_dependencies} ${product_directory}/${target_stemname}.pdf)
282-
endif()
282+
endif ()
283283
if (${ADD_DOCUMENT_EXPORT_ARCHIVE})
284284
set(primary_target_dependencies ${primary_target_dependencies} ${product_directory}/${target_stemname}.tbz)
285-
endif()
285+
endif ()
286286

287287
## primary target
288288
# # target cannot have same (absolute name) as dependencies:
@@ -326,7 +326,7 @@ function(add_document target_name)
326326
)
327327
add_to_make_clean(${CMAKE_CURRENT_BINARY_DIR}/${target_stemname}.pdf)
328328
add_to_make_clean(${product_directory}/${target_stemname}.pdf)
329-
endif()
329+
endif ()
330330

331331
## copy products
332332
if (NOT ${ADD_DOCUMENT_NO_EXPORT_PRODUCT})
@@ -336,7 +336,7 @@ function(add_document target_name)
336336
COMMAND ${CMAKE_COMMAND} -E copy ${target_name} ${product_directory}
337337
)
338338
add_to_make_clean(${product_directory}/${target_name})
339-
endif()
339+
endif ()
340340

341341
## copy resources
342342
if (${ADD_DOCUMENT_EXPORT_ARCHIVE})
@@ -359,7 +359,7 @@ function(add_document target_name)
359359
# ALL
360360
# DEPENDS ${product_directory}/${target_stemname}.tbz
361361
# )
362-
endif()
362+
endif ()
363363

364364
endfunction(add_document)
365365

cmake/version.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
2727
)
2828

2929
if (res EQUAL 1)
30-
set (PROJECT_VERSION "${PROJECT_VERSION}-dirty")
30+
set(PROJECT_VERSION "${PROJECT_VERSION}-dirty")
3131
endif ()
3232

3333
# strip a leading v off of the version as proceeding code expectes just the version numbering.
@@ -57,7 +57,7 @@ if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
5757
else(GIT_DESCRIBE_RESULT EQUAL 0)
5858
message(WARNING "git describe failed.")
5959
message(WARNING "${GIT_DESCRIBE_ERROR}")
60-
endif(GIT_DESCRIBE_RESULT EQUAL 0)
60+
endif (GIT_DESCRIBE_RESULT EQUAL 0)
6161
else ()
6262
message(STATUS "Git or repo not found.")
6363
endif ()

cmake_uninstall.cmake.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
1+
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
22
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
3-
endif()
3+
endif ()
44

55
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
66
string(REGEX REPLACE "\n" ";" files "${files}")

doc/man/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ foreach (manpage ${MANPAGES})
2323
set(f "${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1")
2424
else()
2525
message(AUTHOR_WARNING "Manpage ${manpage} not generated")
26-
endif()
26+
endif ()
2727

2828
if (f AND NOT WIN32)
2929
install(FILES ${f} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)

0 commit comments

Comments
 (0)