Merge branch 'master' of github.com:mpusz/units

This commit is contained in:
Mateusz Pusz
2021-11-08 18:37:44 +01:00
3 changed files with 11 additions and 11 deletions

View File

@@ -32,7 +32,7 @@ This repository contains three independent CMake-based projects:
- additionally to the dependencies of *./src* project, it uses: - additionally to the dependencies of *./src* project, it uses:
- `Catch2 <https://github.com/catchorg/Catch2>`_ library as a unit tests framework. - `Catch2 <https://github.com/catchorg/Catch2>`_ library as a unit tests framework.
- `linear algebra <https://github.com/BobSteagall/wg21/tree/master/linear_algebra/code>`_ - `linear algebra <https://github.com/BobSteagall/wg21/tree/master/include>`_
library based on proposal `P1385 <https://wg21.link/P1385>`_ used in some examples library based on proposal `P1385 <https://wg21.link/P1385>`_ used in some examples
and tests. and tests.
- `Doxygen <http://www.doxygen.nl>`_ to extract C++ entities information from the source - `Doxygen <http://www.doxygen.nl>`_ to extract C++ entities information from the source

View File

@@ -10,7 +10,7 @@ enough to be used with other Linear Algebra libraries existing on the market.
All of the examples provided in this chapter refer to the official proposal of the All of the examples provided in this chapter refer to the official proposal of the
Linear Algebra Library for the C++23 defined in `P1385 <https://wg21.link/P1385>`_ Linear Algebra Library for the C++23 defined in `P1385 <https://wg21.link/P1385>`_
and its latest implementation from `GitHub <https://github.com/BobSteagall/wg21>`_ and its latest implementation from `GitHub <https://github.com/BobSteagall/wg21/tree/master/include>`_
or `Conan <https://twonington.jfrog.io/artifactory/api/conan/conan-oss>`_. or `Conan <https://twonington.jfrog.io/artifactory/api/conan/conan-oss>`_.
Also, to simplify the examples all of them assume:: Also, to simplify the examples all of them assume::

View File

@@ -23,15 +23,15 @@
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
# core library options # core library options
set(${ProjectPrefix}DOWNCAST_MODE ON CACHE STRING "Select downcasting mode") set(${projectPrefix}DOWNCAST_MODE ON CACHE STRING "Select downcasting mode")
set_property(CACHE ${ProjectPrefix}DOWNCAST_MODE PROPERTY STRINGS AUTO ON OFF) set_property(CACHE ${projectPrefix}DOWNCAST_MODE PROPERTY STRINGS AUTO ON OFF)
# find dependencies # find dependencies
find_package(gsl-lite CONFIG REQUIRED) find_package(gsl-lite CONFIG REQUIRED)
# check if libc++ is being used # check if libc++ is being used
include(CheckLibcxxInUse) include(CheckLibcxxInUse)
check_libcxx_in_use(${ProjectPrefix}LIBCXX) check_libcxx_in_use(${projectPrefix}LIBCXX)
# core library definition # core library definition
add_library(mp-units-core INTERFACE) add_library(mp-units-core INTERFACE)
@@ -45,7 +45,7 @@ target_include_directories(mp-units-core ${unitsAsSystem} INTERFACE
) )
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(${ProjectPrefix}LIBCXX) if(${projectPrefix}LIBCXX)
find_package(range-v3 CONFIG REQUIRED) find_package(range-v3 CONFIG REQUIRED)
target_link_libraries(mp-units-core INTERFACE range-v3::range-v3) target_link_libraries(mp-units-core INTERFACE range-v3::range-v3)
endif() endif()
@@ -55,14 +55,14 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
) )
endif() endif()
if(DEFINED ${ProjectPrefix}DOWNCAST_MODE) if(DEFINED ${projectPrefix}DOWNCAST_MODE)
set(downcast_mode_options OFF ON AUTO) set(downcast_mode_options OFF ON AUTO)
list(FIND downcast_mode_options "${${ProjectPrefix}DOWNCAST_MODE}" downcast_mode) list(FIND downcast_mode_options "${${projectPrefix}DOWNCAST_MODE}" downcast_mode)
if(downcast_mode EQUAL -1) if(downcast_mode EQUAL -1)
message(FATAL_ERROR "'${ProjectPrefix}DOWNCAST_MODE' should be one of ${downcast_mode_options} ('${${ProjectPrefix}DOWNCAST_MODE}' received)") message(FATAL_ERROR "'${projectPrefix}DOWNCAST_MODE' should be one of ${downcast_mode_options} ('${${projectPrefix}DOWNCAST_MODE}' received)")
else() else()
message(STATUS "${ProjectPrefix}DOWNCAST_MODE: ${${ProjectPrefix}DOWNCAST_MODE}") message(STATUS "${projectPrefix}DOWNCAST_MODE: ${${projectPrefix}DOWNCAST_MODE}")
target_compile_definitions(mp-units-core INTERFACE ${ProjectPrefix}DOWNCAST_MODE=${downcast_mode}) target_compile_definitions(mp-units-core INTERFACE ${projectPrefix}DOWNCAST_MODE=${downcast_mode})
endif() endif()
endif() endif()