libftdi Archives

Subject: [PATCH] CMake: fix indentation and normalize braces

From: yegorslists@xxxxxxxxxxxxxx
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: thomas.jarosch@xxxxxxxxxxxxx, Yegor Yefremov <yegorslists@xxxxxxxxxxxxxx>
Date: Wed, 30 Aug 2023 11:57:01 +0200
From: Yegor Yefremov <yegorslists@xxxxxxxxxxxxxx>

---
 CMakeLists.txt                        | 53 +++++++++++++--------------
 examples/CMakeLists.txt               | 21 ++++++-----
 examples/cmake_example/CMakeLists.txt |  4 +-
 ftdipp/CMakeLists.txt                 | 35 +++++++++---------
 packages/CMakeLists.txt               | 22 +++++------
 python/CMakeLists.txt                 | 28 +++++++-------
 python/examples/CMakeLists.txt        |  5 +--
 src/CMakeLists.txt                    | 12 +++---
 8 files changed, 90 insertions(+), 90 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48a028c..9d7f9b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
 
 # CMake
 if("${CMAKE_BUILD_TYPE}" STREQUAL "")
-   set(CMAKE_BUILD_TYPE     RelWithDebInfo)
+  set(CMAKE_BUILD_TYPE     RelWithDebInfo)
 endif("${CMAKE_BUILD_TYPE}" STREQUAL "")
 set(CMAKE_COLOR_MAKEFILE ON)
 
@@ -22,7 +22,7 @@ include(CMakeOptions.txt)
 # Debug build
 message("-- Build type: ${CMAKE_BUILD_TYPE}")
 if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
-   add_definitions(-DDEBUG)
+  add_definitions(-DDEBUG)
 endif(${CMAKE_BUILD_TYPE} STREQUAL Debug)
 
 # find libusb
@@ -59,7 +59,7 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development")
 set(CPACK_COMPONENT_STATICLIBS_GROUP "Development")
 set(CPACK_COMPONENT_HEADERS_GROUP    "Development")
 
-# guess LIB_SUFFIX, don't take debian multiarch into account 
+# guess LIB_SUFFIX, don't take debian multiarch into account
 if ( NOT DEFINED LIB_SUFFIX )
   if( CMAKE_SYSTEM_NAME MATCHES "Linux"
       AND NOT CMAKE_CROSSCOMPILING
@@ -73,9 +73,9 @@ endif ()
 
 if(NOT APPLE)
   if(CMAKE_SIZEOF_VOID_P EQUAL 4)
-      SET(PACK_ARCH "")
-    else(CMAKE_SIZEOF_VOID_P EQUAL 8)
-      SET(PACK_ARCH .x86_64)
+    SET(PACK_ARCH "")
+  else(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    SET(PACK_ARCH .x86_64)
   endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
 else(NOT APPLE)
   SET(PACK_ARCH "")
@@ -85,8 +85,8 @@ endif(NOT APPLE)
 set(CPACK_PACKAGE_VERSION              ${VERSION_STRING})
 set(CPACK_PACKAGE_CONTACT              "Intra2net AG 
<libftdi@xxxxxxxxxxxxxxxxxxxxxxx>")
 set(CPACK_PACKAGE_DESCRIPTION          "libftdi1 library.")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY  ${CPACK_PACKAGE_DESCRIPTION}
-                                       )
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY  ${CPACK_PACKAGE_DESCRIPTION})
+
 # Package settings
 if ( UNIX )
   set(CPACK_GENERATOR                    "DEB;RPM")
@@ -125,22 +125,22 @@ add_custom_target(dist
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
 if ( DOCUMENTATION )
-   find_package ( Doxygen REQUIRED)
+  find_package ( Doxygen REQUIRED)
 
-   # Copy doxy.config.in
-   set(top_srcdir ${CMAKE_SOURCE_DIR})
-   configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.in 
${CMAKE_BINARY_DIR}/Doxyfile )
-   configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.xml.in 
${CMAKE_BINARY_DIR}/Doxyfile.xml )
+  # Copy doxy.config.in
+  set(top_srcdir ${CMAKE_SOURCE_DIR})
+  configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.in 
${CMAKE_BINARY_DIR}/Doxyfile )
+  configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.xml.in 
${CMAKE_BINARY_DIR}/Doxyfile.xml )
 
-   # Run doxygen
-   add_custom_command(
+  # Run doxygen
+  add_custom_command(
     OUTPUT ${CMAKE_BINARY_DIR}/doc/html/index.html
     COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/doc
     COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
     DEPENDS ${c_headers};${c_sources};${cpp_sources};${cpp_headers}
-   )
+  )
 
-   add_custom_target(docs ALL DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html)
+  add_custom_target(docs ALL DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html)
 endif ()
 
 add_subdirectory(src)
@@ -169,10 +169,10 @@ set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
 set(includedir  ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})
 
 if(${UNIX})
-   set(libdir      ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+  set(libdir      ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
 endif(${UNIX})
 if(${WIN32})
-   set(libdir      ${CMAKE_INSTALL_PREFIX}/bin)
+  set(libdir      ${CMAKE_INSTALL_PREFIX}/bin)
 endif(${WIN32})
 
 configure_file(${CMAKE_SOURCE_DIR}/libftdi1.pc.in 
${CMAKE_BINARY_DIR}/libftdi1.pc @ONLY)
@@ -232,14 +232,13 @@ write_basic_package_version_file (
   COMPATIBILITY AnyNewerVersion
 )
 
-
-install ( FILES 
-            ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1Config.cmake
-            ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1ConfigVersion.cmake
-            cmake/UseLibFTDI1.cmake
-
-          DESTINATION ${LIBFTDI_CMAKE_CONFIG_DIR}
-        )
+install (
+  FILES
+    ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1Config.cmake
+    ${CMAKE_CURRENT_BINARY_DIR}/LibFTDI1ConfigVersion.cmake
+    cmake/UseLibFTDI1.cmake
+  DESTINATION ${LIBFTDI_CMAKE_CONFIG_DIR}
+)
 
 include(CPack)
 
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index dd8ffbe..382cb33 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,7 +1,7 @@
 # Includes
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}
-               ${CMAKE_CURRENT_BINARY_DIR}
-               )
+  ${CMAKE_CURRENT_BINARY_DIR}
+)
 
 # Targets
 add_executable(simple simple.c)
@@ -16,7 +16,7 @@ add_executable(stream_test stream_test.c)
 add_executable(eeprom eeprom.c)
 add_executable(async async.c)
 if(NOT MINGW)
-    add_executable(purge_test purge_test.c)
+  add_executable(purge_test purge_test.c)
 endif(NOT MINGW)
 
 # Linkage
@@ -32,19 +32,20 @@ target_link_libraries(stream_test ftdi1)
 target_link_libraries(eeprom ftdi1)
 target_link_libraries(async ftdi1)
 if(NOT MINGW)
-    target_link_libraries(purge_test ftdi1)
+  target_link_libraries(purge_test ftdi1)
 endif(NOT MINGW)
 
 # libftdi++ examples
 if( FTDIPP )
-       include_directories(BEFORE ${CMAKE_SOURCE_DIR}/ftdipp
-                       ${Boost_INCLUDE_DIRS})
+  include_directories(BEFORE ${CMAKE_SOURCE_DIR}/ftdipp
+    ${Boost_INCLUDE_DIRS}
+  )
 
-       # Target
-       add_executable(find_all_pp find_all_pp.cpp)
+  # Target
+  add_executable(find_all_pp find_all_pp.cpp)
 
-       # Linkage
-       target_link_libraries(find_all_pp ftdipp1)
+  # Linkage
+  target_link_libraries(find_all_pp ftdipp1)
 endif( FTDIPP )
 
 # Source includes
diff --git a/examples/cmake_example/CMakeLists.txt 
b/examples/cmake_example/CMakeLists.txt
index fe203ed..5a1e1a7 100644
--- a/examples/cmake_example/CMakeLists.txt
+++ b/examples/cmake_example/CMakeLists.txt
@@ -9,5 +9,5 @@ add_executable ( example main.c )
 target_link_libraries( example ${LIBFTDI_LIBRARIES} )
 
 install ( TARGETS example
-          DESTINATION bin )
-          
+          DESTINATION bin
+)
diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt
index fac5bcc..38932ae 100644
--- a/ftdipp/CMakeLists.txt
+++ b/ftdipp/CMakeLists.txt
@@ -6,8 +6,9 @@ set(cpp_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.hpp CACHE 
INTERNAL "List of cpp
 
 # Includes
 include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}
-       ${CMAKE_CURRENT_SOURCE_DIR}
-       ${CMAKE_SOURCE_DIR}/src)
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_SOURCE_DIR}/src
+)
 
 include_directories(${Boost_INCLUDE_DIRS})
 
@@ -24,24 +25,24 @@ set_target_properties(ftdipp1 PROPERTIES 
CLEAN_DIRECT_OUTPUT 1)
 target_link_libraries(ftdipp1 ftdi1 ${LIBUSB_LIBRARIES} ${BOOST_LIBRARIES})
 
 install ( TARGETS ftdipp1
-                                       RUNTIME DESTINATION bin
-                                       LIBRARY DESTINATION lib${LIB_SUFFIX}
-                                       ARCHIVE DESTINATION lib${LIB_SUFFIX}
-                               )
+          RUNTIME DESTINATION bin
+          LIBRARY DESTINATION lib${LIB_SUFFIX}
+          ARCHIVE DESTINATION lib${LIB_SUFFIX}
+)
 
 # Static library
 if ( STATICLIBS )
-       add_library(ftdipp1-static STATIC ${cpp_sources})
-       set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1")
-       set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
-
-       install ( TARGETS ftdipp1-static
-                                               ARCHIVE DESTINATION 
lib${LIB_SUFFIX}
-                                               COMPONENT staticlibs
-                                       )
+  add_library(ftdipp1-static STATIC ${cpp_sources})
+  set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1")
+  set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
+  install ( TARGETS ftdipp1-static
+            ARCHIVE DESTINATION lib${LIB_SUFFIX}
+            COMPONENT staticlibs
+  )
 endif ()
 
 install ( FILES ${cpp_headers}
-                                       DESTINATION include/${PROJECT_NAME}
-                                       COMPONENT headers
-                               )
+          DESTINATION include/${PROJECT_NAME}
+          COMPONENT headers
+)
diff --git a/packages/CMakeLists.txt b/packages/CMakeLists.txt
index 4bf58d2..204bbe0 100644
--- a/packages/CMakeLists.txt
+++ b/packages/CMakeLists.txt
@@ -1,19 +1,19 @@
 # Debian
 if("${PACKAGE}" STREQUAL "Debian")
 
-   # Settings
-   set(REVISION                           0)
-   set(CPACK_GENERATOR                    "DEB" PARENT_SCOPE)
-   set(CPACK_PACKAGE_VERSION              ${CPACK_PACKAGE_VERSION}-${REVISION} 
PARENT_SCOPE)
+  # Settings
+  set(REVISION                           0)
+  set(CPACK_GENERATOR                    "DEB" PARENT_SCOPE)
+  set(CPACK_PACKAGE_VERSION              ${CPACK_PACKAGE_VERSION}-${REVISION} 
PARENT_SCOPE)
 
-   # Dependencies
-   set(CPACK_DEBIAN_PACKAGE_DEPENDS       "libusb-1.0-0" PARENT_SCOPE)
-   set(DEBIAN_PACKAGE_BUILDS_DEPENDS      "cmake, libusb2-dev" PARENT_SCOPE)
+  # Dependencies
+  set(CPACK_DEBIAN_PACKAGE_DEPENDS       "libusb-1.0-0" PARENT_SCOPE)
+  set(DEBIAN_PACKAGE_BUILDS_DEPENDS      "cmake, libusb2-dev" PARENT_SCOPE)
 
-   # Bundles
-   message("-- Installing udev rules to /etc/udev/rules.d")
-   install(FILES 99-libftdi.rules
-           DESTINATION /etc/udev/rules.d)
+  # Bundles
+  message("-- Installing udev rules to /etc/udev/rules.d")
+  install(FILES 99-libftdi.rules
+          DESTINATION /etc/udev/rules.d)
 
 endif("${PACKAGE}" STREQUAL "Debian")
 
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 1a8142b..f8ac423 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -55,23 +55,23 @@ install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/ftdi1.py 
DESTINATION ${PYTHON_MODULE
 install ( TARGETS ${SWIG_MODULE_ftdi1_REAL_NAME} LIBRARY DESTINATION 
${PYTHON_MODULE_PATH} )
 
 if ( DOCUMENTATION )
-    # Run doxygen to only generate the xml
-    add_custom_command ( OUTPUT ${CMAKE_BINARY_DIR}/doc/xml/ftdi_8c.xml
-        COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/doc
-        COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile.xml
-        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-        DEPENDS ${c_headers};${c_sources};${cpp_sources};${cpp_headers}
-    )
+  # Run doxygen to only generate the xml
+  add_custom_command ( OUTPUT ${CMAKE_BINARY_DIR}/doc/xml/ftdi_8c.xml
+    COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/doc
+    COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile.xml
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    DEPENDS ${c_headers};${c_sources};${cpp_sources};${cpp_headers}
+  )
 
-    # generate .i from doxygen .xml
-    add_custom_command ( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ftdi1_doc.i
-        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doxy2swig.py 
-n
+  # generate .i from doxygen .xml
+  add_custom_command ( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ftdi1_doc.i
+    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doxy2swig.py -n
             ${CMAKE_BINARY_DIR}/doc/xml/ftdi_8c.xml
             ${CMAKE_CURRENT_BINARY_DIR}/ftdi1_doc.i
-        DEPENDS ${CMAKE_BINARY_DIR}/doc/xml/ftdi_8c.xml
-    )
-    add_custom_target ( doc_i DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ftdi1_doc.i )
-    add_dependencies( ${SWIG_MODULE_ftdi1_REAL_NAME} doc_i )
+    DEPENDS ${CMAKE_BINARY_DIR}/doc/xml/ftdi_8c.xml
+  )
+  add_custom_target ( doc_i DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ftdi1_doc.i )
+  add_dependencies( ${SWIG_MODULE_ftdi1_REAL_NAME} doc_i )
 
 endif ()
 
diff --git a/python/examples/CMakeLists.txt b/python/examples/CMakeLists.txt
index b4ed93d..232595f 100644
--- a/python/examples/CMakeLists.txt
+++ b/python/examples/CMakeLists.txt
@@ -1,5 +1,4 @@
 install ( FILES simple.py complete.py cbus.py
           DESTINATION share/libftdi/examples
-          PERMISSIONS OWNER_READ GROUP_READ WORLD_READ 
-        )
-
+          PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
+)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 17b3617..cf630ba 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,7 @@
 # Includes
 include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}
-                     ${CMAKE_CURRENT_SOURCE_DIR}
-                     )
+                      ${CMAKE_CURRENT_SOURCE_DIR}
+)
 
 # Version information
 set(SNAPSHOT_VERSION "unknown")
@@ -9,7 +9,7 @@ execute_process(COMMAND git describe
                 OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT
                 RESULT_VARIABLE GIT_DESCRIBE_RESULT
                 OUTPUT_STRIP_TRAILING_WHITESPACE
-                )
+)
 if(${GIT_DESCRIBE_RESULT} STREQUAL 0)
   set(SNAPSHOT_VERSION ${GIT_DESCRIBE_OUTPUT})
 endif ()
@@ -36,7 +36,7 @@ install ( TARGETS ftdi1
           RUNTIME DESTINATION bin
           LIBRARY DESTINATION lib${LIB_SUFFIX}
           ARCHIVE DESTINATION lib${LIB_SUFFIX}
-        )
+)
 
 if ( STATICLIBS )
   add_library(ftdi1-static STATIC ${c_sources})
@@ -46,10 +46,10 @@ if ( STATICLIBS )
   install ( TARGETS ftdi1-static
             ARCHIVE DESTINATION lib${LIB_SUFFIX}
             COMPONENT staticlibs
-          )
+  )
 endif ()
 
 install ( FILES ${c_headers}
           DESTINATION include/${PROJECT_NAME}
           COMPONENT headers
-        )
+)
-- 
2.34.1


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread