Skip to content

Commit

Permalink
Fix cmake-lint args in pre-commit hook [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeu committed Feb 23, 2024
1 parent 6419914 commit 9395534
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ repos:
exclude: cmake/conan.cmake
- id: cmake-lint
args:
- --linelength=120
- --spaces=4
- --line-width=120
- --tab-size=4
- --disabled-codes=C0103
exclude: cmake/conan.cmake
10 changes: 5 additions & 5 deletions cmake/compilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ set(SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})

# Make the variables HAVE_MAT_UINT8_T, etc...
set(TYPES uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t)
foreach(TYPE ${TYPES})
check_type_size(${TYPE} "SIZEOF_${TYPE}")
set(_mat_${TYPE} ${TYPE})
string(TOUPPER ${TYPE} TYPE_UPPER)
set(HAVE_MAT_${TYPE_UPPER} ${HAVE_SIZEOF_${TYPE}})
foreach(type ${TYPES})
check_type_size(${type} "SIZEOF_${type}")
set(_mat_${type} ${type})
string(TOUPPER ${type} TYPE_UPPER)
set(HAVE_MAT_${TYPE_UPPER} ${HAVE_SIZEOF_${type}})
if(STDINT_MSVC)
set(HAVE_MAT_${TYPE_UPPER} 1)
endif()
Expand Down
6 changes: 3 additions & 3 deletions cmake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if(NOT HAVE_SNPRINTF OR UNIX)
if(HAVE_LIBM)
target_link_libraries(test_snprintf m)
endif()
target_include_directories(test_snprintf
PUBLIC ${PROJECT_SOURCE_DIR}/src
PUBLIC ${PROJECT_BINARY_DIR}/src
target_include_directories(test_snprintf PUBLIC
${PROJECT_SOURCE_DIR}/src
${PROJECT_BINARY_DIR}/src
)
endif()
20 changes: 10 additions & 10 deletions cmake/thirdParties.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ if(NOT HAVE_HDF5 AND MATIO_MAT73)
message(FATAL_ERROR "MAT73 requires HDF5")
endif()


macro(matio_create_zlib target)
# Create the zlib target
macro(MATIO_CREATE_ZLIB target)
add_library(MATIO::ZLIB INTERFACE IMPORTED)
set_target_properties(MATIO::ZLIB PROPERTIES INTERFACE_LINK_LIBRARIES ${target})
set(ZLIB_FOUND TRUE)
Expand All @@ -90,23 +90,23 @@ if(MATIO_WITH_ZLIB)
endif()

if(MATIO_USE_CONAN AND TARGET CONAN_PKG::zlib)
matio_create_zlib(CONAN_PKG::zlib)
MATIO_CREATE_ZLIB(CONAN_PKG::zlib)
elseif(HDF5_USE_STATIC_LIBRARIES AND TARGET zlib-static)
matio_create_zlib(zlib-static)
MATIO_CREATE_ZLIB(zlib-static)
elseif(HDF5_USE_STATIC_LIBRARIES AND TARGET hdf5::zlib-static)
matio_create_zlib(hdf5::zlib-static)
MATIO_CREATE_ZLIB(hdf5::zlib-static)
elseif(NOT HDF5_USE_STATIC_LIBRARIES AND TARGET zlib-shared)
matio_create_zlib(zlib-shared)
MATIO_CREATE_ZLIB(zlib-shared)
elseif(NOT HDF5_USE_STATIC_LIBRARIES AND TARGET hdf5::zlib-shared)
matio_create_zlib(hdf5::zlib-shared)
MATIO_CREATE_ZLIB(hdf5::zlib-shared)
elseif(TARGET zlib)
matio_create_zlib(zlib)
MATIO_CREATE_ZLIB(zlib)
elseif(TARGET ZLIB::ZLIB)
matio_create_zlib(ZLIB::ZLIB)
MATIO_CREATE_ZLIB(ZLIB::ZLIB)
else()
find_package(ZLIB 1.2.3)
if(ZLIB_FOUND)
matio_create_zlib(ZLIB::ZLIB)
MATIO_CREATE_ZLIB(ZLIB::ZLIB)
endif()
endif()

Expand Down

0 comments on commit 9395534

Please sign in to comment.