]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
STYLE: Remove CMake-language block-end command arguments
authorHans Johnson <hans.j.johnson@gmail.com>
Sun, 23 Dec 2018 01:31:50 +0000 (19:31 -0600)
committerHans Johnson <hans.j.johnson@gmail.com>
Sun, 23 Dec 2018 01:32:39 +0000 (19:32 -0600)
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the block.
This is no longer the preferred style.

build/cmake/CMakeLists.txt
build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
build/cmake/lib/CMakeLists.txt
build/cmake/lib/cmake_uninstall.cmake.in
build/cmake/programs/CMakeLists.txt
build/cmake/tests/CMakeLists.txt

index 02a81b3c4c737a449dd07b71a1a04e8428266327..c9dab0d5dbc1dafbd3395f8a0643dcdfc8826e05 100644 (file)
@@ -45,19 +45,19 @@ option(ZSTD_LEGACY_SUPPORT "LEGACY SUPPORT" OFF)
 if (ZSTD_LEGACY_SUPPORT)
     message(STATUS "ZSTD_LEGACY_SUPPORT defined!")
     add_definitions(-DZSTD_LEGACY_SUPPORT=4)
-else (ZSTD_LEGACY_SUPPORT)
+else ()
     message(STATUS "ZSTD_LEGACY_SUPPORT not defined!")
     add_definitions(-DZSTD_LEGACY_SUPPORT=0)
-endif (ZSTD_LEGACY_SUPPORT)
+endif ()
 
 # Multi-threading support
 option(ZSTD_MULTITHREAD_SUPPORT "MULTITHREADING SUPPORT" ON)
 
 if (ZSTD_MULTITHREAD_SUPPORT)
     message(STATUS "ZSTD_MULTITHREAD_SUPPORT is enabled")
-else (ZSTD_MULTITHREAD_SUPPORT)
+else ()
     message(STATUS "ZSTD_MULTITHREAD_SUPPORT is disabled")
-endif (ZSTD_MULTITHREAD_SUPPORT)
+endif ()
 
 option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" ON)
 option(ZSTD_BUILD_CONTRIB "BUILD CONTRIB" OFF)
@@ -77,7 +77,7 @@ if (ZSTD_MULTITHREAD_SUPPORT AND UNIX)
     else()
         message(SEND_ERROR "ZSTD currently does not support thread libraries other than pthreads")
     endif()
-endif (ZSTD_MULTITHREAD_SUPPORT AND UNIX)
+endif ()
 
 #-----------------------------------------------------------------------------
 # Add source directories
@@ -87,22 +87,22 @@ add_subdirectory(lib)
 if (ZSTD_BUILD_PROGRAMS)
     if (NOT ZSTD_BUILD_STATIC)
         message(SEND_ERROR "You need to build static library to build zstd CLI")
-    endif (NOT ZSTD_BUILD_STATIC)
+    endif ()
 
     add_subdirectory(programs)
-endif (ZSTD_BUILD_PROGRAMS)
+endif ()
 
 if (ZSTD_BUILD_TESTS)
     if (NOT ZSTD_BUILD_STATIC)
         message(SEND_ERROR "You need to build static library to build tests")
-    endif (NOT ZSTD_BUILD_STATIC)
+    endif ()
 
     add_subdirectory(tests)
-endif (ZSTD_BUILD_TESTS)
+endif ()
 
 if (ZSTD_BUILD_CONTRIB)
     add_subdirectory(contrib)
-endif (ZSTD_BUILD_CONTRIB)
+endif ()
 
 #-----------------------------------------------------------------------------
 # Add clean-all target
index 8d464c06dd9d2c5fe4d87b4eb3dc3f074ee95e40..5e65cedb5a20fc6ef665e56f24ef965487fd5179 100644 (file)
@@ -53,7 +53,7 @@ macro(ADD_ZSTD_COMPILATION_FLAGS)
         separate_arguments(${flag_var})
         list(REMOVE_DUPLICATES ${flag_var})
         string(REPLACE ";" " " ${flag_var} "${${flag_var}}")
-    endforeach (flag_var)
+    endforeach ()
 
     if (MSVC AND ZSTD_USE_STATIC_RUNTIME)
         foreach (flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
@@ -61,7 +61,7 @@ macro(ADD_ZSTD_COMPILATION_FLAGS)
                  CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
                  CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
             string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
-        endforeach (flag_var)
+        endforeach ()
     endif ()
 
-endmacro(ADD_ZSTD_COMPILATION_FLAGS)
+endmacro()
index 53f72d1eea28bd6aefd490f3559d6c87e81ef1eb..6ed6c305eec5d283b618da72fcacccb39e071432 100644 (file)
@@ -105,12 +105,12 @@ if (ZSTD_LEGACY_SUPPORT)
             ${LIBRARY_LEGACY_DIR}/zstd_v05.h
             ${LIBRARY_LEGACY_DIR}/zstd_v06.h
             ${LIBRARY_LEGACY_DIR}/zstd_v07.h)
-endif (ZSTD_LEGACY_SUPPORT)
+endif ()
 
 if (MSVC)
     set(MSVC_RESOURCE_DIR ${ZSTD_SOURCE_DIR}/build/VS2010/libzstd-dll)
     set(PlatformDependResources ${MSVC_RESOURCE_DIR}/libzstd-dll.rc)
-endif (MSVC)
+endif ()
 
 # Split project to static and shared libraries build
 if (ZSTD_BUILD_SHARED)
@@ -121,7 +121,7 @@ if (ZSTD_BUILD_SHARED)
             target_link_libraries(libzstd_shared ${THREADS_LIBS})
         endif ()
     endif()
-endif (ZSTD_BUILD_SHARED)
+endif ()
 if (ZSTD_BUILD_STATIC)
     add_library(libzstd_static STATIC ${Sources} ${Headers})
     if (ZSTD_MULTITHREAD_SUPPORT)
@@ -130,24 +130,24 @@ if (ZSTD_BUILD_STATIC)
             target_link_libraries(libzstd_static ${THREADS_LIBS})
         endif ()
     endif ()
-endif (ZSTD_BUILD_STATIC)
+endif ()
 
 # Add specific compile definitions for MSVC project
 if (MSVC)
     if (ZSTD_BUILD_SHARED)
         set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_DLL_EXPORT=1;ZSTD_HEAPMODE=0;_CONSOLE;_CRT_SECURE_NO_WARNINGS")
-    endif (ZSTD_BUILD_SHARED)
+    endif ()
     if (ZSTD_BUILD_STATIC)
         set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_HEAPMODE=0;_CRT_SECURE_NO_WARNINGS")
-    endif (ZSTD_BUILD_STATIC)
-endif (MSVC)
+    endif ()
+endif ()
 
 # With MSVC static library needs to be renamed to avoid conflict with import library
 if (MSVC)
     set(STATIC_LIBRARY_BASE_NAME zstd_static)
 else ()
     set(STATIC_LIBRARY_BASE_NAME zstd)
-endif (MSVC)
+endif ()
 
 # Define static and shared library names
 if (ZSTD_BUILD_SHARED)
@@ -156,14 +156,14 @@ if (ZSTD_BUILD_SHARED)
             PROPERTIES
             OUTPUT_NAME zstd
             SOVERSION ${LIBVER_MAJOR}.${LIBVER_MINOR}.${LIBVER_RELEASE})
-endif (ZSTD_BUILD_SHARED)
+endif ()
 
 if (ZSTD_BUILD_STATIC)
     set_target_properties(
             libzstd_static
             PROPERTIES
             OUTPUT_NAME ${STATIC_LIBRARY_BASE_NAME})
-endif (ZSTD_BUILD_STATIC)
+endif ()
 
 if (UNIX)
     # pkg-config
@@ -178,7 +178,7 @@ if (UNIX)
             COMMENT "Creating pkg-config file")
 
     install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" DESTINATION "${LIBDIR}/pkgconfig")
-endif (UNIX)
+endif ()
 
 # install target
 install(FILES
@@ -196,7 +196,7 @@ if (ZSTD_BUILD_SHARED)
 endif()
 if (ZSTD_BUILD_STATIC)
     install(TARGETS libzstd_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-endif (ZSTD_BUILD_STATIC)
+endif ()
 
 # uninstall target
 configure_file(
index e3774dc10ce7ce6ab39029f1006dc7a0bf746fc1..9f1d045ddfab1e1c004f85c319e7080255fa6a25 100644 (file)
@@ -1,7 +1,7 @@
  
 if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
   message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
-endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
+endif()
 
 file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
 string(REGEX REPLACE "\n" ";" files "${files}")
@@ -15,8 +15,8 @@ foreach(file ${files})
       )
     if(NOT "${rm_retval}" STREQUAL 0)
       message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
-    endif(NOT "${rm_retval}" STREQUAL 0)
-  else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+    endif()
+  else()
     message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
-  endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
-endforeach(file)
+  endif()
+endforeach()
index 9f4e9bef11775a117db366bf0d9094d3e2aacc41..4c5146f8d2f2f7ad1be572266360a2c43a27b053 100644 (file)
@@ -19,18 +19,18 @@ include_directories(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${LIBRA
 if (ZSTD_LEGACY_SUPPORT)
     set(PROGRAMS_LEGACY_DIR ${PROGRAMS_DIR}/legacy)
     include_directories(${PROGRAMS_LEGACY_DIR} ${LIBRARY_DIR}/legacy)
-endif (ZSTD_LEGACY_SUPPORT)
+endif ()
 
 if (MSVC)
     set(MSVC_RESOURCE_DIR ${ZSTD_SOURCE_DIR}/build/VS2010/zstd)
     set(PlatformDependResources ${MSVC_RESOURCE_DIR}/zstd.rc)
-endif (MSVC)
+endif ()
 
 add_executable(zstd ${PROGRAMS_DIR}/zstdcli.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/fileio.c ${PROGRAMS_DIR}/benchfn.c ${PROGRAMS_DIR}/benchzstd.c ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/dibio.c ${PlatformDependResources})
 target_link_libraries(zstd libzstd_static)
 if (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
     target_link_libraries(zstd rt)
-endif (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
+endif ()
 install(TARGETS zstd RUNTIME DESTINATION "bin")
 
 if (UNIX)
@@ -53,9 +53,9 @@ if (UNIX)
 
     # Define MAN_INSTALL_DIR if necessary
     if (MAN_INSTALL_DIR)
-    else (MAN_INSTALL_DIR)
+    else ()
       set(MAN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/man/man1)
-    endif (MAN_INSTALL_DIR)
+    endif ()
 
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstd.1 DESTINATION "${MAN_INSTALL_DIR}")
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstdcat.1 DESTINATION "${MAN_INSTALL_DIR}")
@@ -66,7 +66,7 @@ if (UNIX)
     add_executable(zstd-frugal ${PROGRAMS_DIR}/zstdcli.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/fileio.c)
     target_link_libraries(zstd-frugal libzstd_static)
     set_property(TARGET zstd-frugal APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_NOBENCH;ZSTD_NODICT")
-endif (UNIX)
+endif ()
 
 # Add multi-threading support definitions
 
@@ -78,8 +78,8 @@ if (ZSTD_MULTITHREAD_SUPPORT)
 
         add_custom_target(zstdmt ALL ${CMAKE_COMMAND} -E create_symlink zstd zstdmt DEPENDS zstd COMMENT "Creating zstdmt symlink")
         install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstdmt DESTINATION "bin")
-    endif (UNIX)
-endif (ZSTD_MULTITHREAD_SUPPORT)
+    endif ()
+endif ()
 
 option(ZSTD_ZLIB_SUPPORT "ZLIB SUPPORT" OFF)
 option(ZSTD_LZMA_SUPPORT "LZMA SUPPORT" OFF)
index 703e7c01a6a1409b5d64662c2c02bbdbc4b57431..69316e280032a73d379e0c05084fd43f2f976e32 100644 (file)
@@ -52,4 +52,4 @@ target_link_libraries(fuzzer libzstd_static)
 if (UNIX)
     add_executable(paramgrill ${PROGRAMS_DIR}/benchfn.c ${PROGRAMS_DIR}/benchzstd.c ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${TESTS_DIR}/paramgrill.c)
     target_link_libraries(paramgrill libzstd_static m) #m is math library
-endif (UNIX)
+endif ()