Skip to content

Commit

Permalink
cmake: remove tabulations in .cmake files
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 11, 2022
1 parent a323204 commit e67c8e5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
4 changes: 2 additions & 2 deletions cmake/helpers/CheckCompilerMachineOption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function(check_compiler_machine_option outvar feature)
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86|AMD64)")
if(MSVC AND (${feature} MATCHES "SSE"))
# SSE2 and SSE are default on
set(_FLAGS " ")
set(_FLAGS " ")
elseif(MSVC)
# Only Visual Studio 2017 version 15.3 / Visual C++ 19.11 & up have support for AVX-512.
# https://blogs.msdn.microsoft.com/vcblog/2017/07/11/microsoft-visual-studio-2017-supports-intel-avx-512/
Expand Down Expand Up @@ -65,7 +65,7 @@ function(check_compiler_machine_option outvar feature)
endif()
else() # not MSVC and not ICC => GCC, Clang, Open64
string(TOLOWER ${feature} _flag)
string(REPLACE "_" "." _flag "${_flag}")
string(REPLACE "_" "." _flag "${_flag}")
__check_compiler_flag("-m${_flag}" test_${_flag})
if(test_${_flag})
set(header_table
Expand Down
18 changes: 9 additions & 9 deletions cmake/helpers/CheckDependentLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,10 @@ if (ARMADILLO_FOUND)
"
#include <armadillo>
int main(int argc, char** argv) {
arma::mat matInput(2,2);
const arma::mat& matInv = arma::inv(matInput);
return 0;
}
arma::mat matInput(2,2);
const arma::mat& matInv = arma::inv(matInput);
return 0;
}
"
ARMADILLO_TEST_PROGRAM_WITHOUT_LAPACK_COMPILES)
unset(CMAKE_MSVC_RUNTIME_LIBRARY)
Expand All @@ -440,11 +440,11 @@ if (ARMADILLO_FOUND)
"
#include <armadillo>
int main(int argc, char** argv) {
arma::mat matInput(2,2);
const arma::mat& matInv = arma::inv(matInput);
return 0;
}
"
arma::mat matInput(2,2);
const arma::mat& matInv = arma::inv(matInput);
return 0;
}
"
ARMADILLO_TEST_PROGRAM_WITH_LAPACK_COMPILES)
unset(CMAKE_MSVC_RUNTIME_LIBRARY)
unset(CMAKE_TRY_COMPILE_CONFIGURATION)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/packages/FindMSSQL_NCLI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This module defines the following variables:
MSSQL_NCLI_INCLUDE_DIRS - where to find sqlncli.h, etc.
MSSQL_NCLI_LIBRARIES - List of libraries when using MSSQL_NCLI.
MSSQL_NCLI_FOUND - True if MSSQL_NCLI found.
MSSQL_NCLI_VERSION - Major Version (11, 10, ...). Can be a input variable too
MSSQL_NCLI_VERSION - Major Version (11, 10, ...). Can be a input variable too
#]=======================================================================]

Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/packages/FindMSSQL_ODBC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This module defines the following variables:
MSSQL_ODBC_INCLUDE_DIRS - where to find msodbcsql.h, etc.
MSSQL_ODBC_LIBRARIES - List of libraries when using MSSQL_ODBC.
MSSQL_ODBC_FOUND - True if MSSQL_ODBC found.
MSSQL_ODBC_VERSION - Major Version (17, 13, ...). Can be a input variable too
MSSQL_ODBC_VERSION - Major Version (17, 13, ...). Can be a input variable too
#]=======================================================================]

Expand Down
15 changes: 7 additions & 8 deletions cmake/modules/packages/FindMySQL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ find_path(MYSQL_INCLUDE_DIR
DOC "MySQL Client library includes")

if( MYSQL_INCLUDE_DIR AND EXISTS "${MYSQL_INCLUDE_DIR}/mysql_version.h" )
file( STRINGS "${MYSQL_INCLUDE_DIR}/mysql_version.h"
MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" )
string( REGEX REPLACE
"^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING
"${MYSQL_VERSION_H}" )
file( STRINGS "${MYSQL_INCLUDE_DIR}/mysql_version.h"
MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" )
string( REGEX REPLACE
"^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING
"${MYSQL_VERSION_H}" )
endif()

find_library(MYSQL_LIBRARY
NAMES mysqlclient mysqlclient_r)
find_library(MYSQL_LIBRARY NAMES mysqlclient mysqlclient_r)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MySQL
FOUND_VAR MYSQL_FOUND
REQUIRED_VARS MYSQL_LIBRARY MYSQL_INCLUDE_DIR
VERSION_VAR MYSQL_VERSION_STRING)
VERSION_VAR MYSQL_VERSION_STRING)
include(FeatureSummary)
set_package_properties(MYSQL PROPERTIES
DESCRIPTION "MySQL Client library"
Expand Down
2 changes: 1 addition & 1 deletion scripts/detect_tabulations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cd "$GDAL_ROOT"
ret_code=0

echo "Checking for tabulation characters..."
if grep -r --files-with-matches -P --include='*.h' --include='*.cpp' '\t' alg gnm port ogr gcore frmts apps | grep -v -e frmts/msg/PublicDecompWT -e frmts/jpeg/libjpeg -e frmts/gtiff/libtiff -e frmts/gtiff/libgeotiff -e frmts/grib/degrib -e ogr/ogrsf_frmts/geojson/libjson -e frmts/hdf4/hdf-eos -e frmts/gif/giflib -e frmts/pcraster/libcsf -e frmts/png/libpng -e cpl_mem_cache ; then
if grep -r --files-with-matches -P --include='*.h' --include='*.cpp' --include='*.cmake' '\t' cmake alg gnm port ogr gcore frmts apps | grep -v -e frmts/msg/PublicDecompWT -e frmts/jpeg/libjpeg -e frmts/gtiff/libtiff -e frmts/gtiff/libgeotiff -e frmts/grib/degrib -e ogr/ogrsf_frmts/geojson/libjson -e frmts/hdf4/hdf-eos -e frmts/gif/giflib -e frmts/pcraster/libcsf -e frmts/png/libpng -e cpl_mem_cache -e cmake/modules/thirdparty; then
echo "FAIL: tabulations detected. Please remove them!"
ret_code=1
else
Expand Down

0 comments on commit e67c8e5

Please sign in to comment.