From b1b746cfd673bed2fcb66a6b4a097f5e2151844e Mon Sep 17 00:00:00 2001 From: "Riff, Eric" Date: Mon, 30 Sep 2024 20:29:49 -0300 Subject: [PATCH] rework folder structure and cmake files --- CMakeLists.txt | 67 +-- au/CMakeLists.txt | 15 - au/code/CMakeLists.txt | 15 - au/code/au/CMakeLists.txt | 507 ------------------ cmake/AuConfig.cmake.in | 9 +- cmake/HeaderOnlyLibrary.cmake | 90 ---- {au => include}/BUILD.bazel | 0 {au/code => include}/au/apply_magnitude.hh | 0 .../apply_rational_magnitude_to_integral.hh | 0 {au/code => include}/au/au.hh | 0 {au/code => include}/au/chrono_interop.hh | 0 .../au/chrono_policy_validation.hh | 0 {au/code => include}/au/constant.hh | 0 {au/code => include}/au/conversion_policy.hh | 0 {au/code => include}/au/dimension.hh | 0 {au/code => include}/au/io.hh | 0 {au/code => include}/au/magnitude.hh | 0 {au/code => include}/au/math.hh | 0 {au/code => include}/au/operators.hh | 0 {au/code => include}/au/packs.hh | 0 {au/code => include}/au/power_aliases.hh | 0 {au/code => include}/au/prefix.hh | 0 {au/code => include}/au/quantity.hh | 0 {au/code => include}/au/quantity_point.hh | 0 {au/code => include}/au/rep.hh | 0 .../au/stdx/experimental/is_detected.hh | 0 {au/code => include}/au/stdx/functional.hh | 0 {au/code => include}/au/stdx/type_traits.hh | 0 {au/code => include}/au/stdx/utility.hh | 0 {au/code => include}/au/testing.hh | 0 {au/code => include}/au/unit_of_measure.hh | 0 {au/code => include}/au/unit_symbol.hh | 0 {au/code => include}/au/units/amperes.hh | 0 {au/code => include}/au/units/bars.hh | 0 {au/code => include}/au/units/becquerel.hh | 0 {au/code => include}/au/units/bits.hh | 0 {au/code => include}/au/units/bytes.hh | 0 {au/code => include}/au/units/candelas.hh | 0 {au/code => include}/au/units/celsius.hh | 0 {au/code => include}/au/units/coulombs.hh | 0 {au/code => include}/au/units/days.hh | 0 {au/code => include}/au/units/degrees.hh | 0 {au/code => include}/au/units/fahrenheit.hh | 0 {au/code => include}/au/units/farads.hh | 0 {au/code => include}/au/units/fathoms.hh | 0 {au/code => include}/au/units/feet.hh | 0 {au/code => include}/au/units/furlongs.hh | 0 {au/code => include}/au/units/grams.hh | 0 {au/code => include}/au/units/grays.hh | 0 {au/code => include}/au/units/henries.hh | 0 {au/code => include}/au/units/hertz.hh | 0 {au/code => include}/au/units/hours.hh | 0 {au/code => include}/au/units/inches.hh | 0 {au/code => include}/au/units/joules.hh | 0 {au/code => include}/au/units/katals.hh | 0 {au/code => include}/au/units/kelvins.hh | 0 {au/code => include}/au/units/knots.hh | 0 {au/code => include}/au/units/liters.hh | 0 {au/code => include}/au/units/lumens.hh | 0 {au/code => include}/au/units/lux.hh | 0 {au/code => include}/au/units/meters.hh | 0 {au/code => include}/au/units/miles.hh | 0 {au/code => include}/au/units/minutes.hh | 0 {au/code => include}/au/units/moles.hh | 0 .../au/units/nautical_miles.hh | 0 {au/code => include}/au/units/newtons.hh | 0 {au/code => include}/au/units/ohms.hh | 0 {au/code => include}/au/units/pascals.hh | 0 {au/code => include}/au/units/percent.hh | 0 {au/code => include}/au/units/pounds_force.hh | 0 {au/code => include}/au/units/pounds_mass.hh | 0 {au/code => include}/au/units/radians.hh | 0 {au/code => include}/au/units/revolutions.hh | 0 {au/code => include}/au/units/seconds.hh | 0 {au/code => include}/au/units/siemens.hh | 0 {au/code => include}/au/units/slugs.hh | 0 .../au/units/standard_gravity.hh | 0 {au/code => include}/au/units/steradians.hh | 0 {au/code => include}/au/units/tesla.hh | 0 {au/code => include}/au/units/unos.hh | 0 {au/code => include}/au/units/volts.hh | 0 {au/code => include}/au/units/watts.hh | 0 {au/code => include}/au/units/webers.hh | 0 {au/code => include}/au/units/yards.hh | 0 {au/code => include}/au/utility/factoring.hh | 0 .../au/utility/string_constant.hh | 0 .../au/utility/type_traits.hh | 0 {au/code => include}/au/wrapper_operations.hh | 0 {au/code => include}/au/zero.hh | 0 {au => include}/error_examples.cc | 0 tests/CMakeLists.txt | 30 ++ .../au/units/test => tests}/amperes_test.cc | 0 {au/code/au => tests}/apply_magnitude_test.cc | 0 ...ply_rational_magnitude_to_integral_test.cc | 0 {au/code/au => tests}/au_test.cc | 0 {au/code/au/units/test => tests}/bars_test.cc | 0 .../au/units/test => tests}/becquerel_test.cc | 0 {au/code/au/units/test => tests}/bits_test.cc | 0 .../au/units/test => tests}/bytes_test.cc | 0 .../au/units/test => tests}/candelas_test.cc | 0 .../au/units/test => tests}/celsius_test.cc | 0 {au/code/au => tests}/chrono_interop_test.cc | 0 .../chrono_policy_validation_test.cc | 0 {au/code/au => tests}/constant_test.cc | 0 .../au => tests}/conversion_policy_test.cc | 0 .../au/units/test => tests}/coulombs_test.cc | 0 {au/code/au/units/test => tests}/days_test.cc | 0 .../au/units/test => tests}/degrees_test.cc | 0 {au/code/au => tests}/dimension_test.cc | 0 .../utility/test => tests}/factoring_test.cc | 0 .../units/test => tests}/fahrenheit_test.cc | 0 .../au/units/test => tests}/farads_test.cc | 0 .../au/units/test => tests}/fathoms_test.cc | 0 {au/code/au/units/test => tests}/feet_test.cc | 0 .../au/units/test => tests}/furlongs_test.cc | 0 .../au/units/test => tests}/grams_test.cc | 0 .../au/units/test => tests}/grays_test.cc | 0 .../au/units/test => tests}/henries_test.cc | 0 .../au/units/test => tests}/hertz_test.cc | 0 .../au/units/test => tests}/hours_test.cc | 0 .../au/units/test => tests}/inches_test.cc | 0 {au/code/au => tests}/io_test.cc | 0 .../au/units/test => tests}/joules_test.cc | 0 .../au/units/test => tests}/katals_test.cc | 0 .../au/units/test => tests}/kelvins_test.cc | 0 .../au/units/test => tests}/knots_test.cc | 0 .../au/units/test => tests}/liters_test.cc | 0 .../au/units/test => tests}/lumens_test.cc | 0 {au/code/au/units/test => tests}/lux_test.cc | 0 {au/code/au => tests}/magnitude_test.cc | 0 {au/code/au => tests}/math_test.cc | 0 .../au/units/test => tests}/meters_test.cc | 0 .../au/units/test => tests}/miles_test.cc | 0 .../au/units/test => tests}/minutes_test.cc | 0 .../au/units/test => tests}/moles_test.cc | 0 .../test => tests}/nautical_miles_test.cc | 0 .../au/units/test => tests}/newtons_test.cc | 0 {au/code/au => tests}/no_wconversion_test.cc | 0 {au/code/au/units/test => tests}/ohms_test.cc | 0 {au/code/au => tests}/operators_test.cc | 0 {au/code/au => tests}/packs_test.cc | 0 .../au/units/test => tests}/pascals_test.cc | 0 .../au/units/test => tests}/percent_test.cc | 0 .../units/test => tests}/pounds_force_test.cc | 0 .../units/test => tests}/pounds_mass_test.cc | 0 {au/code/au => tests}/power_aliases_test.cc | 0 {au/code/au => tests}/prefix_test.cc | 0 ...ntity_chrono_policy_correspondence_test.cc | 0 {au/code/au => tests}/quantity_point_test.cc | 0 {au/code/au => tests}/quantity_test.cc | 0 .../au/units/test => tests}/radians_test.cc | 0 {au/code/au => tests}/rep_test.cc | 0 .../units/test => tests}/revolutions_test.cc | 0 .../au/units/test => tests}/seconds_test.cc | 0 .../au/units/test => tests}/siemens_test.cc | 0 .../au/units/test => tests}/slugs_test.cc | 0 .../test => tests}/standard_gravity_test.cc | 0 .../units/test => tests}/steradians_test.cc | 0 .../test => tests}/string_constant_test.cc | 0 .../au/units/test => tests}/tesla_test.cc | 0 {au/code/au => tests}/testing_test.cc | 0 .../test => tests}/type_traits_test.cc | 0 {au/code/au => tests}/unit_of_measure_test.cc | 0 {au/code/au => tests}/unit_symbol_test.cc | 0 {au/code/au/units/test => tests}/unos_test.cc | 0 .../au/stdx/test => tests}/utility_test.cc | 0 .../au/units/test => tests}/volts_test.cc | 0 .../au/units/test => tests}/watts_test.cc | 0 .../au/units/test => tests}/webers_test.cc | 0 .../au => tests}/wrapper_operations_test.cc | 0 .../au/units/test => tests}/yards_test.cc | 0 {au/code/au => tests}/zero_test.cc | 0 172 files changed, 59 insertions(+), 674 deletions(-) delete mode 100644 au/CMakeLists.txt delete mode 100644 au/code/CMakeLists.txt delete mode 100644 au/code/au/CMakeLists.txt delete mode 100644 cmake/HeaderOnlyLibrary.cmake rename {au => include}/BUILD.bazel (100%) rename {au/code => include}/au/apply_magnitude.hh (100%) rename {au/code => include}/au/apply_rational_magnitude_to_integral.hh (100%) rename {au/code => include}/au/au.hh (100%) rename {au/code => include}/au/chrono_interop.hh (100%) rename {au/code => include}/au/chrono_policy_validation.hh (100%) rename {au/code => include}/au/constant.hh (100%) rename {au/code => include}/au/conversion_policy.hh (100%) rename {au/code => include}/au/dimension.hh (100%) rename {au/code => include}/au/io.hh (100%) rename {au/code => include}/au/magnitude.hh (100%) rename {au/code => include}/au/math.hh (100%) rename {au/code => include}/au/operators.hh (100%) rename {au/code => include}/au/packs.hh (100%) rename {au/code => include}/au/power_aliases.hh (100%) rename {au/code => include}/au/prefix.hh (100%) rename {au/code => include}/au/quantity.hh (100%) rename {au/code => include}/au/quantity_point.hh (100%) rename {au/code => include}/au/rep.hh (100%) rename {au/code => include}/au/stdx/experimental/is_detected.hh (100%) rename {au/code => include}/au/stdx/functional.hh (100%) rename {au/code => include}/au/stdx/type_traits.hh (100%) rename {au/code => include}/au/stdx/utility.hh (100%) rename {au/code => include}/au/testing.hh (100%) rename {au/code => include}/au/unit_of_measure.hh (100%) rename {au/code => include}/au/unit_symbol.hh (100%) rename {au/code => include}/au/units/amperes.hh (100%) rename {au/code => include}/au/units/bars.hh (100%) rename {au/code => include}/au/units/becquerel.hh (100%) rename {au/code => include}/au/units/bits.hh (100%) rename {au/code => include}/au/units/bytes.hh (100%) rename {au/code => include}/au/units/candelas.hh (100%) rename {au/code => include}/au/units/celsius.hh (100%) rename {au/code => include}/au/units/coulombs.hh (100%) rename {au/code => include}/au/units/days.hh (100%) rename {au/code => include}/au/units/degrees.hh (100%) rename {au/code => include}/au/units/fahrenheit.hh (100%) rename {au/code => include}/au/units/farads.hh (100%) rename {au/code => include}/au/units/fathoms.hh (100%) rename {au/code => include}/au/units/feet.hh (100%) rename {au/code => include}/au/units/furlongs.hh (100%) rename {au/code => include}/au/units/grams.hh (100%) rename {au/code => include}/au/units/grays.hh (100%) rename {au/code => include}/au/units/henries.hh (100%) rename {au/code => include}/au/units/hertz.hh (100%) rename {au/code => include}/au/units/hours.hh (100%) rename {au/code => include}/au/units/inches.hh (100%) rename {au/code => include}/au/units/joules.hh (100%) rename {au/code => include}/au/units/katals.hh (100%) rename {au/code => include}/au/units/kelvins.hh (100%) rename {au/code => include}/au/units/knots.hh (100%) rename {au/code => include}/au/units/liters.hh (100%) rename {au/code => include}/au/units/lumens.hh (100%) rename {au/code => include}/au/units/lux.hh (100%) rename {au/code => include}/au/units/meters.hh (100%) rename {au/code => include}/au/units/miles.hh (100%) rename {au/code => include}/au/units/minutes.hh (100%) rename {au/code => include}/au/units/moles.hh (100%) rename {au/code => include}/au/units/nautical_miles.hh (100%) rename {au/code => include}/au/units/newtons.hh (100%) rename {au/code => include}/au/units/ohms.hh (100%) rename {au/code => include}/au/units/pascals.hh (100%) rename {au/code => include}/au/units/percent.hh (100%) rename {au/code => include}/au/units/pounds_force.hh (100%) rename {au/code => include}/au/units/pounds_mass.hh (100%) rename {au/code => include}/au/units/radians.hh (100%) rename {au/code => include}/au/units/revolutions.hh (100%) rename {au/code => include}/au/units/seconds.hh (100%) rename {au/code => include}/au/units/siemens.hh (100%) rename {au/code => include}/au/units/slugs.hh (100%) rename {au/code => include}/au/units/standard_gravity.hh (100%) rename {au/code => include}/au/units/steradians.hh (100%) rename {au/code => include}/au/units/tesla.hh (100%) rename {au/code => include}/au/units/unos.hh (100%) rename {au/code => include}/au/units/volts.hh (100%) rename {au/code => include}/au/units/watts.hh (100%) rename {au/code => include}/au/units/webers.hh (100%) rename {au/code => include}/au/units/yards.hh (100%) rename {au/code => include}/au/utility/factoring.hh (100%) rename {au/code => include}/au/utility/string_constant.hh (100%) rename {au/code => include}/au/utility/type_traits.hh (100%) rename {au/code => include}/au/wrapper_operations.hh (100%) rename {au/code => include}/au/zero.hh (100%) rename {au => include}/error_examples.cc (100%) create mode 100644 tests/CMakeLists.txt rename {au/code/au/units/test => tests}/amperes_test.cc (100%) rename {au/code/au => tests}/apply_magnitude_test.cc (100%) rename {au/code/au => tests}/apply_rational_magnitude_to_integral_test.cc (100%) rename {au/code/au => tests}/au_test.cc (100%) rename {au/code/au/units/test => tests}/bars_test.cc (100%) rename {au/code/au/units/test => tests}/becquerel_test.cc (100%) rename {au/code/au/units/test => tests}/bits_test.cc (100%) rename {au/code/au/units/test => tests}/bytes_test.cc (100%) rename {au/code/au/units/test => tests}/candelas_test.cc (100%) rename {au/code/au/units/test => tests}/celsius_test.cc (100%) rename {au/code/au => tests}/chrono_interop_test.cc (100%) rename {au/code/au => tests}/chrono_policy_validation_test.cc (100%) rename {au/code/au => tests}/constant_test.cc (100%) rename {au/code/au => tests}/conversion_policy_test.cc (100%) rename {au/code/au/units/test => tests}/coulombs_test.cc (100%) rename {au/code/au/units/test => tests}/days_test.cc (100%) rename {au/code/au/units/test => tests}/degrees_test.cc (100%) rename {au/code/au => tests}/dimension_test.cc (100%) rename {au/code/au/utility/test => tests}/factoring_test.cc (100%) rename {au/code/au/units/test => tests}/fahrenheit_test.cc (100%) rename {au/code/au/units/test => tests}/farads_test.cc (100%) rename {au/code/au/units/test => tests}/fathoms_test.cc (100%) rename {au/code/au/units/test => tests}/feet_test.cc (100%) rename {au/code/au/units/test => tests}/furlongs_test.cc (100%) rename {au/code/au/units/test => tests}/grams_test.cc (100%) rename {au/code/au/units/test => tests}/grays_test.cc (100%) rename {au/code/au/units/test => tests}/henries_test.cc (100%) rename {au/code/au/units/test => tests}/hertz_test.cc (100%) rename {au/code/au/units/test => tests}/hours_test.cc (100%) rename {au/code/au/units/test => tests}/inches_test.cc (100%) rename {au/code/au => tests}/io_test.cc (100%) rename {au/code/au/units/test => tests}/joules_test.cc (100%) rename {au/code/au/units/test => tests}/katals_test.cc (100%) rename {au/code/au/units/test => tests}/kelvins_test.cc (100%) rename {au/code/au/units/test => tests}/knots_test.cc (100%) rename {au/code/au/units/test => tests}/liters_test.cc (100%) rename {au/code/au/units/test => tests}/lumens_test.cc (100%) rename {au/code/au/units/test => tests}/lux_test.cc (100%) rename {au/code/au => tests}/magnitude_test.cc (100%) rename {au/code/au => tests}/math_test.cc (100%) rename {au/code/au/units/test => tests}/meters_test.cc (100%) rename {au/code/au/units/test => tests}/miles_test.cc (100%) rename {au/code/au/units/test => tests}/minutes_test.cc (100%) rename {au/code/au/units/test => tests}/moles_test.cc (100%) rename {au/code/au/units/test => tests}/nautical_miles_test.cc (100%) rename {au/code/au/units/test => tests}/newtons_test.cc (100%) rename {au/code/au => tests}/no_wconversion_test.cc (100%) rename {au/code/au/units/test => tests}/ohms_test.cc (100%) rename {au/code/au => tests}/operators_test.cc (100%) rename {au/code/au => tests}/packs_test.cc (100%) rename {au/code/au/units/test => tests}/pascals_test.cc (100%) rename {au/code/au/units/test => tests}/percent_test.cc (100%) rename {au/code/au/units/test => tests}/pounds_force_test.cc (100%) rename {au/code/au/units/test => tests}/pounds_mass_test.cc (100%) rename {au/code/au => tests}/power_aliases_test.cc (100%) rename {au/code/au => tests}/prefix_test.cc (100%) rename {au/code/au => tests}/quantity_chrono_policy_correspondence_test.cc (100%) rename {au/code/au => tests}/quantity_point_test.cc (100%) rename {au/code/au => tests}/quantity_test.cc (100%) rename {au/code/au/units/test => tests}/radians_test.cc (100%) rename {au/code/au => tests}/rep_test.cc (100%) rename {au/code/au/units/test => tests}/revolutions_test.cc (100%) rename {au/code/au/units/test => tests}/seconds_test.cc (100%) rename {au/code/au/units/test => tests}/siemens_test.cc (100%) rename {au/code/au/units/test => tests}/slugs_test.cc (100%) rename {au/code/au/units/test => tests}/standard_gravity_test.cc (100%) rename {au/code/au/units/test => tests}/steradians_test.cc (100%) rename {au/code/au/utility/test => tests}/string_constant_test.cc (100%) rename {au/code/au/units/test => tests}/tesla_test.cc (100%) rename {au/code/au => tests}/testing_test.cc (100%) rename {au/code/au/utility/test => tests}/type_traits_test.cc (100%) rename {au/code/au => tests}/unit_of_measure_test.cc (100%) rename {au/code/au => tests}/unit_symbol_test.cc (100%) rename {au/code/au/units/test => tests}/unos_test.cc (100%) rename {au/code/au/stdx/test => tests}/utility_test.cc (100%) rename {au/code/au/units/test => tests}/volts_test.cc (100%) rename {au/code/au/units/test => tests}/watts_test.cc (100%) rename {au/code/au/units/test => tests}/webers_test.cc (100%) rename {au/code/au => tests}/wrapper_operations_test.cc (100%) rename {au/code/au/units/test => tests}/yards_test.cc (100%) rename {au/code/au => tests}/zero_test.cc (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b18407ff..5551c1d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,59 +32,48 @@ project( LANGUAGES CXX ) -# The export set for all of our headers. -set(AU_EXPORT_SET_NAME AuHeaders) +option(AU_BUILD_TESTS "Build Tests" ON) +option(AU_USE_VENDORED_GTEST "Build GTest from sources" ON) -enable_testing() +add_library(au INTERFACE) +add_library(Au::au ALIAS au) -# Bring in GoogleTest so we can build and run the tests. -include(FetchContent) -FetchContent_Declare( - googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # Release 1.12.1 - FIND_PACKAGE_ARGS - 1.12.1 - NAMES GTest +target_include_directories(au INTERFACE + $ + $ ) -# https://google.github.io/googletest/quickstart-cmake.html -# For Windows: Prevent overriding the parent project's compiler/linker settings -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +if(AU_BUILD_TESTS) + enable_testing() + add_subdirectory(tests) +endif() -FetchContent_MakeAvailable(googletest) -include(GoogleTest) +include( GNUInstallDirs ) +include( CMakePackageConfigHelpers ) -add_subdirectory(au) - -# Configure how Au will be installed. -# -# (This is necessary for it to be usable in other CMake projects.) +install( + DIRECTORY include/ + DESTINATION include +) -set(AU_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/Au) +install( + TARGETS au + EXPORT AuTargets +) install( - EXPORT ${AU_EXPORT_SET_NAME} - DESTINATION ${AU_CMAKE_DIR} + EXPORT AuTargets NAMESPACE Au:: - FILE AuHeaders.cmake + DESTINATION lib/cmake/Au ) -include(CMakePackageConfigHelpers) -configure_package_config_file( - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/AuConfig.cmake.in +configure_file( + cmake/AuConfig.cmake.in AuConfig.cmake - INSTALL_DESTINATION ${AU_CMAKE_DIR} -) - -write_basic_package_version_file( - AuConfigVersion.cmake - COMPATIBILITY SameMinorVersion + COPYONLY ) install( - FILES - ${CMAKE_CURRENT_BINARY_DIR}/AuConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/AuConfigVersion.cmake - DESTINATION ${AU_CMAKE_DIR} + FILES ${CMAKE_BINARY_DIR}/AuConfig.cmake + DESTINATION lib/cmake/Au ) diff --git a/au/CMakeLists.txt b/au/CMakeLists.txt deleted file mode 100644 index a3656289..00000000 --- a/au/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2024 Aurora Operations, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -add_subdirectory(code) diff --git a/au/code/CMakeLists.txt b/au/code/CMakeLists.txt deleted file mode 100644 index 1def64aa..00000000 --- a/au/code/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2024 Aurora Operations, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -add_subdirectory(au) diff --git a/au/code/au/CMakeLists.txt b/au/code/au/CMakeLists.txt deleted file mode 100644 index 3973077a..00000000 --- a/au/code/au/CMakeLists.txt +++ /dev/null @@ -1,507 +0,0 @@ -# Copyright 2024 Aurora Operations, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -include("${PROJECT_SOURCE_DIR}/cmake/HeaderOnlyLibrary.cmake") - -# -# Publicly exported targets -# - -header_only_library( - NAME au - HEADERS - au.hh - DEPS - chrono_interop - constant - math - GTEST_SRCS - au_test.cc - GTEST_EXTRA_DEPS - testing -) - -header_only_library( - NAME chrono_interop - HEADERS - chrono_interop.hh - DEPS - prefix - quantity - units - GTEST_SRCS - chrono_interop_test.cc - GTEST_EXTRA_DEPS - prefix - testing -) - -header_only_library( - NAME constant - HEADERS - constant.hh - DEPS - quantity - unit_of_measure - wrapper_operations - GTEST_SRCS - constant_test.cc - GTEST_EXTRA_DEPS - chrono_interop - testing - units -) - -header_only_library( - NAME io - HEADERS - io.hh - DEPS - quantity - quantity_point - zero - GTEST_SRCS - io_test.cc - GTEST_EXTRA_DEPS - prefix -) - -header_only_library( - NAME math - HEADERS - math.hh - DEPS - constant - quantity - quantity_point - units - GTEST_SRCS - math_test.cc - GTEST_EXTRA_DEPS - testing -) - -header_only_library( - NAME prefix - HEADERS - prefix.hh - DEPS - quantity - quantity_point - unit_of_measure - unit_symbol - GTEST_SRCS - prefix_test.cc - GTEST_EXTRA_DEPS - testing -) - -header_only_library( - NAME quantity - HEADERS - quantity.hh - DEPS - apply_magnitude - conversion_policy - operators - rep - unit_of_measure - utility - zero - GTEST_SRCS - quantity_chrono_policy_correspondence_test.cc - quantity_test.cc - GTEST_EXTRA_DEPS - chrono_policy_validation - prefix - testing -) - -header_only_library( - NAME quantity_point - HEADERS - quantity_point.hh - DEPS - quantity - stdx - utility - GTEST_SRCS - quantity_point_test.cc - GTEST_EXTRA_DEPS - prefix - testing -) - -header_only_library( - NAME testing - HEADERS - testing.hh - DEPS - io - stdx - unit_of_measure - GTest::gmock - GTEST_SRCS - testing_test.cc -) - -header_only_library( - NAME units - HEADERS - units/amperes.hh - units/bars.hh - units/becquerel.hh - units/bits.hh - units/bytes.hh - units/candelas.hh - units/celsius.hh - units/coulombs.hh - units/days.hh - units/degrees.hh - units/fahrenheit.hh - units/farads.hh - units/fathoms.hh - units/feet.hh - units/furlongs.hh - units/grams.hh - units/grays.hh - units/henries.hh - units/hertz.hh - units/hours.hh - units/inches.hh - units/joules.hh - units/katals.hh - units/kelvins.hh - units/knots.hh - units/liters.hh - units/lumens.hh - units/lux.hh - units/meters.hh - units/miles.hh - units/minutes.hh - units/moles.hh - units/nautical_miles.hh - units/newtons.hh - units/ohms.hh - units/pascals.hh - units/percent.hh - units/pounds_force.hh - units/pounds_mass.hh - units/radians.hh - units/revolutions.hh - units/seconds.hh - units/siemens.hh - units/slugs.hh - units/standard_gravity.hh - units/steradians.hh - units/tesla.hh - units/unos.hh - units/volts.hh - units/watts.hh - units/webers.hh - units/yards.hh - DEPS - prefix - quantity - quantity_point - unit_of_measure - unit_symbol - GTEST_SRCS - units/test/amperes_test.cc - units/test/bars_test.cc - units/test/becquerel_test.cc - units/test/bits_test.cc - units/test/bytes_test.cc - units/test/candelas_test.cc - units/test/celsius_test.cc - units/test/coulombs_test.cc - units/test/days_test.cc - units/test/degrees_test.cc - units/test/fahrenheit_test.cc - units/test/farads_test.cc - units/test/fathoms_test.cc - units/test/feet_test.cc - units/test/furlongs_test.cc - units/test/grams_test.cc - units/test/grays_test.cc - units/test/henries_test.cc - units/test/hertz_test.cc - units/test/hours_test.cc - units/test/inches_test.cc - units/test/joules_test.cc - units/test/katals_test.cc - units/test/kelvins_test.cc - units/test/knots_test.cc - units/test/liters_test.cc - units/test/lumens_test.cc - units/test/lux_test.cc - units/test/meters_test.cc - units/test/miles_test.cc - units/test/minutes_test.cc - units/test/moles_test.cc - units/test/nautical_miles_test.cc - units/test/newtons_test.cc - units/test/ohms_test.cc - units/test/pascals_test.cc - units/test/percent_test.cc - units/test/pounds_force_test.cc - units/test/pounds_mass_test.cc - units/test/radians_test.cc - units/test/revolutions_test.cc - units/test/seconds_test.cc - units/test/siemens_test.cc - units/test/slugs_test.cc - units/test/standard_gravity_test.cc - units/test/steradians_test.cc - units/test/tesla_test.cc - units/test/unos_test.cc - units/test/volts_test.cc - units/test/watts_test.cc - units/test/webers_test.cc - units/test/yards_test.cc - GTEST_EXTRA_DEPS - testing -) - -header_only_library( - NAME unit_symbol - HEADERS - unit_symbol.hh - DEPS - wrapper_operations - GTEST_SRCS - unit_symbol_test.cc - GTEST_EXTRA_DEPS - testing - units -) - -# -# Private implementation detail targets -# - -header_only_library( - NAME apply_magnitude - INTERNAL_ONLY - HEADERS - apply_magnitude.hh - DEPS - apply_rational_magnitude_to_integral - GTEST_SRCS - apply_magnitude_test.cc - GTEST_EXTRA_DEPS - testing -) - -header_only_library( - NAME apply_rational_magnitude_to_integral - INTERNAL_ONLY - HEADERS - apply_rational_magnitude_to_integral.hh - DEPS - magnitude - GTEST_SRCS - apply_rational_magnitude_to_integral_test.cc - GTEST_EXTRA_DEPS - testing -) - -header_only_library( - NAME chrono_policy_validation - INTERNAL_ONLY - HEADERS - chrono_policy_validation.hh - DEPS - dimension - quantity - stdx - unit_of_measure - GTest::gtest - GTEST_SRCS - chrono_policy_validation_test.cc - GTEST_EXTRA_DEPS - prefix - testing -) - - -header_only_library( - NAME conversion_policy - INTERNAL_ONLY - HEADERS - conversion_policy.hh - DEPS - magnitude - stdx - unit_of_measure - GTEST_SRCS - conversion_policy_test.cc -) - -header_only_library( - NAME dimension - INTERNAL_ONLY - HEADERS - dimension.hh - DEPS - packs - power_aliases - GTEST_SRCS - dimension_test.cc - GTEST_EXTRA_DEPS - testing - units -) - -header_only_library( - NAME magnitude - INTERNAL_ONLY - HEADERS - magnitude.hh - DEPS - packs - power_aliases - stdx - utility - zero - GTEST_SRCS - magnitude_test.cc - GTEST_EXTRA_DEPS - testing -) - -header_only_library( - NAME operators - INTERNAL_ONLY - HEADERS - operators.hh - GTEST_SRCS - operators_test.cc - GTEST_EXTRA_DEPS - testing -) - -header_only_library( - NAME packs - INTERNAL_ONLY - HEADERS - packs.hh - DEPS - stdx - utility - GTEST_SRCS - packs_test.cc -) - -header_only_library( - NAME power_aliases - INTERNAL_ONLY - HEADERS - power_aliases.hh - GTEST_SRCS - power_aliases_test.cc - GTEST_EXTRA_DEPS - packs -) - -header_only_library( - NAME rep - INTERNAL_ONLY - HEADERS - rep.hh - DEPS - stdx - GTEST_SRCS - rep_test.cc - GTEST_EXTRA_DEPS - chrono_interop - constant - magnitude - prefix - quantity - quantity_point - unit_symbol - units -) - -header_only_library( - NAME stdx - INTERNAL_ONLY - HEADERS - stdx/experimental/is_detected.hh - stdx/functional.hh - stdx/type_traits.hh - stdx/utility.hh - GTEST_SRCS - stdx/test/utility_test.cc -) - -header_only_library( - NAME unit_of_measure - INTERNAL_ONLY - HEADERS - unit_of_measure.hh - DEPS - dimension - magnitude - power_aliases - stdx - utility - zero - GTEST_SRCS - unit_of_measure_test.cc - GTEST_EXTRA_DEPS - prefix - testing - units -) - -header_only_library( - NAME utility - INTERNAL_ONLY - HEADERS - utility/factoring.hh - utility/string_constant.hh - utility/type_traits.hh - DEPS - stdx - GTEST_SRCS - utility/test/factoring_test.cc - utility/test/string_constant_test.cc - utility/test/type_traits_test.cc -) - -header_only_library( - NAME wrapper_operations - INTERNAL_ONLY - HEADERS - wrapper_operations.hh - DEPS - quantity - stdx - GTEST_SRCS - wrapper_operations_test.cc - GTEST_EXTRA_DEPS - testing - units -) - -header_only_library( - NAME zero - INTERNAL_ONLY - HEADERS - zero.hh - GTEST_SRCS - zero_test.cc -) diff --git a/cmake/AuConfig.cmake.in b/cmake/AuConfig.cmake.in index b121f76f..f7521429 100644 --- a/cmake/AuConfig.cmake.in +++ b/cmake/AuConfig.cmake.in @@ -12,11 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -@PACKAGE_INIT@ - -include(CMakeFindDependencyMacro) -find_dependency(googletest 1.12.1) - -include(${CMAKE_CURRENT_LIST_DIR}/AuHeaders.cmake) - -check_required_components(Au) +include(${CMAKE_CURRENT_LIST_DIR}/AuTargets.cmake) \ No newline at end of file diff --git a/cmake/HeaderOnlyLibrary.cmake b/cmake/HeaderOnlyLibrary.cmake deleted file mode 100644 index 28daf006..00000000 --- a/cmake/HeaderOnlyLibrary.cmake +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2024 Aurora Operations, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function(header_only_library) - # - # Handle argument parsing - # - - set(prefix ARG) - set(noValueVars INTERNAL_ONLY) - set(singleValueVars NAME) - set(multiValueVars - HEADERS - DEPS - GTEST_SRCS - GTEST_EXTRA_DEPS - ) - - cmake_parse_arguments( - PARSE_ARGV 0 - "${prefix}" - "${noValueVars}" - "${singleValueVars}" - "${multiValueVars}" - ) - - # - # Function body - # - - # Add the main target. - add_library(${ARG_NAME} INTERFACE) - target_sources( - ${ARG_NAME} - INTERFACE - FILE_SET HEADERS - BASE_DIRS "${PROJECT_SOURCE_DIR}/au/code" - FILES ${ARG_HEADERS} - ) - if (DEFINED ARG_DEPS) - target_link_libraries(${ARG_NAME} INTERFACE ${ARG_DEPS}) - endif() - - # Require C++14 support. - # - # (We can consider adding a parameter to make this customizable later.) - target_compile_features(${ARG_NAME} INTERFACE cxx_std_14) - - # If it's internal-only, change its export name accordingly. - # See: https://stackoverflow.com/a/68321274 - if (ARG_INTERNAL_ONLY) - set_target_properties(${ARG_NAME} PROPERTIES EXPORT_NAME "_Au_private_${ARG_NAME}") - else() - add_library(Au::${ARG_NAME} ALIAS ${ARG_NAME}) - endif() - - # Install the library. (This is required for other projects to use Au via CMake.) - include(GNUInstallDirs) - install( - TARGETS ${ARG_NAME} - EXPORT ${AU_EXPORT_SET_NAME} - FILE_SET HEADERS - INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" - ) - - # Add the test, if requested. - if (DEFINED ARG_GTEST_SRCS) - add_executable("${ARG_NAME}_test") - target_sources("${ARG_NAME}_test" PRIVATE ${ARG_GTEST_SRCS}) - target_link_libraries( - "${ARG_NAME}_test" - PRIVATE - ${ARG_NAME} - ${ARG_GTEST_EXTRA_DEPS} - GTest::gmock_main - ) - gtest_discover_tests("${ARG_NAME}_test") - endif() -endfunction() diff --git a/au/BUILD.bazel b/include/BUILD.bazel similarity index 100% rename from au/BUILD.bazel rename to include/BUILD.bazel diff --git a/au/code/au/apply_magnitude.hh b/include/au/apply_magnitude.hh similarity index 100% rename from au/code/au/apply_magnitude.hh rename to include/au/apply_magnitude.hh diff --git a/au/code/au/apply_rational_magnitude_to_integral.hh b/include/au/apply_rational_magnitude_to_integral.hh similarity index 100% rename from au/code/au/apply_rational_magnitude_to_integral.hh rename to include/au/apply_rational_magnitude_to_integral.hh diff --git a/au/code/au/au.hh b/include/au/au.hh similarity index 100% rename from au/code/au/au.hh rename to include/au/au.hh diff --git a/au/code/au/chrono_interop.hh b/include/au/chrono_interop.hh similarity index 100% rename from au/code/au/chrono_interop.hh rename to include/au/chrono_interop.hh diff --git a/au/code/au/chrono_policy_validation.hh b/include/au/chrono_policy_validation.hh similarity index 100% rename from au/code/au/chrono_policy_validation.hh rename to include/au/chrono_policy_validation.hh diff --git a/au/code/au/constant.hh b/include/au/constant.hh similarity index 100% rename from au/code/au/constant.hh rename to include/au/constant.hh diff --git a/au/code/au/conversion_policy.hh b/include/au/conversion_policy.hh similarity index 100% rename from au/code/au/conversion_policy.hh rename to include/au/conversion_policy.hh diff --git a/au/code/au/dimension.hh b/include/au/dimension.hh similarity index 100% rename from au/code/au/dimension.hh rename to include/au/dimension.hh diff --git a/au/code/au/io.hh b/include/au/io.hh similarity index 100% rename from au/code/au/io.hh rename to include/au/io.hh diff --git a/au/code/au/magnitude.hh b/include/au/magnitude.hh similarity index 100% rename from au/code/au/magnitude.hh rename to include/au/magnitude.hh diff --git a/au/code/au/math.hh b/include/au/math.hh similarity index 100% rename from au/code/au/math.hh rename to include/au/math.hh diff --git a/au/code/au/operators.hh b/include/au/operators.hh similarity index 100% rename from au/code/au/operators.hh rename to include/au/operators.hh diff --git a/au/code/au/packs.hh b/include/au/packs.hh similarity index 100% rename from au/code/au/packs.hh rename to include/au/packs.hh diff --git a/au/code/au/power_aliases.hh b/include/au/power_aliases.hh similarity index 100% rename from au/code/au/power_aliases.hh rename to include/au/power_aliases.hh diff --git a/au/code/au/prefix.hh b/include/au/prefix.hh similarity index 100% rename from au/code/au/prefix.hh rename to include/au/prefix.hh diff --git a/au/code/au/quantity.hh b/include/au/quantity.hh similarity index 100% rename from au/code/au/quantity.hh rename to include/au/quantity.hh diff --git a/au/code/au/quantity_point.hh b/include/au/quantity_point.hh similarity index 100% rename from au/code/au/quantity_point.hh rename to include/au/quantity_point.hh diff --git a/au/code/au/rep.hh b/include/au/rep.hh similarity index 100% rename from au/code/au/rep.hh rename to include/au/rep.hh diff --git a/au/code/au/stdx/experimental/is_detected.hh b/include/au/stdx/experimental/is_detected.hh similarity index 100% rename from au/code/au/stdx/experimental/is_detected.hh rename to include/au/stdx/experimental/is_detected.hh diff --git a/au/code/au/stdx/functional.hh b/include/au/stdx/functional.hh similarity index 100% rename from au/code/au/stdx/functional.hh rename to include/au/stdx/functional.hh diff --git a/au/code/au/stdx/type_traits.hh b/include/au/stdx/type_traits.hh similarity index 100% rename from au/code/au/stdx/type_traits.hh rename to include/au/stdx/type_traits.hh diff --git a/au/code/au/stdx/utility.hh b/include/au/stdx/utility.hh similarity index 100% rename from au/code/au/stdx/utility.hh rename to include/au/stdx/utility.hh diff --git a/au/code/au/testing.hh b/include/au/testing.hh similarity index 100% rename from au/code/au/testing.hh rename to include/au/testing.hh diff --git a/au/code/au/unit_of_measure.hh b/include/au/unit_of_measure.hh similarity index 100% rename from au/code/au/unit_of_measure.hh rename to include/au/unit_of_measure.hh diff --git a/au/code/au/unit_symbol.hh b/include/au/unit_symbol.hh similarity index 100% rename from au/code/au/unit_symbol.hh rename to include/au/unit_symbol.hh diff --git a/au/code/au/units/amperes.hh b/include/au/units/amperes.hh similarity index 100% rename from au/code/au/units/amperes.hh rename to include/au/units/amperes.hh diff --git a/au/code/au/units/bars.hh b/include/au/units/bars.hh similarity index 100% rename from au/code/au/units/bars.hh rename to include/au/units/bars.hh diff --git a/au/code/au/units/becquerel.hh b/include/au/units/becquerel.hh similarity index 100% rename from au/code/au/units/becquerel.hh rename to include/au/units/becquerel.hh diff --git a/au/code/au/units/bits.hh b/include/au/units/bits.hh similarity index 100% rename from au/code/au/units/bits.hh rename to include/au/units/bits.hh diff --git a/au/code/au/units/bytes.hh b/include/au/units/bytes.hh similarity index 100% rename from au/code/au/units/bytes.hh rename to include/au/units/bytes.hh diff --git a/au/code/au/units/candelas.hh b/include/au/units/candelas.hh similarity index 100% rename from au/code/au/units/candelas.hh rename to include/au/units/candelas.hh diff --git a/au/code/au/units/celsius.hh b/include/au/units/celsius.hh similarity index 100% rename from au/code/au/units/celsius.hh rename to include/au/units/celsius.hh diff --git a/au/code/au/units/coulombs.hh b/include/au/units/coulombs.hh similarity index 100% rename from au/code/au/units/coulombs.hh rename to include/au/units/coulombs.hh diff --git a/au/code/au/units/days.hh b/include/au/units/days.hh similarity index 100% rename from au/code/au/units/days.hh rename to include/au/units/days.hh diff --git a/au/code/au/units/degrees.hh b/include/au/units/degrees.hh similarity index 100% rename from au/code/au/units/degrees.hh rename to include/au/units/degrees.hh diff --git a/au/code/au/units/fahrenheit.hh b/include/au/units/fahrenheit.hh similarity index 100% rename from au/code/au/units/fahrenheit.hh rename to include/au/units/fahrenheit.hh diff --git a/au/code/au/units/farads.hh b/include/au/units/farads.hh similarity index 100% rename from au/code/au/units/farads.hh rename to include/au/units/farads.hh diff --git a/au/code/au/units/fathoms.hh b/include/au/units/fathoms.hh similarity index 100% rename from au/code/au/units/fathoms.hh rename to include/au/units/fathoms.hh diff --git a/au/code/au/units/feet.hh b/include/au/units/feet.hh similarity index 100% rename from au/code/au/units/feet.hh rename to include/au/units/feet.hh diff --git a/au/code/au/units/furlongs.hh b/include/au/units/furlongs.hh similarity index 100% rename from au/code/au/units/furlongs.hh rename to include/au/units/furlongs.hh diff --git a/au/code/au/units/grams.hh b/include/au/units/grams.hh similarity index 100% rename from au/code/au/units/grams.hh rename to include/au/units/grams.hh diff --git a/au/code/au/units/grays.hh b/include/au/units/grays.hh similarity index 100% rename from au/code/au/units/grays.hh rename to include/au/units/grays.hh diff --git a/au/code/au/units/henries.hh b/include/au/units/henries.hh similarity index 100% rename from au/code/au/units/henries.hh rename to include/au/units/henries.hh diff --git a/au/code/au/units/hertz.hh b/include/au/units/hertz.hh similarity index 100% rename from au/code/au/units/hertz.hh rename to include/au/units/hertz.hh diff --git a/au/code/au/units/hours.hh b/include/au/units/hours.hh similarity index 100% rename from au/code/au/units/hours.hh rename to include/au/units/hours.hh diff --git a/au/code/au/units/inches.hh b/include/au/units/inches.hh similarity index 100% rename from au/code/au/units/inches.hh rename to include/au/units/inches.hh diff --git a/au/code/au/units/joules.hh b/include/au/units/joules.hh similarity index 100% rename from au/code/au/units/joules.hh rename to include/au/units/joules.hh diff --git a/au/code/au/units/katals.hh b/include/au/units/katals.hh similarity index 100% rename from au/code/au/units/katals.hh rename to include/au/units/katals.hh diff --git a/au/code/au/units/kelvins.hh b/include/au/units/kelvins.hh similarity index 100% rename from au/code/au/units/kelvins.hh rename to include/au/units/kelvins.hh diff --git a/au/code/au/units/knots.hh b/include/au/units/knots.hh similarity index 100% rename from au/code/au/units/knots.hh rename to include/au/units/knots.hh diff --git a/au/code/au/units/liters.hh b/include/au/units/liters.hh similarity index 100% rename from au/code/au/units/liters.hh rename to include/au/units/liters.hh diff --git a/au/code/au/units/lumens.hh b/include/au/units/lumens.hh similarity index 100% rename from au/code/au/units/lumens.hh rename to include/au/units/lumens.hh diff --git a/au/code/au/units/lux.hh b/include/au/units/lux.hh similarity index 100% rename from au/code/au/units/lux.hh rename to include/au/units/lux.hh diff --git a/au/code/au/units/meters.hh b/include/au/units/meters.hh similarity index 100% rename from au/code/au/units/meters.hh rename to include/au/units/meters.hh diff --git a/au/code/au/units/miles.hh b/include/au/units/miles.hh similarity index 100% rename from au/code/au/units/miles.hh rename to include/au/units/miles.hh diff --git a/au/code/au/units/minutes.hh b/include/au/units/minutes.hh similarity index 100% rename from au/code/au/units/minutes.hh rename to include/au/units/minutes.hh diff --git a/au/code/au/units/moles.hh b/include/au/units/moles.hh similarity index 100% rename from au/code/au/units/moles.hh rename to include/au/units/moles.hh diff --git a/au/code/au/units/nautical_miles.hh b/include/au/units/nautical_miles.hh similarity index 100% rename from au/code/au/units/nautical_miles.hh rename to include/au/units/nautical_miles.hh diff --git a/au/code/au/units/newtons.hh b/include/au/units/newtons.hh similarity index 100% rename from au/code/au/units/newtons.hh rename to include/au/units/newtons.hh diff --git a/au/code/au/units/ohms.hh b/include/au/units/ohms.hh similarity index 100% rename from au/code/au/units/ohms.hh rename to include/au/units/ohms.hh diff --git a/au/code/au/units/pascals.hh b/include/au/units/pascals.hh similarity index 100% rename from au/code/au/units/pascals.hh rename to include/au/units/pascals.hh diff --git a/au/code/au/units/percent.hh b/include/au/units/percent.hh similarity index 100% rename from au/code/au/units/percent.hh rename to include/au/units/percent.hh diff --git a/au/code/au/units/pounds_force.hh b/include/au/units/pounds_force.hh similarity index 100% rename from au/code/au/units/pounds_force.hh rename to include/au/units/pounds_force.hh diff --git a/au/code/au/units/pounds_mass.hh b/include/au/units/pounds_mass.hh similarity index 100% rename from au/code/au/units/pounds_mass.hh rename to include/au/units/pounds_mass.hh diff --git a/au/code/au/units/radians.hh b/include/au/units/radians.hh similarity index 100% rename from au/code/au/units/radians.hh rename to include/au/units/radians.hh diff --git a/au/code/au/units/revolutions.hh b/include/au/units/revolutions.hh similarity index 100% rename from au/code/au/units/revolutions.hh rename to include/au/units/revolutions.hh diff --git a/au/code/au/units/seconds.hh b/include/au/units/seconds.hh similarity index 100% rename from au/code/au/units/seconds.hh rename to include/au/units/seconds.hh diff --git a/au/code/au/units/siemens.hh b/include/au/units/siemens.hh similarity index 100% rename from au/code/au/units/siemens.hh rename to include/au/units/siemens.hh diff --git a/au/code/au/units/slugs.hh b/include/au/units/slugs.hh similarity index 100% rename from au/code/au/units/slugs.hh rename to include/au/units/slugs.hh diff --git a/au/code/au/units/standard_gravity.hh b/include/au/units/standard_gravity.hh similarity index 100% rename from au/code/au/units/standard_gravity.hh rename to include/au/units/standard_gravity.hh diff --git a/au/code/au/units/steradians.hh b/include/au/units/steradians.hh similarity index 100% rename from au/code/au/units/steradians.hh rename to include/au/units/steradians.hh diff --git a/au/code/au/units/tesla.hh b/include/au/units/tesla.hh similarity index 100% rename from au/code/au/units/tesla.hh rename to include/au/units/tesla.hh diff --git a/au/code/au/units/unos.hh b/include/au/units/unos.hh similarity index 100% rename from au/code/au/units/unos.hh rename to include/au/units/unos.hh diff --git a/au/code/au/units/volts.hh b/include/au/units/volts.hh similarity index 100% rename from au/code/au/units/volts.hh rename to include/au/units/volts.hh diff --git a/au/code/au/units/watts.hh b/include/au/units/watts.hh similarity index 100% rename from au/code/au/units/watts.hh rename to include/au/units/watts.hh diff --git a/au/code/au/units/webers.hh b/include/au/units/webers.hh similarity index 100% rename from au/code/au/units/webers.hh rename to include/au/units/webers.hh diff --git a/au/code/au/units/yards.hh b/include/au/units/yards.hh similarity index 100% rename from au/code/au/units/yards.hh rename to include/au/units/yards.hh diff --git a/au/code/au/utility/factoring.hh b/include/au/utility/factoring.hh similarity index 100% rename from au/code/au/utility/factoring.hh rename to include/au/utility/factoring.hh diff --git a/au/code/au/utility/string_constant.hh b/include/au/utility/string_constant.hh similarity index 100% rename from au/code/au/utility/string_constant.hh rename to include/au/utility/string_constant.hh diff --git a/au/code/au/utility/type_traits.hh b/include/au/utility/type_traits.hh similarity index 100% rename from au/code/au/utility/type_traits.hh rename to include/au/utility/type_traits.hh diff --git a/au/code/au/wrapper_operations.hh b/include/au/wrapper_operations.hh similarity index 100% rename from au/code/au/wrapper_operations.hh rename to include/au/wrapper_operations.hh diff --git a/au/code/au/zero.hh b/include/au/zero.hh similarity index 100% rename from au/code/au/zero.hh rename to include/au/zero.hh diff --git a/au/error_examples.cc b/include/error_examples.cc similarity index 100% rename from au/error_examples.cc rename to include/error_examples.cc diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..a3681e7c --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,30 @@ +if(AU_USE_VENDORED_GTEST) + include(FetchContent) + FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # Release 1.12.1 + FIND_PACKAGE_ARGS + 1.12.1 + NAMES GTest + ) + + # https://google.github.io/googletest/quickstart-cmake.html + # For Windows: Prevent overriding the parent project's compiler/linker settings + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + + FetchContent_MakeAvailable(googletest) +else() + find_package(GTest REQUIRED) +endif() + +include(GoogleTest) + +file(GLOB TESTS CONFIGURE_DEPENDS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cc) + +foreach(test_file ${TESTS}) + get_filename_component(test_name ${test_file} NAME_WE) + add_executable(${test_name} ${test_file}) + target_link_libraries(${test_name} PRIVATE Au::au GTest::gmock_main) + gtest_discover_tests(${test_name}) +endforeach() diff --git a/au/code/au/units/test/amperes_test.cc b/tests/amperes_test.cc similarity index 100% rename from au/code/au/units/test/amperes_test.cc rename to tests/amperes_test.cc diff --git a/au/code/au/apply_magnitude_test.cc b/tests/apply_magnitude_test.cc similarity index 100% rename from au/code/au/apply_magnitude_test.cc rename to tests/apply_magnitude_test.cc diff --git a/au/code/au/apply_rational_magnitude_to_integral_test.cc b/tests/apply_rational_magnitude_to_integral_test.cc similarity index 100% rename from au/code/au/apply_rational_magnitude_to_integral_test.cc rename to tests/apply_rational_magnitude_to_integral_test.cc diff --git a/au/code/au/au_test.cc b/tests/au_test.cc similarity index 100% rename from au/code/au/au_test.cc rename to tests/au_test.cc diff --git a/au/code/au/units/test/bars_test.cc b/tests/bars_test.cc similarity index 100% rename from au/code/au/units/test/bars_test.cc rename to tests/bars_test.cc diff --git a/au/code/au/units/test/becquerel_test.cc b/tests/becquerel_test.cc similarity index 100% rename from au/code/au/units/test/becquerel_test.cc rename to tests/becquerel_test.cc diff --git a/au/code/au/units/test/bits_test.cc b/tests/bits_test.cc similarity index 100% rename from au/code/au/units/test/bits_test.cc rename to tests/bits_test.cc diff --git a/au/code/au/units/test/bytes_test.cc b/tests/bytes_test.cc similarity index 100% rename from au/code/au/units/test/bytes_test.cc rename to tests/bytes_test.cc diff --git a/au/code/au/units/test/candelas_test.cc b/tests/candelas_test.cc similarity index 100% rename from au/code/au/units/test/candelas_test.cc rename to tests/candelas_test.cc diff --git a/au/code/au/units/test/celsius_test.cc b/tests/celsius_test.cc similarity index 100% rename from au/code/au/units/test/celsius_test.cc rename to tests/celsius_test.cc diff --git a/au/code/au/chrono_interop_test.cc b/tests/chrono_interop_test.cc similarity index 100% rename from au/code/au/chrono_interop_test.cc rename to tests/chrono_interop_test.cc diff --git a/au/code/au/chrono_policy_validation_test.cc b/tests/chrono_policy_validation_test.cc similarity index 100% rename from au/code/au/chrono_policy_validation_test.cc rename to tests/chrono_policy_validation_test.cc diff --git a/au/code/au/constant_test.cc b/tests/constant_test.cc similarity index 100% rename from au/code/au/constant_test.cc rename to tests/constant_test.cc diff --git a/au/code/au/conversion_policy_test.cc b/tests/conversion_policy_test.cc similarity index 100% rename from au/code/au/conversion_policy_test.cc rename to tests/conversion_policy_test.cc diff --git a/au/code/au/units/test/coulombs_test.cc b/tests/coulombs_test.cc similarity index 100% rename from au/code/au/units/test/coulombs_test.cc rename to tests/coulombs_test.cc diff --git a/au/code/au/units/test/days_test.cc b/tests/days_test.cc similarity index 100% rename from au/code/au/units/test/days_test.cc rename to tests/days_test.cc diff --git a/au/code/au/units/test/degrees_test.cc b/tests/degrees_test.cc similarity index 100% rename from au/code/au/units/test/degrees_test.cc rename to tests/degrees_test.cc diff --git a/au/code/au/dimension_test.cc b/tests/dimension_test.cc similarity index 100% rename from au/code/au/dimension_test.cc rename to tests/dimension_test.cc diff --git a/au/code/au/utility/test/factoring_test.cc b/tests/factoring_test.cc similarity index 100% rename from au/code/au/utility/test/factoring_test.cc rename to tests/factoring_test.cc diff --git a/au/code/au/units/test/fahrenheit_test.cc b/tests/fahrenheit_test.cc similarity index 100% rename from au/code/au/units/test/fahrenheit_test.cc rename to tests/fahrenheit_test.cc diff --git a/au/code/au/units/test/farads_test.cc b/tests/farads_test.cc similarity index 100% rename from au/code/au/units/test/farads_test.cc rename to tests/farads_test.cc diff --git a/au/code/au/units/test/fathoms_test.cc b/tests/fathoms_test.cc similarity index 100% rename from au/code/au/units/test/fathoms_test.cc rename to tests/fathoms_test.cc diff --git a/au/code/au/units/test/feet_test.cc b/tests/feet_test.cc similarity index 100% rename from au/code/au/units/test/feet_test.cc rename to tests/feet_test.cc diff --git a/au/code/au/units/test/furlongs_test.cc b/tests/furlongs_test.cc similarity index 100% rename from au/code/au/units/test/furlongs_test.cc rename to tests/furlongs_test.cc diff --git a/au/code/au/units/test/grams_test.cc b/tests/grams_test.cc similarity index 100% rename from au/code/au/units/test/grams_test.cc rename to tests/grams_test.cc diff --git a/au/code/au/units/test/grays_test.cc b/tests/grays_test.cc similarity index 100% rename from au/code/au/units/test/grays_test.cc rename to tests/grays_test.cc diff --git a/au/code/au/units/test/henries_test.cc b/tests/henries_test.cc similarity index 100% rename from au/code/au/units/test/henries_test.cc rename to tests/henries_test.cc diff --git a/au/code/au/units/test/hertz_test.cc b/tests/hertz_test.cc similarity index 100% rename from au/code/au/units/test/hertz_test.cc rename to tests/hertz_test.cc diff --git a/au/code/au/units/test/hours_test.cc b/tests/hours_test.cc similarity index 100% rename from au/code/au/units/test/hours_test.cc rename to tests/hours_test.cc diff --git a/au/code/au/units/test/inches_test.cc b/tests/inches_test.cc similarity index 100% rename from au/code/au/units/test/inches_test.cc rename to tests/inches_test.cc diff --git a/au/code/au/io_test.cc b/tests/io_test.cc similarity index 100% rename from au/code/au/io_test.cc rename to tests/io_test.cc diff --git a/au/code/au/units/test/joules_test.cc b/tests/joules_test.cc similarity index 100% rename from au/code/au/units/test/joules_test.cc rename to tests/joules_test.cc diff --git a/au/code/au/units/test/katals_test.cc b/tests/katals_test.cc similarity index 100% rename from au/code/au/units/test/katals_test.cc rename to tests/katals_test.cc diff --git a/au/code/au/units/test/kelvins_test.cc b/tests/kelvins_test.cc similarity index 100% rename from au/code/au/units/test/kelvins_test.cc rename to tests/kelvins_test.cc diff --git a/au/code/au/units/test/knots_test.cc b/tests/knots_test.cc similarity index 100% rename from au/code/au/units/test/knots_test.cc rename to tests/knots_test.cc diff --git a/au/code/au/units/test/liters_test.cc b/tests/liters_test.cc similarity index 100% rename from au/code/au/units/test/liters_test.cc rename to tests/liters_test.cc diff --git a/au/code/au/units/test/lumens_test.cc b/tests/lumens_test.cc similarity index 100% rename from au/code/au/units/test/lumens_test.cc rename to tests/lumens_test.cc diff --git a/au/code/au/units/test/lux_test.cc b/tests/lux_test.cc similarity index 100% rename from au/code/au/units/test/lux_test.cc rename to tests/lux_test.cc diff --git a/au/code/au/magnitude_test.cc b/tests/magnitude_test.cc similarity index 100% rename from au/code/au/magnitude_test.cc rename to tests/magnitude_test.cc diff --git a/au/code/au/math_test.cc b/tests/math_test.cc similarity index 100% rename from au/code/au/math_test.cc rename to tests/math_test.cc diff --git a/au/code/au/units/test/meters_test.cc b/tests/meters_test.cc similarity index 100% rename from au/code/au/units/test/meters_test.cc rename to tests/meters_test.cc diff --git a/au/code/au/units/test/miles_test.cc b/tests/miles_test.cc similarity index 100% rename from au/code/au/units/test/miles_test.cc rename to tests/miles_test.cc diff --git a/au/code/au/units/test/minutes_test.cc b/tests/minutes_test.cc similarity index 100% rename from au/code/au/units/test/minutes_test.cc rename to tests/minutes_test.cc diff --git a/au/code/au/units/test/moles_test.cc b/tests/moles_test.cc similarity index 100% rename from au/code/au/units/test/moles_test.cc rename to tests/moles_test.cc diff --git a/au/code/au/units/test/nautical_miles_test.cc b/tests/nautical_miles_test.cc similarity index 100% rename from au/code/au/units/test/nautical_miles_test.cc rename to tests/nautical_miles_test.cc diff --git a/au/code/au/units/test/newtons_test.cc b/tests/newtons_test.cc similarity index 100% rename from au/code/au/units/test/newtons_test.cc rename to tests/newtons_test.cc diff --git a/au/code/au/no_wconversion_test.cc b/tests/no_wconversion_test.cc similarity index 100% rename from au/code/au/no_wconversion_test.cc rename to tests/no_wconversion_test.cc diff --git a/au/code/au/units/test/ohms_test.cc b/tests/ohms_test.cc similarity index 100% rename from au/code/au/units/test/ohms_test.cc rename to tests/ohms_test.cc diff --git a/au/code/au/operators_test.cc b/tests/operators_test.cc similarity index 100% rename from au/code/au/operators_test.cc rename to tests/operators_test.cc diff --git a/au/code/au/packs_test.cc b/tests/packs_test.cc similarity index 100% rename from au/code/au/packs_test.cc rename to tests/packs_test.cc diff --git a/au/code/au/units/test/pascals_test.cc b/tests/pascals_test.cc similarity index 100% rename from au/code/au/units/test/pascals_test.cc rename to tests/pascals_test.cc diff --git a/au/code/au/units/test/percent_test.cc b/tests/percent_test.cc similarity index 100% rename from au/code/au/units/test/percent_test.cc rename to tests/percent_test.cc diff --git a/au/code/au/units/test/pounds_force_test.cc b/tests/pounds_force_test.cc similarity index 100% rename from au/code/au/units/test/pounds_force_test.cc rename to tests/pounds_force_test.cc diff --git a/au/code/au/units/test/pounds_mass_test.cc b/tests/pounds_mass_test.cc similarity index 100% rename from au/code/au/units/test/pounds_mass_test.cc rename to tests/pounds_mass_test.cc diff --git a/au/code/au/power_aliases_test.cc b/tests/power_aliases_test.cc similarity index 100% rename from au/code/au/power_aliases_test.cc rename to tests/power_aliases_test.cc diff --git a/au/code/au/prefix_test.cc b/tests/prefix_test.cc similarity index 100% rename from au/code/au/prefix_test.cc rename to tests/prefix_test.cc diff --git a/au/code/au/quantity_chrono_policy_correspondence_test.cc b/tests/quantity_chrono_policy_correspondence_test.cc similarity index 100% rename from au/code/au/quantity_chrono_policy_correspondence_test.cc rename to tests/quantity_chrono_policy_correspondence_test.cc diff --git a/au/code/au/quantity_point_test.cc b/tests/quantity_point_test.cc similarity index 100% rename from au/code/au/quantity_point_test.cc rename to tests/quantity_point_test.cc diff --git a/au/code/au/quantity_test.cc b/tests/quantity_test.cc similarity index 100% rename from au/code/au/quantity_test.cc rename to tests/quantity_test.cc diff --git a/au/code/au/units/test/radians_test.cc b/tests/radians_test.cc similarity index 100% rename from au/code/au/units/test/radians_test.cc rename to tests/radians_test.cc diff --git a/au/code/au/rep_test.cc b/tests/rep_test.cc similarity index 100% rename from au/code/au/rep_test.cc rename to tests/rep_test.cc diff --git a/au/code/au/units/test/revolutions_test.cc b/tests/revolutions_test.cc similarity index 100% rename from au/code/au/units/test/revolutions_test.cc rename to tests/revolutions_test.cc diff --git a/au/code/au/units/test/seconds_test.cc b/tests/seconds_test.cc similarity index 100% rename from au/code/au/units/test/seconds_test.cc rename to tests/seconds_test.cc diff --git a/au/code/au/units/test/siemens_test.cc b/tests/siemens_test.cc similarity index 100% rename from au/code/au/units/test/siemens_test.cc rename to tests/siemens_test.cc diff --git a/au/code/au/units/test/slugs_test.cc b/tests/slugs_test.cc similarity index 100% rename from au/code/au/units/test/slugs_test.cc rename to tests/slugs_test.cc diff --git a/au/code/au/units/test/standard_gravity_test.cc b/tests/standard_gravity_test.cc similarity index 100% rename from au/code/au/units/test/standard_gravity_test.cc rename to tests/standard_gravity_test.cc diff --git a/au/code/au/units/test/steradians_test.cc b/tests/steradians_test.cc similarity index 100% rename from au/code/au/units/test/steradians_test.cc rename to tests/steradians_test.cc diff --git a/au/code/au/utility/test/string_constant_test.cc b/tests/string_constant_test.cc similarity index 100% rename from au/code/au/utility/test/string_constant_test.cc rename to tests/string_constant_test.cc diff --git a/au/code/au/units/test/tesla_test.cc b/tests/tesla_test.cc similarity index 100% rename from au/code/au/units/test/tesla_test.cc rename to tests/tesla_test.cc diff --git a/au/code/au/testing_test.cc b/tests/testing_test.cc similarity index 100% rename from au/code/au/testing_test.cc rename to tests/testing_test.cc diff --git a/au/code/au/utility/test/type_traits_test.cc b/tests/type_traits_test.cc similarity index 100% rename from au/code/au/utility/test/type_traits_test.cc rename to tests/type_traits_test.cc diff --git a/au/code/au/unit_of_measure_test.cc b/tests/unit_of_measure_test.cc similarity index 100% rename from au/code/au/unit_of_measure_test.cc rename to tests/unit_of_measure_test.cc diff --git a/au/code/au/unit_symbol_test.cc b/tests/unit_symbol_test.cc similarity index 100% rename from au/code/au/unit_symbol_test.cc rename to tests/unit_symbol_test.cc diff --git a/au/code/au/units/test/unos_test.cc b/tests/unos_test.cc similarity index 100% rename from au/code/au/units/test/unos_test.cc rename to tests/unos_test.cc diff --git a/au/code/au/stdx/test/utility_test.cc b/tests/utility_test.cc similarity index 100% rename from au/code/au/stdx/test/utility_test.cc rename to tests/utility_test.cc diff --git a/au/code/au/units/test/volts_test.cc b/tests/volts_test.cc similarity index 100% rename from au/code/au/units/test/volts_test.cc rename to tests/volts_test.cc diff --git a/au/code/au/units/test/watts_test.cc b/tests/watts_test.cc similarity index 100% rename from au/code/au/units/test/watts_test.cc rename to tests/watts_test.cc diff --git a/au/code/au/units/test/webers_test.cc b/tests/webers_test.cc similarity index 100% rename from au/code/au/units/test/webers_test.cc rename to tests/webers_test.cc diff --git a/au/code/au/wrapper_operations_test.cc b/tests/wrapper_operations_test.cc similarity index 100% rename from au/code/au/wrapper_operations_test.cc rename to tests/wrapper_operations_test.cc diff --git a/au/code/au/units/test/yards_test.cc b/tests/yards_test.cc similarity index 100% rename from au/code/au/units/test/yards_test.cc rename to tests/yards_test.cc diff --git a/au/code/au/zero_test.cc b/tests/zero_test.cc similarity index 100% rename from au/code/au/zero_test.cc rename to tests/zero_test.cc