Skip to content

Commit

Permalink
STYLE: Convert tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Jan 13, 2023
1 parent 465a87f commit 3a52fbb
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 77 deletions.
40 changes: 19 additions & 21 deletions CMake/ITKSetStandardCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14.0)
cmake_policy(SET CMP0083 NEW)
include(CheckPIESupported)
check_pie_supported()
cmake_policy(SET CMP0083 NEW)
include(CheckPIESupported)
check_pie_supported()
endif()

function(check_c_compiler_flags c_flag_var)
set(local_c_flags "")
set(flag_list "${ARGN}")
foreach(flag IN LISTS flag_list)
string(REPLACE "=" "_" flag_var ${flag} )
if(CMAKE_VERSION VERSION_LESS 2.8.9)
ITK_CHECK_C_COMPILER_FLAG(${flag} C_HAS_WARNING${flag_var})
else()
check_c_compiler_flag(${flag} C_HAS_WARNING${flag_var})
endif()
if(CMAKE_VERSION VERSION_LESS 2.8.9)
ITK_CHECK_C_COMPILER_FLAG(${flag} C_HAS_WARNING${flag_var})
else()
check_c_compiler_flag(${flag} C_HAS_WARNING${flag_var})
endif()
if(${C_HAS_WARNING${flag_var}})
set(local_c_flags "${local_c_flags} ${flag}")
endif()
Expand All @@ -52,11 +52,11 @@ function(check_cxx_compiler_flags cxx_flag_var)
set(flag_list "${ARGN}")
foreach(flag IN LISTS flag_list)
string(REPLACE "=" "_" flag_var ${flag} )
if(CMAKE_VERSION VERSION_LESS 2.8.9)
ITK_CHECK_CXX_COMPILER_FLAG(${flag} CXX_HAS_WARNING${flag_var})
else()
check_cxx_compiler_flag(${flag} CXX_HAS_WARNING${flag_var})
endif()
if(CMAKE_VERSION VERSION_LESS 2.8.9)
ITK_CHECK_CXX_COMPILER_FLAG(${flag} CXX_HAS_WARNING${flag_var})
else()
check_cxx_compiler_flag(${flag} CXX_HAS_WARNING${flag_var})
endif()
if(${CXX_HAS_WARNING${flag_var}})
set(local_cxx_flags "${local_cxx_flags} ${flag}")
endif()
Expand Down Expand Up @@ -209,7 +209,7 @@ macro(check_compiler_platform_flags)
-D_CRT_TIME_FUNCTIONS_NO_DEPRECATE
-D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE
)
)
endif()
# With MS compilers on Win64, we need the /bigobj switch, else generated
# code results in objects with number of sections exceeding object file
Expand Down Expand Up @@ -243,11 +243,11 @@ macro(check_compiler_platform_flags)
# if CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is on, then
# BUILD_SHARED_LIBS works as it would on other systems
if(NOT CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS)
if(BUILD_SHARED_LIBS)
set(ITK_LIBRARY_BUILD_TYPE "SHARED")
else()
set(ITK_LIBRARY_BUILD_TYPE "STATIC")
endif()
if(BUILD_SHARED_LIBS)
set(ITK_LIBRARY_BUILD_TYPE "SHARED")
else()
set(ITK_LIBRARY_BUILD_TYPE "STATIC")
endif()
# turn off BUILD_SHARED_LIBS as ITK_LIBRARY_BUILD_TYPE
# is used on the libraries that have markup.
set(BUILD_SHARED_LIBS OFF)
Expand Down Expand Up @@ -342,7 +342,6 @@ macro(check_compiler_platform_flags)
endif()
endif()


# mingw thread support
if(MINGW)
set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -mthreads")
Expand Down Expand Up @@ -397,7 +396,6 @@ mark_as_advanced(${PROJECT_NAME}_C_WARNING_FLAGS)
unset(C_WARNING_FLAGS)
unset(CXX_WARNING_FLAGS)


if(NOT ${PROJECT_NAME}_C_OPTIMIZATION_FLAGS OR NOT ${PROJECT_NAME}_CXX_OPTIMIZATION_FLAGS ) # Only check once if not explicitly set on command line
#-----------------------------------------------------------------------------
#Check the set of warning flags the compiler supports
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ mark_as_advanced(ADDITIONAL_CXX_FLAGS)
#-----------------------------------------------------------------------------
# Required by Slicer extension build system for reasons. See
# https://github.com/Slicer/Slicer/commit/b160ec13f276a86306513954ef8b08a5332afc2e
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};RuntimeLibraries;/")
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};RuntimeLibraries;/")

#-----------------------------------------------------------------------------
# Superbuild script
Expand Down
72 changes: 41 additions & 31 deletions SuperBuild/External_Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,44 +61,44 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}"

if(MSVC)
if(MSVC_VERSION GREATER_EQUAL 1400 AND MSVC_VERSION LESS 1500)
list(APPEND Boost_b2_Command toolset=msvc-8.0)
list(APPEND Boost_b2_Command toolset=msvc-8.0)
elseif(MSVC_VERSION GREATER_EQUAL 1500 AND MSVC_VERSION LESS 1600)
list(APPEND Boost_b2_Command toolset=msvc-9.0)
list(APPEND Boost_b2_Command toolset=msvc-9.0)
elseif(MSVC_VERSION GREATER_EQUAL 1600 AND MSVC_VERSION LESS 1700)
list(APPEND Boost_b2_Command toolset=msvc-10.0)
list(APPEND Boost_b2_Command toolset=msvc-10.0)
elseif(MSVC_VERSION GREATER_EQUAL 1700 AND MSVC_VERSION LESS 1800)
list(APPEND Boost_b2_Command toolset=msvc-11.0)
list(APPEND Boost_b2_Command toolset=msvc-11.0)
elseif(MSVC_VERSION GREATER_EQUAL 1800 AND MSVC_VERSION LESS 1900)
list(APPEND Boost_b2_Command toolset=msvc-12.0)
list(APPEND Boost_b2_Command toolset=msvc-12.0)
elseif(MSVC_VERSION GREATER_EQUAL 1900 AND MSVC_VERSION LESS 1910)
list(APPEND Boost_b2_Command toolset=msvc-14.0)
list(APPEND Boost_b2_Command toolset=msvc-14.0)
elseif(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
list(APPEND Boost_b2_Command toolset=msvc-14.1)
list(APPEND Boost_b2_Command toolset=msvc-14.1)
elseif(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1927)
list(APPEND Boost_b2_Command toolset=msvc-14.2)
else()
message(FATAL_ERROR "Unknown MSVC compiler version [${MSVC_VERSION}]")
endif()
list(APPEND Boost_b2_Command toolset=msvc-14.2)
else()
message(FATAL_ERROR "Unknown MSVC compiler version [${MSVC_VERSION}]")
endif()
endif()

if(XCODE_VERSION OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
list(APPEND Boost_b2_Command toolset=clang)
elseif(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND Boost_b2_Command toolset=gcc)
endif()

if(ENV{CC})
# CMake apprarently puts the full path of the compiler into CC
# The user might specify a non-default gcc compiler through ENV
message(STATUS "ENV{CC}=$ENV{CC}")
get_filename_component( gccToolset "$ENV{CC}" NAME )

# see: https://svn.boost.org/trac/boost/ticket/5917
string(TOLOWER ${gccToolset} gccToolset)
if(gccToolset STREQUAL "cc")
set(gccToolset "gcc")
endif()
list(APPEND Boost_b2_Command toolset=${gccToolset})
message(STATUS "ENV{CC}=$ENV{CC}")
get_filename_component( gccToolset "$ENV{CC}" NAME )

# see: https://svn.boost.org/trac/boost/ticket/5917
string(TOLOWER ${gccToolset} gccToolset)
if(gccToolset STREQUAL "cc")
set(gccToolset "gcc")
endif()
list(APPEND Boost_b2_Command toolset=${gccToolset})
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand All @@ -107,16 +107,26 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}"
set(Boost_address_model 32)
endif()

ExternalProject_Add(${proj}
${${proj}_EP_ARGS}
BUILD_IN_SOURCE 1
URL ${Boost_url}
URL_MD5 ${Boost_md5}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ${Boost_Bootstrap_Command} --prefix=${Boost_Install_Dir}/lib
BUILD_COMMAND ${Boost_b2_Command} install -j8 --prefix=${Boost_Install_Dir} --with-thread --with-filesystem --with-system --with-date_time --with-program_options --with-atomic address-model=${Boost_address_model} link=static
INSTALL_COMMAND ""
)
ExternalProject_Add(${proj}
${${proj}_EP_ARGS}
BUILD_IN_SOURCE 1
URL ${Boost_url}
URL_MD5 ${Boost_md5}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ${Boost_Bootstrap_Command}
--prefix=${Boost_Install_Dir}/lib
BUILD_COMMAND ${Boost_b2_Command} install -j8
--prefix=${Boost_Install_Dir}
--with-thread
--with-filesystem
--with-system
--with-date_time
--with-program_options
--with-atomic
address-model=${Boost_address_model}
link=static
INSTALL_COMMAND ""
)

if(NOT WIN32)
set(BOOST_ROOT ${Boost_Install_Dir})
Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/External_ITK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(NOT DEFINED ITK_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
SOURCE_DIR ${EP_SOURCE_DIR}
BINARY_DIR ${EP_BINARY_DIR}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/External_SlicerExecutionModel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if(NOT DEFINED SlicerExecutionModel_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM
CMAKE_ARGS -Wno-dev --no-warn-unused-cli
CMAKE_CACHE_ARGS
${COMMON_EXTERNAL_PROJECT_ARGS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_TESTING:BOOL=OFF
-DITK_DIR:PATH=${ITK_DIR}
-DSlicerExecutionModel_LIBRARY_PROPERTIES:STRING=${Slicer_LIBRARY_PROPERTIES}
Expand Down
4 changes: 2 additions & 2 deletions SuperBuild/External_VTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ endif()
# For MinGW for case of compilation failure cause of 'too many sections' error
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
if(MINGW)
set(ep_common_cxx_flags "${ep_common_cxx_flags} -Wa,-mbig-obj")
set(ep_common_cxx_flags "${ep_common_cxx_flags} -Wa,-mbig-obj")
elseif(MSVC)
set(ep_common_cxx_flags "${ep_common_cxx_flags} /bigobj")
set(ep_common_cxx_flags "${ep_common_cxx_flags} /bigobj")
endif()
endif()

Expand Down
10 changes: 5 additions & 5 deletions SuperBuild/External_zlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ if(NOT DEFINED zlib_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
set(ZLIB_ROOT ${zlib_DIR})
set(ZLIB_INCLUDE_DIR ${zlib_DIR}/include)
if(WIN32)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") #to make compatible with msys2 gcc build
set(ZLIB_LIBRARY ${zlib_DIR}/lib/libzlib.a)
else()
set(ZLIB_LIBRARY ${zlib_DIR}/lib/zlib.lib)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") #to make compatible with msys2 gcc build
set(ZLIB_LIBRARY ${zlib_DIR}/lib/libzlib.a)
else()
set(ZLIB_LIBRARY ${zlib_DIR}/lib/zlib.lib)
endif()
else()
set(ZLIB_LIBRARY ${zlib_DIR}/lib/libzlib.a)
endif()
Expand Down
12 changes: 6 additions & 6 deletions UKFTractography.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ endif()

#-----------------------------------------------------------------------------
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common)
set(UKF_STATIC)
if(NOT BUILD_SHARED_LIBS)
set(UKF_STATIC 1)
if(WIN32)
add_definitions("-DUKF_STATIC")
endif()
set(UKF_STATIC)
if(NOT BUILD_SHARED_LIBS)
set(UKF_STATIC 1)
if(WIN32)
add_definitions("-DUKF_STATIC")
endif()
endif()
add_subdirectory(ukf)
add_subdirectory(UKFTractography)
Expand Down
8 changes: 4 additions & 4 deletions ukf/NrrdData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ void NrrdData::GetSeeds(const std::vector<int>& labels,
std::vector<int>::const_iterator cit;

// Go through the volume.
size_t nx = _seed_nrrd->axis[2].size;
size_t ny = _seed_nrrd->axis[1].size;
size_t nz = _seed_nrrd->axis[0].size;
size_t nx = _seed_nrrd->axis[2].size;
size_t ny = _seed_nrrd->axis[1].size;
size_t nz = _seed_nrrd->axis[0].size;
assert(_seed_data);

if ( !(nx == _dim[0] && ny == _dim[1] && nz == _dim[2]) )
Expand All @@ -263,7 +263,7 @@ void NrrdData::GetSeeds(const std::vector<int>& labels,
for( cit = labels.begin(); cit != labels.end(); ++cit )
{
int value = 0;
size_t index = ny * nz * i + nz * j + k;
size_t index = ny * nz * i + nz * j + k;

switch( _seed_data_type )
{
Expand Down
6 changes: 3 additions & 3 deletions ukf/cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s)
// HANDLE ERRORNOUS INPUT
if (dwiFile.empty() || maskFile.empty() || tracts.empty()) {
std::cout << "Error! Must indicate DWI data, mask and tracts output files!" << std::endl << std::endl ;
return 1 ; //This is to indicate that the module returns with error
return 1 ; //This is to indicate that the module returns with error
}

if (numTensor == 1) {
tractsWithSecondTensor.clear() ; //Reassure the string is empty
tractsWithSecondTensor.clear() ; //Reassure the string is empty
}

if (l_maxHalfFiberLength <= 0) {
Expand Down Expand Up @@ -126,7 +126,7 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s)
}

if (labels.size() == 0) {
labels.push_back(1) ; //Default to use label 1
labels.push_back(1) ; //Default to use label 1
}

if (l_stoppingFA == 0.15) {
Expand Down
2 changes: 1 addition & 1 deletion ukf/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef std::vector<WorkList> WorkDistribution;
// ~ProgressThread() ;
// } ;

// const int PROGRESS_REPORT_INTERVAL = 2 ; //Report progress once per 2 seconds
// const int PROGRESS_REPORT_INTERVAL = 2 ; //Report progress once per 2 seconds

WorkDistribution GenerateWorkDistribution(const int num_threads, const int total_num_works);

Expand Down
2 changes: 1 addition & 1 deletion ukf/tractography.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ void Tractography::Init(std::vector<SeedPointInfo>& seed_infos)
}

if (! (seeds.size() > 0)) {
std::cout << "No matching label ROI seeds found! Please verify label selection.";
std::cout << "No matching label ROI seeds found! Please verify label selection.";
throw;
}

Expand Down

0 comments on commit 3a52fbb

Please sign in to comment.