Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions CMake/CppcheckTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if(CPPCHECK_FOUND)
endif()

# ------------------------------------------------------------------------------
macro( get_cppcheck_arg )
macro(get_cppcheck_arg)

if(FORCE IN_LIST _input)
list(APPEND _cppcheck_args ${CPPCHECK_FORCE_ARG})
Expand Down Expand Up @@ -98,17 +98,17 @@ endmacro()
# add_cppcheck_dir
function(add_cppcheck_dir _name _dir _include_dirs)
if(CPPCHECK_FOUND)
set(_cppcheck_args )
set(_cppcheck_args)
set(_input ${ARGN})

get_cppcheck_arg( ${_input} )
get_cppcheck_arg(${_input})

# --------------------------------------------------------------
foreach( _includeDirs ${_include_dirs} )
set( _cppcheck_include ${_cppcheck_include} -I${_includeDirs} )
foreach(_includeDirs ${_include_dirs})
set(_cppcheck_include ${_cppcheck_include} -I${_includeDirs})
endforeach()

set( _cppcheck_compile_args ${_cppcheck_include} )
set(_cppcheck_compile_args ${_cppcheck_include})

itk_add_test(
NAME
Expand Down Expand Up @@ -150,10 +150,10 @@ function(add_cppcheck_sources _targetname)
if(CPPCHECK_FOUND)
# Normally --force should not be required, but since all compiler definitions
# can't be detected, it is better to enforce testing all possibilities
set(_cppcheck_args )
set(_cppcheck_args)
set(_input ${ARGN})

get_cppcheck_arg( "${_input}" )
get_cppcheck_arg("${_input}")

set(_files)
foreach(_source ${_input})
Expand All @@ -179,12 +179,12 @@ function(add_cppcheck_sources _targetname)
endforeach()

# let's take of include dirs here
get_property( mytargINCLUDES DIRECTORY
get_property(mytargINCLUDES DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY INCLUDE_DIRECTORIES)

set( _cppcheck_include )
foreach( _includeDirs ${mytargINCLUDES} )
set( _cppcheck_include ${_cppcheck_include} -I${_includeDirs} )
set(_cppcheck_include)
foreach(_includeDirs ${mytargINCLUDES})
set(_cppcheck_include ${_cppcheck_include} -I${_includeDirs})
endforeach()

# --------------------------------------------------------------
Expand All @@ -194,13 +194,13 @@ function(add_cppcheck_sources _targetname)
get_property(mytargDEFINITIONS DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY COMPILE_DEFINITIONS)

set( _cppcheck_def )
foreach( _compiledef ${mytargDEFINITIONS} )
set( _cppcheck_def ${_cppcheck_def} -D${_compiledef} )
set(_cppcheck_def)
foreach(_compiledef ${mytargDEFINITIONS})
set(_cppcheck_def ${_cppcheck_def} -D${_compiledef})
endforeach()

# --------------------------------------------------------------
set( _cppcheck_compile_args ${_cppcheck_include} ${_cppcheck_def} )
set(_cppcheck_compile_args ${_cppcheck_include} ${_cppcheck_def})

itk_add_test(
NAME
Expand Down Expand Up @@ -243,10 +243,10 @@ function(add_cppcheck _name)
"add_cppcheck given a target name that does not exist: '${_name}' !")
endif()
if(CPPCHECK_FOUND)
set(_cppcheck_args )
set(_cppcheck_args)
set(_input ${ARGN})

get_cppcheck_arg( ${_input} )
get_cppcheck_arg(${_input})

get_target_property(_cppcheck_sources "${_name}" SOURCES)
set(_files)
Expand All @@ -259,26 +259,26 @@ function(add_cppcheck _name)
endforeach()

# let's take of include dirs here
get_property( mytargINCLUDES DIRECTORY
get_property(mytargINCLUDES DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY INCLUDE_DIRECTORIES)

set( _cppcheck_include )
foreach( _includeDirs ${mytargINCLUDES} )
set( _cppcheck_include "${_cppcheck_include} -I ${_includeDirs}" )
set(_cppcheck_include)
foreach(_includeDirs ${mytargINCLUDES})
set(_cppcheck_include "${_cppcheck_include} -I ${_includeDirs}")
endforeach()

# --------------------------------------------------------------
# let's take of compile definitions here
get_property(mytargDEFINITIONS DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY COMPILE_DEFINITIONS )
"${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY COMPILE_DEFINITIONS)

set( _cppcheck_def )
foreach( _compiledef ${mytargDEFINITIONS} )
set( _cppcheck_def ${_cppcheck_def} -D${_compiledef} )
set(_cppcheck_def)
foreach(_compiledef ${mytargDEFINITIONS})
set(_cppcheck_def ${_cppcheck_def} -D${_compiledef})
endforeach()

# --------------------------------------------------------------
set( _cppcheck_compile_args --check-config ${_cppcheck_include} ${_cppcheck_def} )
set(_cppcheck_compile_args --check-config ${_cppcheck_include} ${_cppcheck_def})

itk_add_test(
NAME
Expand Down
8 changes: 4 additions & 4 deletions CMake/ExternalData.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1126,10 +1126,10 @@ if("${ExternalData_ACTION}" STREQUAL "fetch")
string(REPLACE "+" ";" exts_list "${exts}")
set(succeeded 0)
set(errorMsg "")
set(hash_list )
set(algo_list )
set(hash )
set(algo )
set(hash_list)
set(algo_list)
set(hash)
set(algo)
foreach(ext ${exts_list})
file(READ "${name}${ext}" hash)
string(STRIP "${hash}" hash)
Expand Down
2 changes: 1 addition & 1 deletion CMake/FindFFTW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if(ITK_USE_FFTWD OR ITK_USE_FFTWF)
get_filename_component(FFTWD_THREADS_LIB ${FFTWD_THREADS_LIB} NAME)
set(FFTWD_LIBRARIES ${FFTWD_BASE_LIB})
if(FFTWD_THREADS_LIB)
set(FFTWD_LIBRARIES ${FFTWD_THREADS_LIB} ${FFTWD_BASE_LIB} )
set(FFTWD_LIBRARIES ${FFTWD_THREADS_LIB} ${FFTWD_BASE_LIB})
endif()
else()
message(FATAL_ERROR "fftw3 not found.")
Expand Down
16 changes: 8 additions & 8 deletions CMake/Findcppcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if(CPPCHECK_EXECUTABLE)
set(CPPCHECK_VERBOSE_ARG --verbose)
set(CPPCHECK_INCLUDEPATH_ARG -I)
set(CPPCHECK_DEFINITION_ARG -D)
set( CPPCHECK_ALL_ARG --enable=all)
set(CPPCHECK_ALL_ARG --enable=all)

# Check for the two types of command line arguments by just trying them
execute_process(COMMAND
Expand All @@ -82,9 +82,9 @@ if(CPPCHECK_EXECUTABLE)
ERROR_QUIET
)

if( "${_cppcheck_enable_style_result}" EQUAL 0 )
if("${_cppcheck_enable_style_result}" EQUAL 0)

set( CPPCHECK_STYLE_ARG --enable=style)
set(CPPCHECK_STYLE_ARG --enable=style)

# How to display errors and warnings:
if(MSVC)
Expand All @@ -100,7 +100,7 @@ if(CPPCHECK_EXECUTABLE)
endif()

else()
message( "This file supports only version of cppcheck is newer than 1.43!" )
message("This file supports only version of cppcheck is newer than 1.43!")

endif()

Expand Down Expand Up @@ -129,10 +129,10 @@ if(CPPCHECK_EXECUTABLE)
ERROR_QUIET
)

if( "${_cppcheck_enable_unused_function_results}" EQUAL 0 )
if("${_cppcheck_enable_unused_function_results}" EQUAL 0)
set(CPPCHECK_UNUSEDFUNC_ARG --enable=unusedFunction)
else()
set(CPPCHECK_UNUSEDFUNC_ARG )
set(CPPCHECK_UNUSEDFUNC_ARG)
endif()

endif()
Expand All @@ -152,7 +152,7 @@ if(CPPCHECK_EXECUTABLE)
# supported since
set(CPPCHECK_INFORMATION_ARG --enable=information)
else()
set(CPPCHECK_INFORMATION_ARG )
set(CPPCHECK_INFORMATION_ARG)
endif()

execute_process(COMMAND
Expand All @@ -170,7 +170,7 @@ if(CPPCHECK_EXECUTABLE)
# supported since
set(CPPCHECK_MISSING_INCLUDE_ARG --enable=missingInclude)
else()
set(CPPCHECK_MISSING_INCLUDE_ARG )
set(CPPCHECK_MISSING_INCLUDE_ARG)
endif()

endif()
Expand Down
10 changes: 5 additions & 5 deletions CMake/GetGitRevisionDescription.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function(get_git_head_revision _refvar _hashvar)
endfunction()

# get the number of commits since the file has last been modified
function(git_commits_since file _commits )
function(git_commits_since file _commits)
get_git_head_revision(ref head)

set(src_dir ${PROJECT_SOURCE_DIR})
Expand All @@ -108,7 +108,7 @@ function(git_commits_since file _commits )
RESULT_VARIABLE failed
)
if(failed)
set( tag "")
set(tag "")
endif()

execute_process(COMMAND ${GIT_EXECUTABLE} rev-list ${tag}..${head}
Expand All @@ -119,11 +119,11 @@ function(git_commits_since file _commits )
)

if(failed)
set( rev_list "")
set(rev_list "")
endif()

string( REGEX MATCHALL "[a-fA-F0-9]+" rev_list "${rev_list}")
list( LENGTH rev_list COUNT)
string(REGEX MATCHALL "[a-fA-F0-9]+" rev_list "${rev_list}")
list(LENGTH rev_list COUNT)

set(${_commits} "${COUNT}" PARENT_SCOPE)
endfunction()
Expand Down
20 changes: 10 additions & 10 deletions CMake/ITKClangFormatSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
option(ITK_USE_CLANG_FORMAT "Enable the use of clang-format enforce ITK coding style." ${BUILD_TESTING})
mark_as_advanced(ITK_USE_CLANG_FORMAT)

if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANG_FORMAT_EXECUTABLE}" )
# Download pre-built binaries (about 2M ) of clang-format extracted from
if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANG_FORMAT_EXECUTABLE}")
# Download pre-built binaries (about 2M) of clang-format extracted from
# https://releases.llvm.org/download.html and cached on data.kitware.com
#
# Darwin - macOS/OS X (Clang, GCC) https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz
Expand All @@ -31,12 +31,12 @@ if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANG_FORMAT_EXECUTABLE}" )
# Android - Android NDK (GCC, Clang)
# CrayLinuxEnvironment - Cray supercomputers (Cray compiler)
# MSYS - Windows (MSYS2 shell native GCC)
if ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" )
set( CLANG_FORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d274e88877dfcc902effc47/download" )
elseif ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" )
set( CLANG_FORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d2b8775877dfcc902fd8236/download" )
elseif ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" )
set( CLANG_FORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d2b8c87877dfcc902fda594/download" )
if ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(CLANG_FORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d274e88877dfcc902effc47/download")
elseif ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
set(CLANG_FORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d2b8775877dfcc902fd8236/download")
elseif ( "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(CLANG_FORMAT_DOWNLOAD_URL "https://data.kitware.com/api/v1/file/5d2b8c87877dfcc902fda594/download")
else ()
message(FATAL_ERROR "UNKOWN SYSTEM: Set CLANG_FORMAT_EXECUTABLE manually to the clang-format version 8.0 binary")
endif()
Expand All @@ -49,8 +49,8 @@ if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANG_FORMAT_EXECUTABLE}" )
file(COPY "${ITK_BINARY_DIR}/temp/${CLANG_FORMAT_EXECUTABLE_NAME}"
DESTINATION "${ITK_BINARY_DIR}"
FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
unset( CLANG_FORMAT_DOWNLOAD_URL )
set( CLANG_FORMAT_EXECUTABLE "${ITK_BINARY_DIR}/${CLANG_FORMAT_EXECUTABLE_NAME}" CACHE FILEPATH "The binary for clang-format" FORCE)
unset(CLANG_FORMAT_DOWNLOAD_URL)
set(CLANG_FORMAT_EXECUTABLE "${ITK_BINARY_DIR}/${CLANG_FORMAT_EXECUTABLE_NAME}" CACHE FILEPATH "The binary for clang-format" FORCE)
endif()
if(CLANG_FORMAT_EXECUTABLE)
mark_as_advanced(CLANG_FORMAT_EXECUTABLE)
Expand Down
4 changes: 2 additions & 2 deletions CMake/ITKClangTidySetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ option(ITK_USE_CLANGTIDY "Enable the use of clang-tidy to enforce coding best pr
mark_as_advanced(ITK_USE_CLANGTIDY)

if(ITK_USE_CLANGTIDY)
if ( ITK_USE_CLANGTIDY AND NOT EXISTS "${CLANGTIDY_EXECUTABLE}" )
find_program(CLANGTIDY_EXECUTABLE NAMES clang-tidy-13 clang-tidy-12 clang-tidy-11 clang-tidy-10 clang-tidy-9 clang-tidy-9 clang-tidy-8 clang-tidy )
if ( ITK_USE_CLANGTIDY AND NOT EXISTS "${CLANGTIDY_EXECUTABLE}")
find_program(CLANGTIDY_EXECUTABLE NAMES clang-tidy-13 clang-tidy-12 clang-tidy-11 clang-tidy-10 clang-tidy-9 clang-tidy-9 clang-tidy-8 clang-tidy)
endif()

if(CLANGTIDY_EXECUTABLE AND EXISTS "${CLANGTIDY_EXECUTABLE}")
Expand Down
4 changes: 2 additions & 2 deletions CMake/ITKFactoryRegistration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# All factories can be disabled with the following CMake code:
# foreach(_factory_name ${ITK_FACTORY_LIST})
# string(TOLOWER ${_factory_name} _f)
# set ( ITK_NO_${_factory_name}_FACTORY_REGISTER_MANAGER 1 )
# set ( ITK_NO_${_factory_name}_FACTORY_REGISTER_MANAGER 1)
# endforeach()
#
#
Expand Down Expand Up @@ -207,7 +207,7 @@ macro(itk_generate_factory_registration)
string(TOLOWER ${_factory_name} factory_lc)
set(LIST_OF_${factory_uc}_FORMATS "")
foreach(_format ${ITK_${_factory_name}})
set(Module )
set(Module)
foreach(_module ${ITK_FACTORY_NAMES})
string(REGEX MATCH "^.*::${_factory_name}::${_format}$" Module_Matched "${_module}")
if(Module_Matched)
Expand Down
Loading