mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 02:17:16 +02:00
refactor: modules support redesigned
This commit is contained in:
@ -1,22 +1,12 @@
|
||||
parse:
|
||||
additional_commands:
|
||||
add_documentation:
|
||||
pargs:
|
||||
nargs: 1
|
||||
flags:
|
||||
- ALL
|
||||
kwargs:
|
||||
BREATHE_PROJECT: 1
|
||||
CODE_SOURCE_DIR: 1
|
||||
INSTALL_DIR: 1
|
||||
CODE_DEPENDS: 1
|
||||
DOCS_DEPENDS: 1
|
||||
add_units_module:
|
||||
pargs:
|
||||
nargs: 1
|
||||
kwargs:
|
||||
DEPENDENCIES: +
|
||||
HEADERS: +
|
||||
DEPENDENCIES: "+"
|
||||
HEADERS: "*"
|
||||
MODULE_INTERFACE_UNIT: "?"
|
||||
enable_iwyu:
|
||||
pargs:
|
||||
flags:
|
||||
@ -26,13 +16,6 @@ parse:
|
||||
kwargs:
|
||||
MAPPING_FILE: 1
|
||||
MAX_LINE_LENGTH: 1
|
||||
metabench_add_chart:
|
||||
pargs:
|
||||
nargs: 1
|
||||
kwargs:
|
||||
TITLE: 1
|
||||
SUBTITLE: 1
|
||||
DATASETS: +
|
||||
format:
|
||||
line_width: 120
|
||||
tab_size: 4
|
||||
|
@ -27,53 +27,47 @@ if(NOT TARGET gsl::gsl-lite)
|
||||
find_package(gsl-lite CONFIG REQUIRED)
|
||||
endif()
|
||||
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
add_library(example_utils INTERFACE)
|
||||
target_compile_definitions(example_utils INTERFACE ${projectPrefix}MODULES)
|
||||
target_include_directories(example_utils INTERFACE include)
|
||||
target_link_libraries(example_utils INTERFACE gsl::gsl-lite)
|
||||
endif()
|
||||
|
||||
add_library(example_utils-headers INTERFACE)
|
||||
target_include_directories(example_utils-headers INTERFACE include)
|
||||
target_link_libraries(example_utils-headers INTERFACE gsl::gsl-lite)
|
||||
|
||||
#
|
||||
# add_example(target <mp-units-depependencies>...)
|
||||
# add_example(target <depependencies>...)
|
||||
#
|
||||
function(add_example target)
|
||||
add_executable(${target} ${target}.cpp)
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(${target} PRIVATE mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(${target} PRIVATE ${ARGN})
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
add_executable(${target} ${target}.cpp)
|
||||
target_compile_definitions(${target} PUBLIC ${projectPrefix}MODULES)
|
||||
target_link_libraries(${target} PRIVATE mp-units::mp-units ${ARGN})
|
||||
endif()
|
||||
|
||||
add_executable(${target}-headers ${target}.cpp)
|
||||
list(TRANSFORM ARGN APPEND "-headers")
|
||||
target_link_libraries(${target}-headers PRIVATE mp-units::mp-units ${ARGN})
|
||||
endfunction()
|
||||
|
||||
add_example(avg_speed mp-units::core-io mp-units::si mp-units::cgs mp-units::usc)
|
||||
add_example(capacitor_time_curve mp-units::core-io mp-units::si mp-units::utility)
|
||||
add_example(
|
||||
clcpp_response
|
||||
mp-units::core-fmt
|
||||
mp-units::core-io
|
||||
mp-units::si
|
||||
mp-units::iau
|
||||
mp-units::imperial
|
||||
mp-units::international
|
||||
mp-units::typographic
|
||||
mp-units::usc
|
||||
)
|
||||
add_example(conversion_factor mp-units::core-fmt mp-units::core-io mp-units::si)
|
||||
add_example(currency mp-units::core-io)
|
||||
add_example(foot_pound_second mp-units::core-fmt mp-units::international mp-units::imperial)
|
||||
add_example(glide_computer mp-units::core-fmt mp-units::international mp-units::utility)
|
||||
target_link_libraries(glide_computer PRIVATE glide_computer_lib)
|
||||
add_example(hello_units mp-units::core-fmt mp-units::core-io mp-units::si mp-units::usc)
|
||||
add_example(measurement mp-units::core-io mp-units::si)
|
||||
add_example(si_constants mp-units::core-fmt mp-units::si)
|
||||
add_example(spectroscopy_units mp-units::core-fmt mp-units::si)
|
||||
add_example(storage_tank mp-units::core-fmt mp-units::si mp-units::utility)
|
||||
add_example(
|
||||
strong_angular_quantities mp-units::core-fmt mp-units::core-io mp-units::si mp-units::isq_angle mp-units::utility
|
||||
)
|
||||
add_example(total_energy mp-units::core-io mp-units::si mp-units::natural mp-units::utility)
|
||||
add_example(
|
||||
unmanned_aerial_vehicle mp-units::core-fmt mp-units::core-io mp-units::si mp-units::international mp-units::utility
|
||||
)
|
||||
target_link_libraries(unmanned_aerial_vehicle PRIVATE example_utils)
|
||||
add_example(avg_speed)
|
||||
add_example(capacitor_time_curve)
|
||||
add_example(clcpp_response)
|
||||
add_example(conversion_factor)
|
||||
add_example(currency)
|
||||
add_example(foot_pound_second)
|
||||
add_example(glide_computer glide_computer_lib)
|
||||
add_example(hello_units)
|
||||
add_example(measurement)
|
||||
add_example(si_constants)
|
||||
add_example(spectroscopy_units)
|
||||
add_example(storage_tank)
|
||||
add_example(strong_angular_quantities)
|
||||
add_example(total_energy)
|
||||
add_example(unmanned_aerial_vehicle example_utils)
|
||||
|
||||
add_subdirectory(glide_computer_lib)
|
||||
add_subdirectory(kalman_filter)
|
||||
|
@ -15,7 +15,7 @@
|
||||
along with this program. If not, see http://www.gnu.org/licenses./
|
||||
*/
|
||||
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <iostream>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
|
@ -15,7 +15,7 @@
|
||||
along with this program. If not, see http://www.gnu.org/licenses./
|
||||
*/
|
||||
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <iostream>
|
||||
#include <type_traits>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
|
@ -20,7 +20,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <mp-units/quantity_spec_macro.h>
|
||||
#include <mp-units/compat_macros.h>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
|
@ -20,7 +20,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
|
@ -21,7 +21,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include "glide_computer_lib.h"
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <array>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
@ -32,10 +32,9 @@
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/math.h>
|
||||
#include <mp-units/systems/international/international.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
@ -22,11 +22,13 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
add_library(glide_computer_lib STATIC glide_computer_lib.cpp include/glide_computer_lib.h)
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(glide_computer_lib PUBLIC gsl::gsl-lite mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(glide_computer_lib PRIVATE mp-units::core-fmt PUBLIC mp-units::si mp-units::utility)
|
||||
add_library(glide_computer_lib-headers STATIC glide_computer_lib.cpp include/glide_computer_lib.h)
|
||||
target_link_libraries(glide_computer_lib-headers PUBLIC mp-units::mp-units example_utils)
|
||||
target_include_directories(glide_computer_lib-headers PUBLIC include)
|
||||
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
add_library(glide_computer_lib STATIC glide_computer_lib.cpp include/glide_computer_lib.h)
|
||||
target_compile_definitions(glide_computer_lib PUBLIC ${projectPrefix}MODULES)
|
||||
target_link_libraries(glide_computer_lib PUBLIC mp-units::mp-units example_utils)
|
||||
target_include_directories(glide_computer_lib PUBLIC include)
|
||||
endif()
|
||||
target_link_libraries(glide_computer_lib PUBLIC example_utils)
|
||||
target_include_directories(glide_computer_lib PUBLIC include)
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/quantity_spec_macro.h>
|
||||
#include <mp-units/compat_macros.h>
|
||||
//
|
||||
#include "geographic.h"
|
||||
#include <algorithm>
|
||||
@ -36,10 +36,10 @@
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/math.h> // IWYU pragma: keep
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/chrono.h>
|
||||
#endif
|
||||
|
||||
// An example of a really simplified tactical glide computer
|
||||
|
@ -25,7 +25,7 @@
|
||||
// !!! renders correctly in the documentation "Examples" section. !!!
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <iostream>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "ranged_representation.h"
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <compare>
|
||||
#include <limits>
|
||||
#include <numbers>
|
||||
@ -33,11 +33,10 @@ import mp_units;
|
||||
#else
|
||||
#include <mp-units/compare.h>
|
||||
#include <mp-units/format.h>
|
||||
#include <mp-units/math.h>
|
||||
#include <mp-units/quantity.h>
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#endif
|
||||
|
||||
namespace geographic {
|
||||
|
@ -23,7 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <gsl/gsl-lite.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <ostream>
|
||||
#include <utility>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
|
@ -22,23 +22,11 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
#
|
||||
# add_example(target <depependencies>...)
|
||||
#
|
||||
function(add_example target)
|
||||
add_executable(${target} ${target}.cpp)
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(${target} PRIVATE mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(${target} PRIVATE ${ARGN})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_example(kalman_filter-example_1 mp-units::core-fmt mp-units::si mp-units::utility)
|
||||
add_example(kalman_filter-example_2 mp-units::core-fmt mp-units::si mp-units::utility)
|
||||
add_example(kalman_filter-example_3 mp-units::core-fmt mp-units::si mp-units::utility)
|
||||
add_example(kalman_filter-example_4 mp-units::core-fmt mp-units::si mp-units::utility)
|
||||
add_example(kalman_filter-example_5 mp-units::core-fmt mp-units::si mp-units::utility)
|
||||
add_example(kalman_filter-example_6 mp-units::core-fmt mp-units::si mp-units::utility)
|
||||
add_example(kalman_filter-example_7 mp-units::core-fmt mp-units::si mp-units::utility)
|
||||
add_example(kalman_filter-example_8 mp-units::core-fmt mp-units::si mp-units::utility)
|
||||
add_example(kalman_filter-example_1)
|
||||
add_example(kalman_filter-example_2)
|
||||
add_example(kalman_filter-example_3)
|
||||
add_example(kalman_filter-example_4)
|
||||
add_example(kalman_filter-example_5)
|
||||
add_example(kalman_filter-example_6)
|
||||
add_example(kalman_filter-example_7)
|
||||
add_example(kalman_filter-example_8)
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <tuple>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
|
@ -25,7 +25,7 @@
|
||||
// !!! renders correctly in the documentation "Examples" section. !!!
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <iostream>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
|
@ -20,7 +20,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <iostream>
|
||||
#include <tuple>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
|
@ -20,8 +20,8 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/quantity_spec_macro.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <mp-units/compat_macros.h>
|
||||
#include <cassert>
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
@ -30,14 +30,11 @@
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/format.h>
|
||||
#include <mp-units/math.h>
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/constants.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#endif
|
||||
|
||||
// allows standard gravity (acceleration) and weight (force) to be expressed with scalar representation
|
||||
|
@ -21,7 +21,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include "geographic.h"
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
|
@ -36,84 +36,26 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
include(AddUnitsModule)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
set(${projectPrefix}TARGET_SCOPE "PUBLIC")
|
||||
else()
|
||||
set(${projectPrefix}TARGET_SCOPE "INTERFACE")
|
||||
endif()
|
||||
|
||||
if(${projectPrefix}AS_SYSTEM_HEADERS)
|
||||
set(unitsAsSystem SYSTEM)
|
||||
endif()
|
||||
|
||||
add_subdirectory(core-macros)
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(core-fmt-macros)
|
||||
add_subdirectory(core-fmt)
|
||||
add_subdirectory(core-io)
|
||||
add_subdirectory(systems)
|
||||
add_subdirectory(utility)
|
||||
|
||||
# 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 mp-units::utility
|
||||
add_units_module(
|
||||
mp-units DEPENDENCIES mp-units::core mp-units::core-io mp-units::core-fmt mp-units::systems
|
||||
MODULE_INTERFACE_UNIT mp-units.cpp
|
||||
)
|
||||
add_library(mp-units::mp-units ALIAS mp-units)
|
||||
install(TARGETS mp-units EXPORT mp-unitsTargets)
|
||||
|
||||
# C++ modules
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
add_library(mp-units-core-module)
|
||||
add_library(mp-units::core-module ALIAS mp-units-core-module)
|
||||
target_sources(
|
||||
mp-units-core-module PUBLIC FILE_SET CXX_MODULES BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES
|
||||
"mp-units-core.cpp"
|
||||
)
|
||||
target_compile_definitions(mp-units-core-module PUBLIC ${projectPrefix}MODULES)
|
||||
target_link_libraries(mp-units-core-module PRIVATE mp-units::core mp-units::utility PUBLIC mp-units::core-macros)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18)
|
||||
target_compile_definitions(mp-units-core-module PUBLIC _LIBCPP_NO_ABI_TAG)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
|
||||
target_compile_options(mp-units-core-module PUBLIC "-Wno-include-angled-in-module-purview")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(mp-units-core-fmt-module)
|
||||
add_library(mp-units::core-fmt-module ALIAS mp-units-core-fmt-module)
|
||||
target_sources(
|
||||
mp-units-core-fmt-module PUBLIC FILE_SET CXX_MODULES BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES
|
||||
"mp-units-core-fmt.cpp"
|
||||
)
|
||||
target_link_libraries(
|
||||
mp-units-core-fmt-module PRIVATE mp-units::core-fmt PUBLIC mp-units::core-fmt-macros mp-units::core-module
|
||||
)
|
||||
|
||||
add_library(mp-units-core-io-module)
|
||||
add_library(mp-units::core-io-module ALIAS mp-units-core-io-module)
|
||||
target_sources(
|
||||
mp-units-core-io-module PUBLIC FILE_SET CXX_MODULES BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES
|
||||
"mp-units-core-io.cpp"
|
||||
)
|
||||
target_link_libraries(mp-units-core-io-module PRIVATE mp-units::core-io PUBLIC mp-units::core-module)
|
||||
|
||||
add_library(mp-units-systems-module)
|
||||
add_library(mp-units::systems-module ALIAS mp-units-systems-module)
|
||||
target_sources(
|
||||
mp-units-systems-module PUBLIC FILE_SET CXX_MODULES BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES
|
||||
"mp-units-systems.cpp"
|
||||
)
|
||||
target_link_libraries(
|
||||
mp-units-systems-module PRIVATE mp-units::systems mp-units::utility PUBLIC mp-units::core-module
|
||||
)
|
||||
|
||||
add_library(mp-units-modules)
|
||||
add_library(mp-units::modules ALIAS mp-units-modules)
|
||||
target_sources(
|
||||
mp-units-modules PUBLIC FILE_SET CXX_MODULES BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES "mp-units.cpp"
|
||||
)
|
||||
target_link_libraries(
|
||||
mp-units-modules PUBLIC mp-units::core-module mp-units::core-fmt-module mp-units::core-io-module
|
||||
mp-units::systems-module
|
||||
)
|
||||
endif()
|
||||
|
||||
# local build
|
||||
export(EXPORT mp-unitsTargets NAMESPACE mp-units::)
|
||||
|
@ -43,27 +43,46 @@ endfunction()
|
||||
#
|
||||
# add_units_module(ModuleName
|
||||
# DEPENDENCIES <depependency>...
|
||||
# HEADERS <header_file>...)
|
||||
# [HEADERS <header_file>...]
|
||||
# MODULE_INTERFACE_UNIT <miu_file>)
|
||||
#
|
||||
function(add_units_module name)
|
||||
# parse arguments
|
||||
set(oneValue MODULE_INTERFACE_UNIT)
|
||||
set(multiValues DEPENDENCIES HEADERS)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 ARG "" "" "${multiValues}")
|
||||
cmake_parse_arguments(PARSE_ARGV 1 ARG "" "${oneValue}" "${multiValues}")
|
||||
|
||||
# validate and process arguments
|
||||
validate_unparsed(${name} ARG)
|
||||
validate_arguments_exists(${name} ARG DEPENDENCIES HEADERS)
|
||||
validate_arguments_exists(${name} ARG DEPENDENCIES MODULE_INTERFACE_UNIT)
|
||||
|
||||
if(${projectPrefix}TARGET_SCOPE STREQUAL INTERFACE)
|
||||
set(SCOPE "INTERFACE")
|
||||
endif()
|
||||
|
||||
# define the target for a module
|
||||
add_library(mp-units-${name} INTERFACE ${ARG_HEADERS})
|
||||
target_link_libraries(mp-units-${name} INTERFACE ${ARG_DEPENDENCIES})
|
||||
target_include_directories(
|
||||
mp-units-${name} ${unitsAsSystem} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
add_library(mp-units-${name} ${SCOPE} ${ARG_HEADERS})
|
||||
target_link_libraries(mp-units-${name} ${${projectPrefix}TARGET_SCOPE} ${ARG_DEPENDENCIES})
|
||||
if(ARG_HEADERS)
|
||||
target_include_directories(
|
||||
mp-units-${name} ${unitsAsSystem} ${${projectPrefix}TARGET_SCOPE}
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
|
||||
)
|
||||
endif()
|
||||
set_target_properties(mp-units-${name} PROPERTIES EXPORT_NAME ${name})
|
||||
add_library(mp-units::${name} ALIAS mp-units-${name})
|
||||
|
||||
install(TARGETS mp-units-${name} EXPORT mp-unitsTargets)
|
||||
install(DIRECTORY include/mp-units TYPE INCLUDE)
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
target_sources(mp-units-${name} PUBLIC FILE_SET CXX_MODULES FILES ${ARG_MODULE_INTERFACE_UNIT})
|
||||
install(TARGETS mp-units-${name}
|
||||
EXPORT mp-unitsTargets
|
||||
FILE_SET CXX_MODULES
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/miu
|
||||
)
|
||||
else()
|
||||
install(TARGETS mp-units-${name} EXPORT mp-unitsTargets)
|
||||
endif()
|
||||
if(ARG_HEADERS)
|
||||
install(DIRECTORY include/mp-units TYPE INCLUDE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
@ -1,45 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
# core-fmt-macros library definition
|
||||
add_library(mp-units-core-fmt-macros INTERFACE include/mp-units/bits/fmt_hacks.h)
|
||||
target_include_directories(
|
||||
mp-units-core-fmt-macros ${unitsAsSystem} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
target_link_libraries(mp-units-core-fmt-macros INTERFACE mp-units::core-macros)
|
||||
|
||||
if(${projectPrefix}USE_LIBFMT)
|
||||
if(NOT TARGET fmt::fmt)
|
||||
find_package(fmt CONFIG REQUIRED)
|
||||
endif()
|
||||
target_link_libraries(mp-units-core-fmt-macros INTERFACE fmt::fmt)
|
||||
endif()
|
||||
|
||||
set_target_properties(mp-units-core-fmt-macros PROPERTIES EXPORT_NAME core-fmt-macros)
|
||||
add_library(mp-units::core-fmt-macros ALIAS mp-units-core-fmt-macros)
|
||||
|
||||
# installation
|
||||
install(TARGETS mp-units-core-fmt-macros EXPORT mp-unitsTargets)
|
||||
install(DIRECTORY include/mp-units TYPE INCLUDE)
|
@ -25,13 +25,19 @@ 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/mp-units/format.h)
|
||||
target_compile_definitions(mp-units-core-fmt INTERFACE ${projectPrefix}USE_LIBFMT=$<BOOL:${${projectPrefix}USE_LIBFMT}>)
|
||||
target_link_libraries(mp-units-core-fmt INTERFACE mp-units::core-fmt-macros)
|
||||
add_units_module(
|
||||
core-fmt
|
||||
DEPENDENCIES mp-units::core
|
||||
HEADERS include/mp-units/bits/fmt.h include/mp-units/compat_fmt_macros.h include/mp-units/format.h
|
||||
MODULE_INTERFACE_UNIT mp-units-core-fmt.cpp
|
||||
)
|
||||
target_compile_definitions(
|
||||
mp-units-core-fmt ${${projectPrefix}TARGET_SCOPE} ${projectPrefix}USE_LIBFMT=$<BOOL:${${projectPrefix}USE_LIBFMT}>
|
||||
)
|
||||
|
||||
if(${projectPrefix}USE_LIBFMT)
|
||||
if(NOT TARGET fmt::fmt)
|
||||
find_package(fmt CONFIG REQUIRED)
|
||||
endif()
|
||||
target_link_libraries(mp-units-core-fmt INTERFACE fmt::fmt)
|
||||
target_link_libraries(mp-units-core-fmt ${${projectPrefix}TARGET_SCOPE} fmt::fmt)
|
||||
endif()
|
||||
|
@ -30,7 +30,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <gsl/gsl-lite.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <concepts>
|
||||
#include <limits>
|
||||
#include <string_view>
|
||||
|
@ -1,7 +1,7 @@
|
||||
module;
|
||||
|
||||
#include <mp-units/bits/core-gmf.h>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/bits/core_gmf.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
|
||||
export module mp_units.core_fmt;
|
||||
|
@ -22,4 +22,9 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(core-io DEPENDENCIES mp-units::core HEADERS include/mp-units/ostream.h)
|
||||
add_units_module(
|
||||
core-io
|
||||
DEPENDENCIES mp-units::core
|
||||
HEADERS include/mp-units/ostream.h
|
||||
MODULE_INTERFACE_UNIT mp-units-core-io.cpp
|
||||
)
|
||||
|
@ -1,6 +1,6 @@
|
||||
module;
|
||||
|
||||
#include <mp-units/bits/core-gmf.h>
|
||||
#include <mp-units/bits/core_gmf.h>
|
||||
#include <sstream>
|
||||
|
||||
export module mp_units.core_io;
|
@ -1,40 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
# core-macros library definition
|
||||
add_library(
|
||||
mp-units-core-macros INTERFACE include/mp-units/bits/external/hacks.h include/mp-units/quantity_spec_macro.h
|
||||
)
|
||||
target_compile_features(mp-units-core-macros INTERFACE cxx_std_20)
|
||||
target_include_directories(
|
||||
mp-units-core-macros ${unitsAsSystem} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
set_target_properties(mp-units-core-macros PROPERTIES EXPORT_NAME core-macros)
|
||||
add_library(mp-units::core-macros ALIAS mp-units-core-macros)
|
||||
|
||||
# installation
|
||||
install(TARGETS mp-units-core-macros EXPORT mp-unitsTargets)
|
||||
install(DIRECTORY include/mp-units TYPE INCLUDE)
|
@ -28,60 +28,67 @@ if(NOT TARGET gsl::gsl-lite)
|
||||
endif()
|
||||
|
||||
# core library definition
|
||||
add_library(
|
||||
mp-units-core
|
||||
INTERFACE
|
||||
include/mp-units/bits/external/algorithm.h
|
||||
include/mp-units/bits/external/fixed_string.h
|
||||
include/mp-units/bits/external/math_concepts.h
|
||||
include/mp-units/bits/external/prime.h
|
||||
include/mp-units/bits/external/type_list.h
|
||||
include/mp-units/bits/external/type_name.h
|
||||
include/mp-units/bits/external/type_traits.h
|
||||
include/mp-units/bits/dimension_concepts.h
|
||||
include/mp-units/bits/expression_template.h
|
||||
include/mp-units/bits/get_associated_quantity.h
|
||||
include/mp-units/bits/get_common_base.h
|
||||
include/mp-units/bits/magnitude.h
|
||||
include/mp-units/bits/quantity_cast.h
|
||||
include/mp-units/bits/quantity_concepts.h
|
||||
include/mp-units/bits/quantity_point_concepts.h
|
||||
include/mp-units/bits/quantity_spec_concepts.h
|
||||
include/mp-units/bits/ratio.h
|
||||
include/mp-units/bits/reference_concepts.h
|
||||
include/mp-units/bits/representation_concepts.h
|
||||
include/mp-units/bits/sudo_cast.h
|
||||
include/mp-units/bits/symbol_text.h
|
||||
include/mp-units/bits/text_tools.h
|
||||
include/mp-units/bits/unit_concepts.h
|
||||
include/mp-units/bits/value_cast.h
|
||||
include/mp-units/concepts.h
|
||||
include/mp-units/core.h
|
||||
include/mp-units/customization_points.h
|
||||
include/mp-units/dimension.h
|
||||
include/mp-units/quantity.h
|
||||
include/mp-units/quantity_point.h
|
||||
include/mp-units/quantity_spec.h
|
||||
include/mp-units/reference.h
|
||||
include/mp-units/system_reference.h
|
||||
include/mp-units/unit.h
|
||||
)
|
||||
target_link_libraries(mp-units-core INTERFACE gsl::gsl-lite mp-units::core-macros)
|
||||
target_include_directories(
|
||||
mp-units-core ${unitsAsSystem} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
add_units_module(
|
||||
core
|
||||
DEPENDENCIES gsl::gsl-lite
|
||||
HEADERS include/mp-units/bits/external/algorithm.h
|
||||
include/mp-units/bits/external/fixed_string.h
|
||||
include/mp-units/bits/external/hacks.h
|
||||
include/mp-units/bits/external/math_concepts.h
|
||||
include/mp-units/bits/external/prime.h
|
||||
include/mp-units/bits/external/type_list.h
|
||||
include/mp-units/bits/external/type_name.h
|
||||
include/mp-units/bits/external/type_traits.h
|
||||
include/mp-units/bits/core_gmf.h
|
||||
include/mp-units/bits/dimension_concepts.h
|
||||
include/mp-units/bits/expression_template.h
|
||||
include/mp-units/bits/get_associated_quantity.h
|
||||
include/mp-units/bits/get_common_base.h
|
||||
include/mp-units/bits/magnitude.h
|
||||
include/mp-units/bits/quantity_cast.h
|
||||
include/mp-units/bits/quantity_concepts.h
|
||||
include/mp-units/bits/quantity_point_concepts.h
|
||||
include/mp-units/bits/quantity_spec_concepts.h
|
||||
include/mp-units/bits/ratio.h
|
||||
include/mp-units/bits/reference_concepts.h
|
||||
include/mp-units/bits/representation_concepts.h
|
||||
include/mp-units/bits/sudo_cast.h
|
||||
include/mp-units/bits/symbol_text.h
|
||||
include/mp-units/bits/text_tools.h
|
||||
include/mp-units/bits/unit_concepts.h
|
||||
include/mp-units/bits/value_cast.h
|
||||
include/mp-units/compare.h
|
||||
include/mp-units/compat_macros.h
|
||||
include/mp-units/concepts.h
|
||||
include/mp-units/core.h
|
||||
include/mp-units/customization_points.h
|
||||
include/mp-units/dimension.h
|
||||
include/mp-units/math.h
|
||||
include/mp-units/quantity.h
|
||||
include/mp-units/quantity_point.h
|
||||
include/mp-units/quantity_spec.h
|
||||
include/mp-units/random.h
|
||||
include/mp-units/reference.h
|
||||
include/mp-units/system_reference.h
|
||||
include/mp-units/unit.h
|
||||
MODULE_INTERFACE_UNIT mp-units-core.cpp
|
||||
)
|
||||
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18)
|
||||
target_compile_definitions(mp-units-core PUBLIC _LIBCPP_NO_ABI_TAG)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18)
|
||||
target_compile_options(mp-units-core PUBLIC "-Wno-include-angled-in-module-purview")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(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
|
||||
mp-units-core ${${projectPrefix}TARGET_SCOPE}
|
||||
/utf-8 # Specifies both the source character set and the execution character set as UTF-8
|
||||
)
|
||||
endif()
|
||||
|
||||
set_target_properties(mp-units-core PROPERTIES EXPORT_NAME core)
|
||||
add_library(mp-units::core ALIAS mp-units-core)
|
||||
|
||||
# installation
|
||||
install(TARGETS mp-units-core EXPORT mp-unitsTargets)
|
||||
install(DIRECTORY include/mp-units TYPE INCLUDE)
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <gsl/gsl-lite.hpp>
|
||||
#include <mp-units/bits/external/hacks.h>
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <compare>
|
||||
#include <concepts>
|
||||
#include <cstddef>
|
||||
@ -37,6 +38,7 @@
|
||||
#include <numbers>
|
||||
#include <numeric>
|
||||
#include <optional>
|
||||
#include <random>
|
||||
#include <ranges>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
@ -44,7 +46,5 @@
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
// utility
|
||||
// si
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <random>
|
@ -22,8 +22,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <version>
|
||||
|
||||
#if __clang__
|
||||
#define MP_UNITS_COMP_CLANG __clang_major__
|
||||
#elif __GNUC__
|
||||
@ -70,9 +68,6 @@
|
||||
#define MP_UNITS_DIAGNOSTIC_IGNORE_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include <compare>
|
||||
#include <concepts>
|
||||
|
||||
#if MP_UNITS_COMP_MSVC
|
||||
|
||||
#define MP_UNITS_TYPENAME typename
|
||||
@ -83,7 +78,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if (defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 17) || (defined MP_UNITS_COMP_GCC && MP_UNITS_COMP_GCC < 12)
|
||||
#if (defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 17)
|
||||
|
||||
#define MP_UNITS_CONSTEVAL constexpr
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/bits/external/hacks.h>
|
||||
|
||||
#ifdef __cpp_explicit_this_parameter
|
||||
|
||||
#define QUANTITY_SPEC(name, ...) \
|
@ -22,13 +22,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/bits/math_core.h>
|
||||
#include <mp-units/compare.h>
|
||||
#include <mp-units/compat_macros.h>
|
||||
#include <mp-units/concepts.h>
|
||||
#include <mp-units/customization_points.h>
|
||||
#include <mp-units/dimension.h>
|
||||
#include <mp-units/math.h>
|
||||
#include <mp-units/quantity.h>
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <mp-units/quantity_spec.h>
|
||||
#include <mp-units/random.h>
|
||||
#include <mp-units/reference.h>
|
||||
#include <mp-units/system_reference.h>
|
||||
#include <mp-units/unit.h>
|
||||
|
@ -23,27 +23,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/bits/quantity_point_concepts.h>
|
||||
#include <mp-units/compare.h>
|
||||
#include <mp-units/customization_points.h>
|
||||
#include <mp-units/quantity.h>
|
||||
#include <compare>
|
||||
|
||||
namespace mp_units {
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<typename T>
|
||||
requires requires {
|
||||
{
|
||||
T::zero()
|
||||
} -> std::equality_comparable_with<T>;
|
||||
}
|
||||
[[nodiscard]] constexpr bool is_eq_zero(T v)
|
||||
{
|
||||
return v == T::zero();
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<typename Derived, QuantitySpec auto QS>
|
||||
struct absolute_point_origin {
|
||||
static constexpr QuantitySpec auto quantity_spec = QS;
|
||||
@ -95,11 +81,9 @@ template<PointOrigin PO1, PointOrigin PO2>
|
||||
else if constexpr (detail::RelativePointOrigin<PO1> && detail::RelativePointOrigin<PO2>)
|
||||
return PO1::quantity_point == PO2::quantity_point;
|
||||
else if constexpr (detail::RelativePointOrigin<PO1>)
|
||||
return detail::same_absolute_point_origins(po1, po2) &&
|
||||
detail::is_eq_zero(PO1::quantity_point.quantity_from_zero());
|
||||
return detail::same_absolute_point_origins(po1, po2) && is_eq_zero(PO1::quantity_point.quantity_from_zero());
|
||||
else if constexpr (detail::RelativePointOrigin<PO2>)
|
||||
return detail::same_absolute_point_origins(po1, po2) &&
|
||||
detail::is_eq_zero(PO2::quantity_point.quantity_from_zero());
|
||||
return detail::same_absolute_point_origins(po1, po2) && is_eq_zero(PO2::quantity_point.quantity_from_zero());
|
||||
}
|
||||
|
||||
template<Reference R>
|
||||
|
@ -31,8 +31,8 @@
|
||||
#include <mp-units/bits/quantity_spec_concepts.h>
|
||||
#include <mp-units/bits/reference_concepts.h>
|
||||
#include <mp-units/bits/representation_concepts.h>
|
||||
#include <mp-units/compat_macros.h>
|
||||
#include <mp-units/dimension.h>
|
||||
#include <mp-units/quantity_spec_macro.h>
|
||||
#include <tuple>
|
||||
|
||||
namespace mp_units {
|
||||
|
10
src/core/mp-units-core.cpp
Normal file
10
src/core/mp-units-core.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
module;
|
||||
|
||||
#include <mp-units/bits/core_gmf.h>
|
||||
|
||||
export module mp_units.core;
|
||||
|
||||
export
|
||||
{
|
||||
#include <mp-units/core.h>
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
module;
|
||||
|
||||
#include <mp-units/bits/core-gmf.h>
|
||||
|
||||
export module mp_units.core;
|
||||
|
||||
export
|
||||
{
|
||||
// core
|
||||
#include <mp-units/core.h>
|
||||
|
||||
// utility
|
||||
#include <mp-units/compare.h>
|
||||
#include <mp-units/random.h>
|
||||
}
|
@ -22,40 +22,39 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
# systems
|
||||
add_subdirectory(angular)
|
||||
add_subdirectory(iec80000)
|
||||
add_subdirectory(isq)
|
||||
add_subdirectory(isq_angle)
|
||||
add_subdirectory(natural)
|
||||
add_subdirectory(si)
|
||||
add_subdirectory(cgs)
|
||||
add_subdirectory(hep)
|
||||
add_subdirectory(iau)
|
||||
add_subdirectory(imperial)
|
||||
add_subdirectory(international)
|
||||
add_subdirectory(typographic)
|
||||
add_subdirectory(usc)
|
||||
|
||||
# wrapper for all the systems
|
||||
add_library(mp-units-systems INTERFACE)
|
||||
target_link_libraries(
|
||||
mp-units-systems
|
||||
INTERFACE
|
||||
mp-units::angular
|
||||
mp-units::iec80000
|
||||
mp-units::isq
|
||||
mp-units::isq_angle
|
||||
mp-units::natural
|
||||
mp-units::si
|
||||
mp-units::cgs
|
||||
mp-units::hep
|
||||
mp-units::iau
|
||||
mp-units::imperial
|
||||
mp-units::international
|
||||
mp-units::typographic
|
||||
mp-units::usc
|
||||
add_units_module(
|
||||
systems
|
||||
DEPENDENCIES mp-units::core
|
||||
HEADERS include/mp-units/systems/angular/angular.h
|
||||
include/mp-units/systems/angular/math.h
|
||||
include/mp-units/systems/angular/units.h
|
||||
include/mp-units/systems/cgs/cgs.h
|
||||
include/mp-units/systems/hep/hep.h
|
||||
include/mp-units/systems/iau/iau.h
|
||||
include/mp-units/systems/iec80000/binary_prefixes.h
|
||||
include/mp-units/systems/iec80000/iec80000.h
|
||||
include/mp-units/systems/iec80000/quantities.h
|
||||
include/mp-units/systems/iec80000/unit_symbols.h
|
||||
include/mp-units/systems/iec80000/units.h
|
||||
include/mp-units/systems/imperial/imperial.h
|
||||
include/mp-units/systems/international/international.h
|
||||
include/mp-units/systems/isq/atomic_and_nuclear_physics.h
|
||||
include/mp-units/systems/isq/base_quantities.h
|
||||
include/mp-units/systems/isq/electromagnetism.h
|
||||
include/mp-units/systems/isq/isq.h
|
||||
include/mp-units/systems/isq/mechanics.h
|
||||
include/mp-units/systems/isq/space_and_time.h
|
||||
include/mp-units/systems/isq/thermodynamics.h
|
||||
include/mp-units/systems/isq_angle/isq_angle.h
|
||||
include/mp-units/systems/natural/natural.h
|
||||
include/mp-units/systems/si/chrono.h
|
||||
include/mp-units/systems/si/constants.h
|
||||
include/mp-units/systems/si/math.h
|
||||
include/mp-units/systems/si/prefixes.h
|
||||
include/mp-units/systems/si/si.h
|
||||
include/mp-units/systems/si/unit_symbols.h
|
||||
include/mp-units/systems/si/units.h
|
||||
include/mp-units/systems/typographic/typographic.h
|
||||
include/mp-units/systems/usc/usc.h
|
||||
MODULE_INTERFACE_UNIT mp-units-systems.cpp
|
||||
)
|
||||
add_library(mp-units::systems ALIAS mp-units-systems)
|
||||
set_target_properties(mp-units-systems PROPERTIES EXPORT_NAME systems)
|
||||
install(TARGETS mp-units-systems EXPORT mp-unitsTargets)
|
||||
|
@ -1,25 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(angular DEPENDENCIES mp-units::isq HEADERS include/mp-units/systems/angular/angular.h)
|
@ -1,25 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(cgs DEPENDENCIES mp-units::si HEADERS include/mp-units/systems/cgs/cgs.h)
|
@ -1,25 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2021 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(hep DEPENDENCIES mp-units::si HEADERS include/mp-units/systems/hep/hep.h)
|
@ -1,25 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(iau DEPENDENCIES mp-units::si HEADERS include/mp-units/systems/iau/iau.h)
|
@ -1,31 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(
|
||||
iec80000
|
||||
DEPENDENCIES mp-units::isq mp-units::si
|
||||
HEADERS include/mp-units/systems/iec80000/binary_prefixes.h include/mp-units/systems/iec80000/quantities.h
|
||||
include/mp-units/systems/iec80000/iec80000.h include/mp-units/systems/iec80000/unit_symbols.h
|
||||
include/mp-units/systems/iec80000/units.h
|
||||
)
|
@ -1,27 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(
|
||||
imperial DEPENDENCIES mp-units::si mp-units::international HEADERS include/mp-units/systems/imperial/imperial.h
|
||||
)
|
@ -22,12 +22,5 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/bits/math_angular.h>
|
||||
#include <mp-units/bits/math_core.h>
|
||||
#include <mp-units/bits/math_si.h>
|
||||
|
||||
// This header is intentionally empty and just include other headers
|
||||
// `math.h` is just a convenience wrapper for not modular code
|
||||
// With C++20 modules:
|
||||
// - math_core is a part of the mp_units.core module
|
||||
// - math_si and math_angular is provided with the mp_units.systems module
|
||||
#include <mp-units/systems/angular/math.h>
|
||||
#include <mp-units/systems/angular/units.h>
|
@ -26,7 +26,7 @@
|
||||
#include <mp-units/bits/value_cast.h>
|
||||
#include <mp-units/customization_points.h>
|
||||
#include <mp-units/quantity.h>
|
||||
#include <mp-units/systems/angular/angular.h>
|
||||
#include <mp-units/systems/angular/units.h>
|
||||
#include <mp-units/unit.h>
|
||||
|
||||
// IWYU pragma: begin_exports
|
@ -22,7 +22,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mp-units/systems/si/chrono.h>
|
||||
#include <mp-units/systems/si/constants.h>
|
||||
#include <mp-units/systems/si/math.h>
|
||||
#include <mp-units/systems/si/prefixes.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/units.h>
|
@ -1,25 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(international DEPENDENCIES mp-units::si HEADERS include/mp-units/systems/international/international.h)
|
@ -1,35 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(
|
||||
isq
|
||||
DEPENDENCIES mp-units::core
|
||||
HEADERS include/mp-units/systems/isq/atomic_and_nuclear_physics.h
|
||||
include/mp-units/systems/isq/base_quantities.h
|
||||
include/mp-units/systems/isq/electromagnetism.h
|
||||
include/mp-units/systems/isq/isq.h
|
||||
include/mp-units/systems/isq/mechanics.h
|
||||
include/mp-units/systems/isq/space_and_time.h
|
||||
include/mp-units/systems/isq/thermodynamics.h
|
||||
)
|
@ -1,27 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(
|
||||
isq_angle DEPENDENCIES mp-units::angular mp-units::isq HEADERS include/mp-units/systems/isq_angle/isq_angle.h
|
||||
)
|
@ -1,7 +1,7 @@
|
||||
module;
|
||||
|
||||
#include <mp-units/bits/core-gmf.h>
|
||||
#include <mp-units/quantity_spec_macro.h>
|
||||
#include <mp-units/bits/core_gmf.h>
|
||||
#include <mp-units/compat_macros.h>
|
||||
|
||||
export module mp_units.systems;
|
||||
|
||||
@ -9,7 +9,6 @@ export import mp_units.core;
|
||||
|
||||
export
|
||||
{
|
||||
// systems
|
||||
#include <mp-units/systems/angular/angular.h>
|
||||
#include <mp-units/systems/cgs/cgs.h>
|
||||
#include <mp-units/systems/hep/hep.h>
|
||||
@ -23,8 +22,4 @@ export
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#include <mp-units/systems/typographic/typographic.h>
|
||||
#include <mp-units/systems/usc/usc.h>
|
||||
|
||||
// utility
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/math.h>
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(natural DEPENDENCIES mp-units::isq HEADERS include/mp-units/systems/natural/natural.h)
|
@ -1,31 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(
|
||||
si
|
||||
DEPENDENCIES mp-units::isq
|
||||
HEADERS include/mp-units/systems/si/constants.h include/mp-units/systems/si/prefixes.h
|
||||
include/mp-units/systems/si/si.h include/mp-units/systems/si/unit_symbols.h
|
||||
include/mp-units/systems/si/units.h
|
||||
)
|
@ -1,25 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(typographic DEPENDENCIES mp-units::usc HEADERS include/mp-units/systems/typographic/typographic.h)
|
@ -1,25 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(usc DEPENDENCIES mp-units::si mp-units::international HEADERS include/mp-units/systems/usc/usc.h)
|
@ -1,29 +0,0 @@
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2018 Mateusz Pusz
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
add_units_module(
|
||||
utility DEPENDENCIES mp-units::core mp-units::isq mp-units::si mp-units::angular
|
||||
HEADERS include/mp-units/bits/math_angular.h include/mp-units/bits/math_core.h include/mp-units/bits/math_si.h
|
||||
include/mp-units/chrono.h include/mp-units/math.h include/mp-units/random.h
|
||||
)
|
@ -22,7 +22,5 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
add_subdirectory(unit_test/runtime)
|
||||
add_subdirectory(unit_test/static)
|
||||
|
||||
# add_subdirectory(metabench)
|
||||
add_subdirectory(runtime)
|
||||
add_subdirectory(static)
|
||||
|
@ -25,12 +25,10 @@ cmake_minimum_required(VERSION 3.5)
|
||||
find_package(Catch2 3 CONFIG REQUIRED)
|
||||
|
||||
add_executable(unit_tests_runtime distribution_test.cpp fmt_test.cpp math_test.cpp)
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::mp-units)
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
target_compile_definitions(unit_tests_runtime PUBLIC ${projectPrefix}MODULES)
|
||||
endif()
|
||||
target_link_libraries(unit_tests_runtime PRIVATE Catch2::Catch2WithMain)
|
||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::mp-units Catch2::Catch2WithMain)
|
||||
|
||||
if(${projectPrefix}BUILD_LA)
|
||||
find_package(wg21_linear_algebra CONFIG REQUIRED)
|
@ -21,7 +21,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include <catch2/matchers/catch_matchers_templated.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <algorithm>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/matchers/catch_matchers_exception.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <locale>
|
@ -21,7 +21,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <cmath>
|
||||
#include <matrix>
|
||||
#ifdef MP_UNITS_MODULES
|
@ -30,8 +30,7 @@ import mp_units;
|
||||
#include <mp-units/ostream.h>
|
||||
#include <mp-units/systems/angular/angular.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#endif
|
||||
|
||||
using namespace mp_units;
|
@ -23,11 +23,10 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
add_library(unit_tests_static_truncating quantity_test.cpp)
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(unit_tests_static_truncating PRIVATE mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(unit_tests_static_truncating PRIVATE mp-units::mp-units)
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
target_compile_definitions(unit_tests_static_truncating PUBLIC ${projectPrefix}MODULES)
|
||||
endif()
|
||||
target_link_libraries(unit_tests_static_truncating PRIVATE mp-units::mp-units)
|
||||
target_compile_options(
|
||||
unit_tests_static_truncating PRIVATE $<IF:$<CXX_COMPILER_ID:MSVC>,/wd4242 /wd4244,-Wno-conversion>
|
||||
)
|
||||
@ -68,9 +67,8 @@ add_library(
|
||||
usc_test.cpp
|
||||
)
|
||||
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(unit_tests_static PRIVATE mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(unit_tests_static PRIVATE mp-units::mp-units)
|
||||
target_link_libraries(unit_tests_static PRIVATE mp-units::mp-units)
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
target_compile_definitions(unit_tests_static PUBLIC ${projectPrefix}MODULES)
|
||||
endif()
|
||||
target_link_libraries(unit_tests_static PRIVATE unit_tests_static_truncating)
|
@ -27,9 +27,8 @@
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/bits/external/type_traits.h>
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#endif
|
||||
|
||||
namespace {
|
@ -27,7 +27,6 @@
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/concepts.h>
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user