mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 11:54:27 +02:00
build: find_package()
calls don't spell CONFIG
explicitly anymore
This commit is contained in:
@@ -354,7 +354,7 @@ The following steps may be performed to obtain an official library release:
|
|||||||
with `find_package`:
|
with `find_package`:
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
find_package(mp-units CONFIG REQUIRED)
|
find_package(mp-units REQUIRED)
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Link your CMake targets with **mp-units**:
|
3. Link your CMake targets with **mp-units**:
|
||||||
|
@@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 3.5)
|
|||||||
|
|
||||||
# find dependencies
|
# find dependencies
|
||||||
if(NOT TARGET gsl::gsl-lite)
|
if(NOT TARGET gsl::gsl-lite)
|
||||||
find_package(gsl-lite CONFIG REQUIRED)
|
find_package(gsl-lite REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||||
|
@@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 3.19)
|
|||||||
|
|
||||||
# find dependencies
|
# find dependencies
|
||||||
if(NOT TARGET gsl::gsl-lite)
|
if(NOT TARGET gsl::gsl-lite)
|
||||||
find_package(gsl-lite CONFIG REQUIRED)
|
find_package(gsl-lite REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# core library definition
|
# core library definition
|
||||||
@@ -83,7 +83,7 @@ target_compile_definitions(
|
|||||||
|
|
||||||
if(${projectPrefix}USE_LIBFMT)
|
if(${projectPrefix}USE_LIBFMT)
|
||||||
if(NOT TARGET fmt::fmt)
|
if(NOT TARGET fmt::fmt)
|
||||||
find_package(fmt CONFIG REQUIRED)
|
find_package(fmt REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(mp-units-core ${${projectPrefix}TARGET_SCOPE} fmt::fmt)
|
target_link_libraries(mp-units-core ${${projectPrefix}TARGET_SCOPE} fmt::fmt)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
find_package(Catch2 3 CONFIG REQUIRED)
|
find_package(Catch2 3 REQUIRED)
|
||||||
|
|
||||||
add_executable(unit_tests_runtime distribution_test.cpp fmt_test.cpp math_test.cpp)
|
add_executable(unit_tests_runtime distribution_test.cpp fmt_test.cpp math_test.cpp)
|
||||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||||
@@ -31,7 +31,7 @@ endif()
|
|||||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::mp-units Catch2::Catch2WithMain)
|
target_link_libraries(unit_tests_runtime PRIVATE mp-units::mp-units Catch2::Catch2WithMain)
|
||||||
|
|
||||||
if(${projectPrefix}BUILD_LA)
|
if(${projectPrefix}BUILD_LA)
|
||||||
find_package(wg21_linear_algebra CONFIG REQUIRED)
|
find_package(wg21_linear_algebra REQUIRED)
|
||||||
target_sources(unit_tests_runtime PRIVATE linear_algebra_test.cpp)
|
target_sources(unit_tests_runtime PRIVATE linear_algebra_test.cpp)
|
||||||
target_link_libraries(unit_tests_runtime PRIVATE wg21_linear_algebra::wg21_linear_algebra)
|
target_link_libraries(unit_tests_runtime PRIVATE wg21_linear_algebra::wg21_linear_algebra)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
project(test_package LANGUAGES CXX)
|
project(test_package LANGUAGES CXX)
|
||||||
|
|
||||||
find_package(mp-units CONFIG REQUIRED)
|
find_package(mp-units REQUIRED)
|
||||||
|
|
||||||
add_executable(test_package test_package.cpp)
|
add_executable(test_package test_package.cpp)
|
||||||
target_link_libraries(test_package PRIVATE mp-units::mp-units)
|
target_link_libraries(test_package PRIVATE mp-units::mp-units)
|
||||||
|
Reference in New Issue
Block a user