Repository: conan-io/conan-center-index

Issue:
[request] cpp-taskflow/2.5.0
### Package Details
  * Package Name/Version: **cpp-taskflow/2.5.0**
  * Changelog: **https://taskflow.github.io/taskflow/release-2-5-0.html**


Please note that `cpp-taskflow` is renamed to `taskflow`. So new recipe shall be created.

P.S. Can you tell me please, why recipes is not updated automatically, when new library version is released? Lask of automation? Will it be fixed in future conan center pipeline?



Discussion:
Requesting an update for every outdated library is a little bit annoying :)
I know, we have the idea of adding a bot doing it in the future.

Resolving patch:
diff --git a/recipes/taskflow/all/conanfile.py b/recipes/taskflow/all/conanfile.py
--- a/recipes/taskflow/all/conanfile.py
+++ b/recipes/taskflow/all/conanfile.py
@@ -1,8 +1,7 @@
-from conans import ConanFile, tools
-from conans.errors import ConanInvalidConfiguration
-from conans.model.version import Version
 import os
 
+from conans import ConanFile, tools
+from conans.errors import ConanInvalidConfiguration
 
 class TaskflowConan(ConanFile):
     name = "taskflow"
@@ -16,43 +15,41 @@ class TaskflowConan(ConanFile):
 
     settings = "os", "compiler"
 
-    _source_subfolder = "source_subfolder"
+    @property
+    def _source_subfolder(self):
+        return "source_subfolder"
 
     def configure(self):
-        compiler = str(self.settings.compiler)
-        compiler_version = tools.Version(self.settings.compiler.version)
-        min_req_cppstd = "17" if tools.Version(self.version) <= "2.2.0" else "14"
+        minimal_cpp_standard = "17" if tools.Version(self.version) <= "2.2.0" else "14"
 
         if self.settings.compiler.cppstd:
-            tools.check_min_cppstd(self, min_req_cppstd)
-        else:
-            self.output.warn("%s recipe lacks information about the %s compiler"
-                             " standard version support" % (self.name, compiler))
+            tools.check_min_cppstd(self, minimal_cpp_standard)
 
         minimal_version = {
-            "17" : {
+            "17": {
                 "Visual Studio": "16",
                 "gcc": "7.3",
                 "clang": "6.0",
                 "apple-clang": "10.0"
             },
-            "14" : {
+            "14": {
                 "Visual Studio": "15",
                 "gcc": "5",
                 "clang": "4.0",
                 "apple-clang": "8.0"
             }
-        }
+        }[minimal_cpp_standard]
 
-        if compiler not in minimal_version[min_req_cppstd]:
-            self.output.info("%s requires a compiler that supports at least C++%s" % (self.name, min_req_cppstd))
+        compiler = str(self.settings.compiler)
+        if compiler not in minimal_version:
+            self.output.warn(
+                "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler))
+            self.output.warn(
+                "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard))
             return
-
-        # Exclude compilers not supported by taskflow
-        if compiler_version < minimal_version[min_req_cppstd][compiler]:
-            raise ConanInvalidConfiguration("%s requires a compiler that supports"
-                                            " at least C++%s. %s %s is not"
-                                            " supported." % (self.name, min_req_cppstd, compiler, Version(self.settings.compiler.version.value)))
+        version = tools.Version(self.settings.compiler.version)
+        if version < minimal_version[compiler]:
+            raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard))
 
     def source(self):
         tools.get(**self.conan_data["sources"][self.version])
@@ -61,7 +58,7 @@ def source(self):
 
     def package(self):
         self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
-        self.copy(pattern="*", dst="include/taskflow", src=os.path.join(self._source_subfolder, "taskflow"))
+        self.copy(pattern="*", dst=os.path.join("include", "taskflow"), src=os.path.join(self._source_subfolder, "taskflow"))
 
     def package_id(self):
         self.info.header_only()
@@ -71,4 +68,5 @@ def package_info(self):
             self.cpp_info.system_libs.append("pthread")
         if self.settings.compiler == "Visual Studio":
             self.cpp_info.defines.append("_ENABLE_EXTENDED_ALIGNED_STORAGE")
-
+        self.cpp_info.names["cmake_find_package"] = "Taskflow"
+        self.cpp_info.names["cmake_find_package_multi"] = "Taskflow"


Test patch:
diff --git a/recipes/taskflow/all/test_package/CMakeLists.txt b/recipes/taskflow/all/test_package/CMakeLists.txt
--- a/recipes/taskflow/all/test_package/CMakeLists.txt
+++ b/recipes/taskflow/all/test_package/CMakeLists.txt
@@ -4,11 +4,13 @@ project(test_package)
 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
 conan_basic_setup()
 
-set(TASKFLOW_CXX_STANDARD 14)
-if (TASKFLOW_VERSION LESS_EQUAL "2.2.0")
-    set(TASKFLOW_CXX_STANDARD 17)
+find_package(Taskflow REQUIRED)
+
+set(_CXX_STANDARD 14)
+if (Taskflow_VERSION LESS_EQUAL "2.2.0")
+    set(_CXX_STANDARD 17)
 endif()
 
 add_executable(${PROJECT_NAME} test_package.cpp)
-target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
-set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD ${TASKFLOW_CXX_STANDARD})
+set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD ${_CXX_STANDARD})
+target_link_libraries(${PROJECT_NAME} Taskflow::Taskflow)
diff --git a/recipes/taskflow/all/test_package/conanfile.py b/recipes/taskflow/all/test_package/conanfile.py
--- a/recipes/taskflow/all/test_package/conanfile.py
+++ b/recipes/taskflow/all/test_package/conanfile.py
@@ -1,16 +1,14 @@
-# -*- coding: utf-8 -*-
-
-from conans import ConanFile, CMake, tools
 import os
 
+from conans import ConanFile, tools, CMake
+
 
 class TestPackageConan(ConanFile):
     settings = "os", "compiler", "build_type", "arch"
-    generators = "cmake"
+    generators = "cmake", "cmake_find_package"
 
     def build(self):
         cmake = CMake(self)
-        cmake.definitions["TASKFLOW_VERSION"] = self.deps_cpp_info["taskflow"].version
         cmake.configure()
         cmake.build()