Skip to content

Commit 1c82445

Browse files
committed
build: update the recipe for the new conan-centre recipes
* Use `cmake_find_paths` generator * Use catch2 rather than the old package
1 parent aa90d35 commit 1c82445

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.13)
22
project(SemVer VERSION 0.1.0)
33

4-
message(STATUS "prefix path: ${CMAKE_PREFIX_PATH}")
4+
set(CMAKE_MODULE_PATH "${PROJECT_BINARY_DIR};${CMAKE_MODULE_PATH}")
55

66
configure_file(include/SemVer/VersionNumbers.h.in include/SemVer/VersionNumbers.h)
77
add_library(SemVer)
@@ -24,6 +24,7 @@ option(ENABLE_UNITTESTS_IN_BUILD "Build and run the unit tests as part of the bu
2424
if (ENABLE_UNITTESTS)
2525
find_package(Catch2 REQUIRED)
2626
add_library(CatchTestMain OBJECT src/CatchTestMain.cpp)
27+
target_compile_features(CatchTestMain PUBLIC cxx_std_14)
2728
target_link_libraries(CatchTestMain PUBLIC Catch2::Catch2)
2829

2930
if (ENABLE_UNITTESTS_IN_BUILD)

conanfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class SemVer(ConanFile):
1818
version = _get_version()
1919
license = "General Public License 2.0"
2020

21-
generators = "cmake_paths"
21+
generators = "cmake_find_package"
2222
settings = "os", "arch", "compiler", "build_type"
23-
build_requires = "Catch2/[^2.6.0]@catchorg/stable"
23+
build_requires = "catch2/[^2.6.0]"
2424

2525
options = {
2626
"shared": [True, False],

src/VersionRange.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ namespace SemVer {
9696
pos != std::string::npos;
9797
lp = pos + delim.size(), pos = str.find(delim, lp)
9898
) {
99-
std::string const part = str.substr(lp, pos - lp);
99+
auto const part = str.substr(lp, pos - lp);
100100
result.push_back(part);
101101
}
102102
result.push_back(str.substr(lp));

0 commit comments

Comments
 (0)