mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-29 18:07:16 +02:00
ci: pre-commit
cmake-format checks fixed
This commit is contained in:
@ -11,6 +11,12 @@ parse:
|
||||
INSTALL_DIR: 1
|
||||
CODE_DEPENDS: 1
|
||||
DOCS_DEPENDS: 1
|
||||
add_units_module:
|
||||
pargs:
|
||||
nargs: 1
|
||||
kwargs:
|
||||
DEPENDENCIES: +
|
||||
HEADERS: +
|
||||
enable_iwyu:
|
||||
pargs:
|
||||
flags:
|
||||
|
@ -80,10 +80,13 @@
|
||||
# If provided, the generated target is excluded from the 'all' target.
|
||||
#
|
||||
function(add_header_test target)
|
||||
cmake_parse_arguments(ARGS "EXCLUDE_FROM_ALL" # options
|
||||
cmake_parse_arguments(
|
||||
ARGS
|
||||
"EXCLUDE_FROM_ALL" # options
|
||||
"" # 1 value args
|
||||
"HEADERS;EXCLUDE" # multivalued args
|
||||
${ARGN})
|
||||
${ARGN}
|
||||
)
|
||||
if(NOT ARGS_HEADERS)
|
||||
message(FATAL_ERROR "The `HEADERS` argument must be provided.")
|
||||
endif()
|
||||
@ -120,9 +123,7 @@ function(add_header_test target)
|
||||
if(NOT EXISTS "${standalone_main}")
|
||||
file(WRITE "${standalone_main}" "int main() { }")
|
||||
endif()
|
||||
add_executable(${target}
|
||||
${ARGS_EXCLUDE_FROM_ALL}
|
||||
${sources}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/headers/_standalone_main.cpp"
|
||||
add_executable(
|
||||
${target} ${ARGS_EXCLUDE_FROM_ALL} ${sources} "${CMAKE_CURRENT_BINARY_DIR}/headers/_standalone_main.cpp"
|
||||
)
|
||||
endfunction()
|
||||
|
@ -65,4 +65,3 @@ function(add_public_header_test target test_target)
|
||||
target_link_libraries(${target} PRIVATE ${test_target})
|
||||
target_include_directories(${target} PRIVATE .)
|
||||
endfunction()
|
||||
|
||||
|
@ -24,8 +24,7 @@ cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
function(validate_unparsed module prefix)
|
||||
if(${prefix}_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Invalid arguments '${${prefix}_UNPARSED_ARGUMENTS}' "
|
||||
"for module '${module}'")
|
||||
message(FATAL_ERROR "Invalid arguments '${${prefix}_UNPARSED_ARGUMENTS}' " "for module '${module}'")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@ -49,11 +48,7 @@ endfunction()
|
||||
function(add_units_module name)
|
||||
# parse arguments
|
||||
set(multiValues DEPENDENCIES HEADERS)
|
||||
cmake_parse_arguments(
|
||||
PARSE_ARGV 1
|
||||
ARG
|
||||
"" "" "${multiValues}"
|
||||
)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 ARG "" "" "${multiValues}")
|
||||
|
||||
# validate and process arguments
|
||||
validate_unparsed(${name} ARG)
|
||||
|
@ -25,12 +25,7 @@ cmake_minimum_required(VERSION 3.19)
|
||||
option(${projectPrefix}USE_LIBFMT "Enables usage of libfmt instead of the one from 'std'" ON)
|
||||
message(STATUS "${projectPrefix}USE_LIBFMT: ${${projectPrefix}USE_LIBFMT}")
|
||||
|
||||
add_units_module(core-fmt
|
||||
DEPENDENCIES
|
||||
mp-units::core
|
||||
HEADERS
|
||||
include/units/format.h
|
||||
)
|
||||
add_units_module(core-fmt DEPENDENCIES mp-units::core HEADERS include/units/format.h)
|
||||
target_compile_definitions(mp-units-core-fmt INTERFACE ${projectPrefix}USE_LIBFMT=$<BOOL:${${projectPrefix}USE_LIBFMT}>)
|
||||
|
||||
if(${projectPrefix}USE_LIBFMT)
|
||||
|
@ -22,9 +22,4 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(core-io
|
||||
DEPENDENCIES
|
||||
mp-units::core
|
||||
HEADERS
|
||||
include/units/quantity_io.h
|
||||
)
|
||||
add_units_module(core-io DEPENDENCIES mp-units::core HEADERS include/units/quantity_io.h)
|
||||
|
@ -34,7 +34,9 @@ include(CheckLibcxxInUse)
|
||||
check_libcxx_in_use(${projectPrefix}LIBCXX)
|
||||
|
||||
# core library definition
|
||||
add_library(mp-units-core INTERFACE
|
||||
add_library(
|
||||
mp-units-core
|
||||
INTERFACE
|
||||
include/units/base_dimension.h
|
||||
include/units/chrono.h
|
||||
include/units/concepts.h
|
||||
|
@ -22,14 +22,10 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(isq-iec80000
|
||||
DEPENDENCIES
|
||||
mp-units::si
|
||||
HEADERS
|
||||
include/units/isq/iec80000/binary_prefixes.h
|
||||
include/units/isq/iec80000/iec80000.h
|
||||
include/units/isq/iec80000/modulation_rate.h
|
||||
include/units/isq/iec80000/storage_capacity.h
|
||||
include/units/isq/iec80000/traffic_intensity.h
|
||||
include/units/isq/iec80000/transfer_rate.h
|
||||
add_units_module(
|
||||
isq-iec80000
|
||||
DEPENDENCIES mp-units::si
|
||||
HEADERS include/units/isq/iec80000/binary_prefixes.h include/units/isq/iec80000/iec80000.h
|
||||
include/units/isq/iec80000/modulation_rate.h include/units/isq/iec80000/storage_capacity.h
|
||||
include/units/isq/iec80000/traffic_intensity.h include/units/isq/iec80000/transfer_rate.h
|
||||
)
|
||||
|
@ -22,11 +22,10 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(isq-natural
|
||||
DEPENDENCIES
|
||||
mp-units::isq
|
||||
HEADERS
|
||||
include/units/isq/natural/acceleration.h
|
||||
add_units_module(
|
||||
isq-natural
|
||||
DEPENDENCIES mp-units::isq
|
||||
HEADERS include/units/isq/natural/acceleration.h
|
||||
include/units/isq/natural/constants.h
|
||||
include/units/isq/natural/energy.h
|
||||
include/units/isq/natural/force.h
|
||||
|
@ -22,11 +22,10 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(isq
|
||||
DEPENDENCIES
|
||||
mp-units::core
|
||||
HEADERS
|
||||
include/units/isq/dimensions/absorbed_dose.h
|
||||
add_units_module(
|
||||
isq
|
||||
DEPENDENCIES mp-units::core
|
||||
HEADERS include/units/isq/dimensions/absorbed_dose.h
|
||||
include/units/isq/dimensions/acceleration.h
|
||||
include/units/isq/dimensions/amount_of_substance.h
|
||||
include/units/isq/dimensions/angular_velocity.h
|
||||
|
@ -22,11 +22,10 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(si-cgs
|
||||
DEPENDENCIES
|
||||
mp-units::si
|
||||
HEADERS
|
||||
include/units/isq/si/cgs/acceleration.h
|
||||
add_units_module(
|
||||
si-cgs
|
||||
DEPENDENCIES mp-units::si
|
||||
HEADERS include/units/isq/si/cgs/acceleration.h
|
||||
include/units/isq/si/cgs/area.h
|
||||
include/units/isq/si/cgs/cgs.h
|
||||
include/units/isq/si/cgs/energy.h
|
||||
|
@ -22,11 +22,10 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(si-fps
|
||||
DEPENDENCIES
|
||||
mp-units::si
|
||||
HEADERS
|
||||
include/units/isq/si/fps/acceleration.h
|
||||
add_units_module(
|
||||
si-fps
|
||||
DEPENDENCIES mp-units::si
|
||||
HEADERS include/units/isq/si/fps/acceleration.h
|
||||
include/units/isq/si/fps/area.h
|
||||
include/units/isq/si/fps/density.h
|
||||
include/units/isq/si/fps/energy.h
|
||||
@ -40,4 +39,3 @@ add_units_module(si-fps
|
||||
include/units/isq/si/fps/time.h
|
||||
include/units/isq/si/fps/volume.h
|
||||
)
|
||||
|
||||
|
@ -22,13 +22,8 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(si-hep
|
||||
DEPENDENCIES
|
||||
mp-units::si
|
||||
HEADERS
|
||||
include/units/isq/si/hep/area.h
|
||||
include/units/isq/si/hep/energy.h
|
||||
include/units/isq/si/hep/hep.h
|
||||
include/units/isq/si/hep/mass.h
|
||||
include/units/isq/si/hep/momentum.h
|
||||
add_units_module(
|
||||
si-hep DEPENDENCIES mp-units::si
|
||||
HEADERS include/units/isq/si/hep/area.h include/units/isq/si/hep/energy.h include/units/isq/si/hep/hep.h
|
||||
include/units/isq/si/hep/mass.h include/units/isq/si/hep/momentum.h
|
||||
)
|
||||
|
@ -22,10 +22,6 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(si-iau
|
||||
DEPENDENCIES
|
||||
mp-units::si
|
||||
HEADERS
|
||||
include/units/isq/si/iau/iau.h
|
||||
include/units/isq/si/iau/length.h
|
||||
add_units_module(
|
||||
si-iau DEPENDENCIES mp-units::si HEADERS include/units/isq/si/iau/iau.h include/units/isq/si/iau/length.h
|
||||
)
|
||||
|
@ -22,10 +22,7 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(si-imperial
|
||||
DEPENDENCIES
|
||||
mp-units::si
|
||||
HEADERS
|
||||
include/units/isq/si/imperial/imperial.h
|
||||
add_units_module(
|
||||
si-imperial DEPENDENCIES mp-units::si HEADERS include/units/isq/si/imperial/imperial.h
|
||||
include/units/isq/si/imperial/length.h
|
||||
)
|
||||
|
@ -22,14 +22,10 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(si-international
|
||||
DEPENDENCIES
|
||||
mp-units::si
|
||||
HEADERS
|
||||
include/units/isq/si/international/area.h
|
||||
include/units/isq/si/international/international.h
|
||||
include/units/isq/si/international/length.h
|
||||
include/units/isq/si/international/speed.h
|
||||
add_units_module(
|
||||
si-international
|
||||
DEPENDENCIES mp-units::si
|
||||
HEADERS include/units/isq/si/international/area.h include/units/isq/si/international/international.h
|
||||
include/units/isq/si/international/length.h include/units/isq/si/international/speed.h
|
||||
include/units/isq/si/international/volume.h
|
||||
)
|
||||
|
||||
|
@ -22,11 +22,7 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(si-typographic
|
||||
DEPENDENCIES
|
||||
mp-units::si
|
||||
HEADERS
|
||||
include/units/isq/si/typographic/length.h
|
||||
add_units_module(
|
||||
si-typographic DEPENDENCIES mp-units::si HEADERS include/units/isq/si/typographic/length.h
|
||||
include/units/isq/si/typographic/typographic.h
|
||||
)
|
||||
|
||||
|
@ -22,11 +22,6 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(si-uscs
|
||||
DEPENDENCIES
|
||||
mp-units::si
|
||||
HEADERS
|
||||
include/units/isq/si/uscs/length.h
|
||||
include/units/isq/si/uscs/uscs.h
|
||||
add_units_module(
|
||||
si-uscs DEPENDENCIES mp-units::si HEADERS include/units/isq/si/uscs/length.h include/units/isq/si/uscs/uscs.h
|
||||
)
|
||||
|
||||
|
@ -22,11 +22,10 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(si
|
||||
DEPENDENCIES
|
||||
mp-units::isq
|
||||
HEADERS
|
||||
include/units/isq/si/absorbed_dose.h
|
||||
add_units_module(
|
||||
si
|
||||
DEPENDENCIES mp-units::isq
|
||||
HEADERS include/units/isq/si/absorbed_dose.h
|
||||
include/units/isq/si/acceleration.h
|
||||
include/units/isq/si/amount_of_substance.h
|
||||
include/units/isq/si/angular_velocity.h
|
||||
|
Reference in New Issue
Block a user