check: run pre-commit on all files

This commit is contained in:
Markus Hofbauer committed 2022-04-02 18:58:23 +02:00
1 parent 4c9ada5f93
commit cf7a7ed17a
26 files changed
+652 -685

No files matched your search

+4 -15
View File
@@ -21,10 +21,7 @@
# SOFTWARE.
cmake_minimum_required(VERSION 3.15)
project(mp-units
VERSION 0.8.0
LANGUAGES CXX
)
project(mp-units VERSION 0.8.0 LANGUAGES CXX)
set(projectPrefix UNITS_)
@@ -47,12 +44,7 @@ add_subdirectory(systems)
# project-wide wrapper
add_library(mp-units INTERFACE)
target_link_libraries(mp-units INTERFACE
mp-units::core
mp-units::core-io
mp-units::core-fmt
mp-units::systems
)
target_link_libraries(mp-units INTERFACE mp-units::core mp-units::core-io mp-units::core-fmt mp-units::systems)
add_library(mp-units::mp-units ALIAS mp-units)
install(TARGETS mp-units EXPORT mp-unitsTargets)
@@ -63,11 +55,8 @@ include(CMakePackageConfigHelpers)
write_basic_package_version_file(mp-unitsConfigVersion.cmake COMPATIBILITY SameMajorVersion)
# installation
install(EXPORT mp-unitsTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mp-units
NAMESPACE mp-units::
)
install(EXPORT mp-unitsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mp-units NAMESPACE mp-units::)
install(FILES mp-unitsConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/mp-unitsConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mp-units
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mp-units
)
+3 -3
View File
@@ -28,9 +28,9 @@ cmake_minimum_required(VERSION 3.15)
function(add_units_module name)
add_library(mp-units-${name} INTERFACE)
target_link_libraries(mp-units-${name} INTERFACE ${ARGN})
target_include_directories(mp-units-${name} ${unitsAsSystem} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
target_include_directories(
mp-units-${name} ${unitsAsSystem} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
set_target_properties(mp-units-${name} PROPERTIES EXPORT_NAME ${name})
add_library(mp-units::${name} ALIAS mp-units-${name})
+2 -2
View File
@@ -29,6 +29,6 @@ add_units_module(core-fmt mp-units::core)
target_compile_definitions(mp-units-core-fmt INTERFACE ${projectPrefix}USE_LIBFMT=$<BOOL:${${projectPrefix}USE_LIBFMT}>)
if(${projectPrefix}USE_LIBFMT)
find_package(fmt CONFIG REQUIRED)
target_link_libraries(mp-units-core-fmt INTERFACE fmt::fmt)
find_package(fmt CONFIG REQUIRED)
target_link_libraries(mp-units-core-fmt INTERFACE fmt::fmt)
endif()
+10 -9
View File
@@ -36,12 +36,10 @@ check_libcxx_in_use(${projectPrefix}LIBCXX)
# core library definition
add_library(mp-units-core INTERFACE)
target_compile_features(mp-units-core INTERFACE cxx_std_20)
target_link_libraries(mp-units-core INTERFACE
gsl::gsl-lite
)
target_include_directories(mp-units-core ${unitsAsSystem} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
target_link_libraries(mp-units-core INTERFACE gsl::gsl-lite)
target_include_directories(
mp-units-core ${unitsAsSystem} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@@ -50,8 +48,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_link_libraries(mp-units-core INTERFACE range-v3::range-v3)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(mp-units-core INTERFACE
/utf-8 # Specifies both the source character set and the execution character set as UTF-8
target_compile_options(
mp-units-core
INTERFACE /utf-8 # Specifies both the source character set and the execution character set as UTF-8
)
endif()
@@ -59,7 +58,9 @@ if(DEFINED ${projectPrefix}DOWNCAST_MODE)
set(downcast_mode_options OFF ON AUTO)
list(FIND downcast_mode_options "${${projectPrefix}DOWNCAST_MODE}" downcast_mode)
if(downcast_mode EQUAL -1)
message(FATAL_ERROR "'${projectPrefix}DOWNCAST_MODE' should be one of ${downcast_mode_options} ('${${projectPrefix}DOWNCAST_MODE}' received)")
message(FATAL_ERROR
"'${projectPrefix}DOWNCAST_MODE' should be one of ${downcast_mode_options} ('${${projectPrefix}DOWNCAST_MODE}' received)"
)
else()
message(STATUS "${projectPrefix}DOWNCAST_MODE: ${${projectPrefix}DOWNCAST_MODE}")
target_compile_definitions(mp-units-core INTERFACE ${projectPrefix}DOWNCAST_MODE=${downcast_mode})
+15 -13
View File
@@ -38,19 +38,21 @@ add_subdirectory(si-uscs)
# wrapper for all the systems
add_library(mp-units-systems INTERFACE)
target_link_libraries(mp-units-systems INTERFACE
mp-units::isq
mp-units::isq-iec80000
mp-units::isq-natural
mp-units::si
mp-units::si-cgs
mp-units::si-fps
mp-units::si-hep
mp-units::si-iau
mp-units::si-imperial
mp-units::si-international
mp-units::si-typographic
mp-units::si-uscs
target_link_libraries(
mp-units-systems
INTERFACE
mp-units::isq
mp-units::isq-iec80000
mp-units::isq-natural
mp-units::si
mp-units::si-cgs
mp-units::si-fps
mp-units::si-hep
mp-units::si-iau
mp-units::si-imperial
mp-units::si-international
mp-units::si-typographic
mp-units::si-uscs
)
add_library(mp-units::systems ALIAS mp-units-systems)
set_target_properties(mp-units-systems PROPERTIES EXPORT_NAME systems)