Skip to content

Commit

Permalink
Whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightwalker-87 committed Apr 15, 2020
1 parent 308fccb commit 6f934a3
Show file tree
Hide file tree
Showing 22 changed files with 335 additions and 335 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ set(STLINK_SOURCE
)

if (WIN32 OR MSYS OR MINGW)
set (STLINK_SOURCE "${STLINK_SOURCE};src/mmap.c;src/mingw/mingw.c")
set (STLINK_HEADERS "${STLINK_HEADERS};src/mingw/mingw.h")
set(STLINK_SOURCE "${STLINK_SOURCE};src/mmap.c;src/mingw/mingw.c")
set(STLINK_HEADERS "${STLINK_HEADERS};src/mingw/mingw.h")
endif ()

include_directories(${LIBUSB_INCLUDE_DIR})
Expand Down
4 changes: 2 additions & 2 deletions cmake/c_flag_overrides.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if(MSVC)
if (MSVC)
message(STATUS "MSVC C Flags override to /MT")
set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
set(CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
endif()
endif ()
6 changes: 3 additions & 3 deletions cmake/c_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function(add_cflag_if_supported flag)

if (C_SUPPORTS${flagclean})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE)
endif()
endif ()
endfunction()

add_cflag_if_supported("-std=gnu11")
Expand Down Expand Up @@ -41,10 +41,10 @@ if (NOT WIN32)
add_cflag_if_supported("-fPIC")
endif ()

if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
add_cflag_if_supported("-ggdb")
add_cflag_if_supported("-O0")
else()
add_cflag_if_supported("-O2")
add_cflag_if_supported("-Werror")
endif()
endif ()
14 changes: 7 additions & 7 deletions cmake/cpack_config.cmake
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
set (CPACK_PACKAGE_NAME ${PROJECT_NAME})
set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set (CPACK_SET_DESTDIR "ON")
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_SET_DESTDIR "ON")

if (APPLE)
set(CPACK_GENERATOR "ZIP")
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-macosx-amd64")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dist/osx")
set (CPACK_INSTALL_PREFIX "")
set(CPACK_INSTALL_PREFIX "")
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/dist/osx")
elseif (WIN32)
set(CPACK_GENERATOR "ZIP")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dist/windows")
set (CPACK_INSTALL_PREFIX "")
set(CPACK_INSTALL_PREFIX "")
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/dist/windows")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND EXISTS "/etc/debian_version")
message(STATUS "Debian-based Linux OS detected")
set(CPACK_GENERATOR "DEB")
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}-amd64" )
endif()
endif ()

set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/stlink-org/stlink")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Luca Boccassi")
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "STM32 STlink programmer tools")
endif()
endif ()
2 changes: 1 addition & 1 deletion cmake/modules/FindLibUSB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ else () # all other OS
LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
HINTS /usr /usr/local /opt
)
endif()
endif ()

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Libusb DEFAULT_MSG LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR)
Expand Down
40 changes: 20 additions & 20 deletions cmake/modules/pandocology.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@

include(CMakeParseArguments)

if(NOT EXISTS ${PANDOC_EXECUTABLE})
if (NOT EXISTS ${PANDOC_EXECUTABLE})
find_program(PANDOC_EXECUTABLE pandoc)
mark_as_advanced(PANDOC_EXECUTABLE)
endif()
endif ()

###############################################################################
# Based on code from UseLATEX
Expand Down Expand Up @@ -133,7 +133,7 @@ This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
Please delete them:
$ rm -r CMakeFiles/ CmakeCache.txt
")
ENDIF()
ENDif ()
endfunction()

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

set(options EXPORT_ARCHIVE NO_EXPORT_PRODUCT EXPORT_PDF DIRECT_TEX_TO_PDF VERBOSE)
set(oneValueArgs PRODUCT_DIRECTORY)
Expand All @@ -188,29 +188,29 @@ function(add_document target_name)
if (NOT "${target_extension}" STREQUAL ".tex" AND NOT "${target_extension}" STREQUAL ".latex")
# if (NOT "${target_extension}" STREQUAL ".tex")
MESSAGE(FATAL_ERROR "Target '${target_name}': Cannot use 'EXPORT_PDF' for target of type '${target_extension}': target type must be '.tex' or '.latex'")
endif()
endif()
endif ()
endif ()
if (${ADD_DOCUMENT_DIRECT_TEX_TO_PDF})
list(LENGTH ${ADD_DOCUMENT_SOURCES} SOURCE_LEN)
if (SOURCE_LEN GREATER 1)
MESSAGE(FATAL_ERROR "Target '${target_name}': Only one source can be specified when using the 'DIRECT_TEX_TO_PDF' option")
endif()
endif ()
# set(ADD_DOCUMENT_SOURCES, list(GET ${ADD_DOCUMENT_SOURCES} 1))
pandocology_get_file_stemname(source_stemname ${ADD_DOCUMENT_SOURCES})
pandocology_get_file_extension(source_extension ${ADD_DOCUMENT_SOURCES})
if (NOT "${source_extension}" STREQUAL ".tex" AND NOT "${source_extension}" STREQUAL ".latex")
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'")
endif()
endif ()
SET(check_target ${source_stemname}.pdf)
IF (NOT ${check_target} STREQUAL ${target_name})
MESSAGE(FATAL_ERROR "Target '${target_name}': Must use target name of '${check_target}' if using 'DIRECT_TEX_TO_PDF'")
endif()
endif()
endif ()
endif ()

## set up output directory
if ("${ADD_DOCUMENT_PRODUCT_DIRECTORY}" STREQUAL "")
set(ADD_DOCUMENT_PRODUCT_DIRECTORY "product")
endif()
endif ()
get_filename_component(product_directory ${CMAKE_BINARY_DIR}/${ADD_DOCUMENT_PRODUCT_DIRECTORY} ABSOLUTE)
# get_filename_component(absolute_product_path ${product_directory}/${target_name} ABSOLUTE)

Expand All @@ -232,7 +232,7 @@ function(add_document target_name)
pandocology_add_input_dir(${CMAKE_CURRENT_SOURCE_DIR}/${resource_dir} ${CMAKE_CURRENT_BINARY_DIR} build_resources)
if (${ADD_DOCUMENT_EXPORT_ARCHIVE})
pandocology_add_input_dir(${CMAKE_CURRENT_SOURCE_DIR}/${resource_dir} ${product_directory} exported_resources)
endif()
endif ()
endforeach()

## primary command
Expand All @@ -255,7 +255,7 @@ function(add_document target_name)
# we produce the target in the source directory, in case other build targets require it as a source
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)
)
endif()
endif ()
add_to_make_clean(${CMAKE_CURRENT_BINARY_DIR}/${target_name})
else()
add_custom_command(
Expand All @@ -267,22 +267,22 @@ function(add_document target_name)
COMMAND ${PANDOC_EXECUTABLE} ${build_sources} ${ADD_DOCUMENT_PANDOC_DIRECTIVES} -o ${target_name}
)
add_to_make_clean(${CMAKE_CURRENT_BINARY_DIR}/${target_name})
endif()
endif ()

## figure out what all is going to be produced by this build set, and set
## those as dependencies of the primary target
set(primary_target_dependencies)
set(primary_target_dependencies ${primary_target_dependencies} ${CMAKE_CURRENT_BINARY_DIR}/${target_name})
if (NOT ${ADD_DOCUMENT_NO_EXPORT_PRODUCT})
set(primary_target_dependencies ${primary_target_dependencies} ${product_directory}/${target_name})
endif()
endif ()
if (${ADD_DOCUMENT_EXPORT_PDF})
set(primary_target_dependencies ${primary_target_dependencies} ${CMAKE_CURRENT_BINARY_DIR}/${target_stemname}.pdf)
set(primary_target_dependencies ${primary_target_dependencies} ${product_directory}/${target_stemname}.pdf)
endif()
endif ()
if (${ADD_DOCUMENT_EXPORT_ARCHIVE})
set(primary_target_dependencies ${primary_target_dependencies} ${product_directory}/${target_stemname}.tbz)
endif()
endif ()

## primary target
# # target cannot have same (absolute name) as dependencies:
Expand Down Expand Up @@ -326,7 +326,7 @@ function(add_document target_name)
)
add_to_make_clean(${CMAKE_CURRENT_BINARY_DIR}/${target_stemname}.pdf)
add_to_make_clean(${product_directory}/${target_stemname}.pdf)
endif()
endif ()

## copy products
if (NOT ${ADD_DOCUMENT_NO_EXPORT_PRODUCT})
Expand All @@ -336,7 +336,7 @@ function(add_document target_name)
COMMAND ${CMAKE_COMMAND} -E copy ${target_name} ${product_directory}
)
add_to_make_clean(${product_directory}/${target_name})
endif()
endif ()

## copy resources
if (${ADD_DOCUMENT_EXPORT_ARCHIVE})
Expand All @@ -359,7 +359,7 @@ function(add_document target_name)
# ALL
# DEPENDS ${product_directory}/${target_stemname}.tbz
# )
endif()
endif ()

endfunction(add_document)

Expand Down
4 changes: 2 additions & 2 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
)

if (res EQUAL 1)
set (PROJECT_VERSION "${PROJECT_VERSION}-dirty")
set(PROJECT_VERSION "${PROJECT_VERSION}-dirty")
endif ()

# strip a leading v off of the version as proceeding code expectes just the version numbering.
Expand Down Expand Up @@ -57,7 +57,7 @@ if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
else(GIT_DESCRIBE_RESULT EQUAL 0)
message(WARNING "git describe failed.")
message(WARNING "${GIT_DESCRIBE_ERROR}")
endif(GIT_DESCRIBE_RESULT EQUAL 0)
endif (GIT_DESCRIBE_RESULT EQUAL 0)
else ()
message(STATUS "Git or repo not found.")
endif ()
Expand Down
4 changes: 2 additions & 2 deletions cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
endif ()

file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
Expand Down
2 changes: 1 addition & 1 deletion doc/man/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ foreach (manpage ${MANPAGES})
set(f "${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1")
else()
message(AUTHOR_WARNING "Manpage ${manpage} not generated")
endif()
endif ()

if (f AND NOT WIN32)
install(FILES ${f} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)
Expand Down
Loading

0 comments on commit 6f934a3

Please sign in to comment.