mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-05 13:14:29 +02:00
Merge branch 'master' of github.com:mpusz/units
This commit is contained in:
@@ -32,7 +32,7 @@ This repository contains three independent CMake-based projects:
|
||||
- additionally to the dependencies of *./src* project, it uses:
|
||||
|
||||
- `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
|
||||
and tests.
|
||||
- `Doxygen <http://www.doxygen.nl>`_ to extract C++ entities information from the source
|
||||
|
@@ -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
|
||||
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>`_.
|
||||
Also, to simplify the examples all of them assume::
|
||||
|
||||
|
@@ -23,15 +23,15 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
# core library options
|
||||
set(${ProjectPrefix}DOWNCAST_MODE ON CACHE STRING "Select downcasting mode")
|
||||
set_property(CACHE ${ProjectPrefix}DOWNCAST_MODE PROPERTY STRINGS AUTO ON OFF)
|
||||
set(${projectPrefix}DOWNCAST_MODE ON CACHE STRING "Select downcasting mode")
|
||||
set_property(CACHE ${projectPrefix}DOWNCAST_MODE PROPERTY STRINGS AUTO ON OFF)
|
||||
|
||||
# find dependencies
|
||||
find_package(gsl-lite CONFIG REQUIRED)
|
||||
|
||||
# check if libc++ is being used
|
||||
include(CheckLibcxxInUse)
|
||||
check_libcxx_in_use(${ProjectPrefix}LIBCXX)
|
||||
check_libcxx_in_use(${projectPrefix}LIBCXX)
|
||||
|
||||
# core library definition
|
||||
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(${ProjectPrefix}LIBCXX)
|
||||
if(${projectPrefix}LIBCXX)
|
||||
find_package(range-v3 CONFIG REQUIRED)
|
||||
target_link_libraries(mp-units-core INTERFACE range-v3::range-v3)
|
||||
endif()
|
||||
@@ -55,14 +55,14 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
)
|
||||
endif()
|
||||
|
||||
if(DEFINED ${ProjectPrefix}DOWNCAST_MODE)
|
||||
if(DEFINED ${projectPrefix}DOWNCAST_MODE)
|
||||
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)
|
||||
message(FATAL_ERROR "'${ProjectPrefix}DOWNCAST_MODE' should be one of ${downcast_mode_options} ('${${ProjectPrefix}DOWNCAST_MODE}' received)")
|
||||
message(FATAL_ERROR "'${projectPrefix}DOWNCAST_MODE' should be one of ${downcast_mode_options} ('${${projectPrefix}DOWNCAST_MODE}' received)")
|
||||
else()
|
||||
message(STATUS "${ProjectPrefix}DOWNCAST_MODE: ${${ProjectPrefix}DOWNCAST_MODE}")
|
||||
target_compile_definitions(mp-units-core INTERFACE ${ProjectPrefix}DOWNCAST_MODE=${downcast_mode})
|
||||
message(STATUS "${projectPrefix}DOWNCAST_MODE: ${${projectPrefix}DOWNCAST_MODE}")
|
||||
target_compile_definitions(mp-units-core INTERFACE ${projectPrefix}DOWNCAST_MODE=${downcast_mode})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
Reference in New Issue
Block a user