We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[pagmo2] pagmo2/2.10: does not link eigen and nlopt properly when setting options to True
<!-- 
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.
-->

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **pagmo2/2.10**
  * Operating System+version: **Linux Ubuntu 18.04**
  * Compiler+version: **GCC 7**
  * Conan version: **conan 1.46.2**
  * Python version: **Python 3.6.9**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
Configuration for profile default:

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch.march=None
arch_build=x86_64
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++11
build_type=Release
[options]
[conf]
[build_requires]
[env]
```


### Steps to reproduce (Include if Applicable)
1) create package with options `-o pagmo2:with_eigen=True` and `-o pagmo2:with_nlopt=True` (it will be created without errors)
2) In another project include `pagmo2/2.10` as requirement and include a header like `<pagmo/algorithms/xnes.hpp>`

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
Put your log output here
```

</details>


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `recipes/pagmo2/pre_2.11/conanfile.py`
Content:
```
1 from conans import ConanFile, CMake, tools
2 from conans.errors import ConanInvalidConfiguration
3 import os
4 
5 required_conan_version = ">=1.43.0"
6 
7 
8 class Pagmo2Conan(ConanFile):
9     name = "pagmo2"
10     description = "pagmo is a C++ scientific library for massively parallel optimization."
11     license = ("LGPL-3.0-or-later", "GPL-3.0-or-later")
12     topics = ("pagmo", "optimization", "parallel-computing", "genetic-algorithm", "metaheuristics")
13     homepage = "https://esa.github.io/pagmo2"
14     url = "https://github.com/conan-io/conan-center-index"
15 
16     settings = "os", "arch", "compiler", "build_type"
17     options = {
18         "with_eigen": [True, False],
19         "with_nlopt": [True, False],
20         "with_ipopt": [True, False],
21     }
22     default_options = {
23         "with_eigen": False,
24         "with_nlopt": False,
25         "with_ipopt": False,
26     }
27 
28     generators = "cmake", "cmake_find_package", "cmake_find_package_multi"
29     _cmake = None
30 
31     @property
32     def _source_subfolder(self):
33         return "source_subfolder"
34 
35     def export_sources(self):
36         self.copy("CMakeLists.txt")
37         for patch in self.conan_data.get("patches", {}).get(self.version, []):
38             self.copy(patch["patch_file"])
39 
40     def requirements(self):
41         self.requires("boost/1.78.0")
42         self.requires("onetbb/2020.3")
43         if self.options.with_eigen:
44             self.requires("eigen/3.4.0")
45         if self.options.with_nlopt:
46             self.requires("nlopt/2.7.1")
47 
48     @property
49     def _required_boost_components(self):
50         return ["serialization"]
51 
52     def validate(self):
53         if self.settings.compiler.get_safe("cppstd"):
54             tools.check_min_cppstd(self, 11)
55         # TODO: add ipopt support
56         if self.options.with_ipopt:
57             raise ConanInvalidConfiguration("ipopt recipe not available yet in CCI")
58 
59         miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components)
60         if self.options["boost"].header_only or miss_boost_required_comp:
61             raise ConanInvalidConfiguration("{0} requires non header-only boost with these components: {1}".format(self.name, ", ".join(self._required_boost_components)))
62 
63     def package_id(self):
64         self.info.header_only()
65 
66     def source(self):
67         tools.get(**self.conan_data["sources"][self.version],
68                   destination=self._source_subfolder, strip_root=True)
69 
70     def _configure_cmake(self):
71         if self._cmake:
72             return self._cmake
73         self._cmake = CMake(self)
74         self._cmake.definitions["PAGMO_BUILD_TESTS"] = False
75         self._cmake.definitions["PAGMO_BUILD_TUTORIALS"] = False
76         self._cmake.definitions["PAGMO_WITH_EIGEN3"] = self.options.with_eigen
77         self._cmake.definitions["PAGMO_WITH_NLOPT"] = self.options.with_nlopt
78         self._cmake.definitions["PAGMO_WITH_IPOPT"] = self.options.with_ipopt
79         self._cmake.configure()
80         return self._cmake
81 
82     def build(self):
83         for patch in self.conan_data.get("patches", {}).get(self.version, []):
84             tools.patch(**patch)
85 
86     def package(self):
87         self.copy(pattern="COPYING.*", dst="licenses", src=self._source_subfolder)
88         cmake = self._configure_cmake()
89         cmake.install()
90         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
91 
92     def package_info(self):
93         self.cpp_info.set_property("cmake_file_name", "pagmo")
94         self.cpp_info.set_property("cmake_target_name", "Pagmo::pagmo")
95         # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed
96         self.cpp_info.components["_pagmo"].requires = ["boost::headers", "boost::serialization", "onetbb::onetbb"]
97         if self.options.with_eigen:
98             self.cpp_info.components["_pagmo"].requires.append("eigen::eigen")
99         if self.options.with_nlopt:
100             self.cpp_info.components["_pagmo"].requires.append("nlopt::nlopt")
101         if self.settings.os in ["Linux", "FreeBSD"]:
102             self.cpp_info.components["_pagmo"].system_libs.append("pthread")
103 
104         # TODO: to remove in conan v2 once cmake_find_package_* generators removed
105         self.cpp_info.filenames["cmake_find_package"] = "pagmo"
106         self.cpp_info.filenames["cmake_find_package_multi"] = "pagmo"
107         self.cpp_info.names["cmake_find_package"] = "Pagmo"
108         self.cpp_info.names["cmake_find_package_multi"] = "Pagmo"
109         self.cpp_info.components["_pagmo"].names["cmake_find_package"] = "pagmo"
110         self.cpp_info.components["_pagmo"].names["cmake_find_package_multi"] = "pagmo"
111         self.cpp_info.components["_pagmo"].set_property("cmake_target_name", "Pagmo::pagmo")
112
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/recipes/pagmo2/pre_2.11/conanfile.py b/recipes/pagmo2/pre_2.11/conanfile.py
--- a/recipes/pagmo2/pre_2.11/conanfile.py
+++ b/recipes/pagmo2/pre_2.11/conanfile.py
@@ -61,7 +61,7 @@
             raise ConanInvalidConfiguration("{0} requires non header-only boost with these components: {1}".format(self.name, ", ".join(self._required_boost_components)))
 
     def package_id(self):
-        self.info.header_only()
+        self.info.settings.clear()
 
     def source(self):
         tools.get(**self.conan_data["sources"][self.version],

{"golden_diff": "diff --git a/recipes/pagmo2/pre_2.11/conanfile.py b/recipes/pagmo2/pre_2.11/conanfile.py\n--- a/recipes/pagmo2/pre_2.11/conanfile.py\n+++ b/recipes/pagmo2/pre_2.11/conanfile.py\n@@ -61,7 +61,7 @@\n             raise ConanInvalidConfiguration(\"{0} requires non header-only boost with these components: {1}\".format(self.name, \", \".join(self._required_boost_components)))\n \n     def package_id(self):\n-        self.info.header_only()\n+        self.info.settings.clear()\n \n     def source(self):\n         tools.get(**self.conan_data[\"sources\"][self.version],\n", "issue": "[pagmo2] pagmo2/2.10: does not link eigen and nlopt properly when setting options to True\n<!-- \r\n  Please don't forget to update the issue title.\r\n  Include all applicable information to help us reproduce your problem.\r\n-->\r\n\r\n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **pagmo2/2.10**\r\n  * Operating System+version: **Linux Ubuntu 18.04**\r\n  * Compiler+version: **GCC 7**\r\n  * Conan version: **conan 1.46.2**\r\n  * Python version: **Python 3.6.9**\r\n\r\n\r\n### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)\r\n```\r\nConfiguration for profile default:\r\n\r\n[settings]\r\nos=Linux\r\nos_build=Linux\r\narch=x86_64\r\narch.march=None\r\narch_build=x86_64\r\ncompiler=gcc\r\ncompiler.version=7\r\ncompiler.libcxx=libstdc++11\r\nbuild_type=Release\r\n[options]\r\n[conf]\r\n[build_requires]\r\n[env]\r\n```\r\n\r\n\r\n### Steps to reproduce (Include if Applicable)\r\n1) create package with options `-o pagmo2:with_eigen=True` and `-o pagmo2:with_nlopt=True` (it will be created without errors)\r\n2) In another project include `pagmo2/2.10` as requirement and include a header like `<pagmo/algorithms/xnes.hpp>`\r\n\r\n### Logs (Include/Attach if Applicable)\r\n<details><summary>Click to expand log</summary>\r\n\r\n```\r\nPut your log output here\r\n```\r\n\r\n</details>\r\n\n", "before_files": [{"content": "from conans import ConanFile, CMake, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os\n\nrequired_conan_version = \">=1.43.0\"\n\n\nclass Pagmo2Conan(ConanFile):\n    name = \"pagmo2\"\n    description = \"pagmo is a C++ scientific library for massively parallel optimization.\"\n    license = (\"LGPL-3.0-or-later\", \"GPL-3.0-or-later\")\n    topics = (\"pagmo\", \"optimization\", \"parallel-computing\", \"genetic-algorithm\", \"metaheuristics\")\n    homepage = \"https://esa.github.io/pagmo2\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"with_eigen\": [True, False],\n        \"with_nlopt\": [True, False],\n        \"with_ipopt\": [True, False],\n    }\n    default_options = {\n        \"with_eigen\": False,\n        \"with_nlopt\": False,\n        \"with_ipopt\": False,\n    }\n\n    generators = \"cmake\", \"cmake_find_package\", \"cmake_find_package_multi\"\n    _cmake = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    def export_sources(self):\n        self.copy(\"CMakeLists.txt\")\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            self.copy(patch[\"patch_file\"])\n\n    def requirements(self):\n        self.requires(\"boost/1.78.0\")\n        self.requires(\"onetbb/2020.3\")\n        if self.options.with_eigen:\n            self.requires(\"eigen/3.4.0\")\n        if self.options.with_nlopt:\n            self.requires(\"nlopt/2.7.1\")\n\n    @property\n    def _required_boost_components(self):\n        return [\"serialization\"]\n\n    def validate(self):\n        if self.settings.compiler.get_safe(\"cppstd\"):\n            tools.check_min_cppstd(self, 11)\n        # TODO: add ipopt support\n        if self.options.with_ipopt:\n            raise ConanInvalidConfiguration(\"ipopt recipe not available yet in CCI\")\n\n        miss_boost_required_comp = any(getattr(self.options[\"boost\"], \"without_{}\".format(boost_comp), True) for boost_comp in self._required_boost_components)\n        if self.options[\"boost\"].header_only or miss_boost_required_comp:\n            raise ConanInvalidConfiguration(\"{0} requires non header-only boost with these components: {1}\".format(self.name, \", \".join(self._required_boost_components)))\n\n    def package_id(self):\n        self.info.header_only()\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version],\n                  destination=self._source_subfolder, strip_root=True)\n\n    def _configure_cmake(self):\n        if self._cmake:\n            return self._cmake\n        self._cmake = CMake(self)\n        self._cmake.definitions[\"PAGMO_BUILD_TESTS\"] = False\n        self._cmake.definitions[\"PAGMO_BUILD_TUTORIALS\"] = False\n        self._cmake.definitions[\"PAGMO_WITH_EIGEN3\"] = self.options.with_eigen\n        self._cmake.definitions[\"PAGMO_WITH_NLOPT\"] = self.options.with_nlopt\n        self._cmake.definitions[\"PAGMO_WITH_IPOPT\"] = self.options.with_ipopt\n        self._cmake.configure()\n        return self._cmake\n\n    def build(self):\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            tools.patch(**patch)\n\n    def package(self):\n        self.copy(pattern=\"COPYING.*\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n\n    def package_info(self):\n        self.cpp_info.set_property(\"cmake_file_name\", \"pagmo\")\n        self.cpp_info.set_property(\"cmake_target_name\", \"Pagmo::pagmo\")\n        # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed\n        self.cpp_info.components[\"_pagmo\"].requires = [\"boost::headers\", \"boost::serialization\", \"onetbb::onetbb\"]\n        if self.options.with_eigen:\n            self.cpp_info.components[\"_pagmo\"].requires.append(\"eigen::eigen\")\n        if self.options.with_nlopt:\n            self.cpp_info.components[\"_pagmo\"].requires.append(\"nlopt::nlopt\")\n        if self.settings.os in [\"Linux\", \"FreeBSD\"]:\n            self.cpp_info.components[\"_pagmo\"].system_libs.append(\"pthread\")\n\n        # TODO: to remove in conan v2 once cmake_find_package_* generators removed\n        self.cpp_info.filenames[\"cmake_find_package\"] = \"pagmo\"\n        self.cpp_info.filenames[\"cmake_find_package_multi\"] = \"pagmo\"\n        self.cpp_info.names[\"cmake_find_package\"] = \"Pagmo\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"Pagmo\"\n        self.cpp_info.components[\"_pagmo\"].names[\"cmake_find_package\"] = \"pagmo\"\n        self.cpp_info.components[\"_pagmo\"].names[\"cmake_find_package_multi\"] = \"pagmo\"\n        self.cpp_info.components[\"_pagmo\"].set_property(\"cmake_target_name\", \"Pagmo::pagmo\")\n", "path": "recipes/pagmo2/pre_2.11/conanfile.py"}], "after_files": [{"content": "from conans import ConanFile, CMake, tools\nfrom conans.errors import ConanInvalidConfiguration\nimport os\n\nrequired_conan_version = \">=1.43.0\"\n\n\nclass Pagmo2Conan(ConanFile):\n    name = \"pagmo2\"\n    description = \"pagmo is a C++ scientific library for massively parallel optimization.\"\n    license = (\"LGPL-3.0-or-later\", \"GPL-3.0-or-later\")\n    topics = (\"pagmo\", \"optimization\", \"parallel-computing\", \"genetic-algorithm\", \"metaheuristics\")\n    homepage = \"https://esa.github.io/pagmo2\"\n    url = \"https://github.com/conan-io/conan-center-index\"\n\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"with_eigen\": [True, False],\n        \"with_nlopt\": [True, False],\n        \"with_ipopt\": [True, False],\n    }\n    default_options = {\n        \"with_eigen\": False,\n        \"with_nlopt\": False,\n        \"with_ipopt\": False,\n    }\n\n    generators = \"cmake\", \"cmake_find_package\", \"cmake_find_package_multi\"\n    _cmake = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    def export_sources(self):\n        self.copy(\"CMakeLists.txt\")\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            self.copy(patch[\"patch_file\"])\n\n    def requirements(self):\n        self.requires(\"boost/1.78.0\")\n        self.requires(\"onetbb/2020.3\")\n        if self.options.with_eigen:\n            self.requires(\"eigen/3.4.0\")\n        if self.options.with_nlopt:\n            self.requires(\"nlopt/2.7.1\")\n\n    @property\n    def _required_boost_components(self):\n        return [\"serialization\"]\n\n    def validate(self):\n        if self.settings.compiler.get_safe(\"cppstd\"):\n            tools.check_min_cppstd(self, 11)\n        # TODO: add ipopt support\n        if self.options.with_ipopt:\n            raise ConanInvalidConfiguration(\"ipopt recipe not available yet in CCI\")\n\n        miss_boost_required_comp = any(getattr(self.options[\"boost\"], \"without_{}\".format(boost_comp), True) for boost_comp in self._required_boost_components)\n        if self.options[\"boost\"].header_only or miss_boost_required_comp:\n            raise ConanInvalidConfiguration(\"{0} requires non header-only boost with these components: {1}\".format(self.name, \", \".join(self._required_boost_components)))\n\n    def package_id(self):\n        self.info.settings.clear()\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version],\n                  destination=self._source_subfolder, strip_root=True)\n\n    def _configure_cmake(self):\n        if self._cmake:\n            return self._cmake\n        self._cmake = CMake(self)\n        self._cmake.definitions[\"PAGMO_BUILD_TESTS\"] = False\n        self._cmake.definitions[\"PAGMO_BUILD_TUTORIALS\"] = False\n        self._cmake.definitions[\"PAGMO_WITH_EIGEN3\"] = self.options.with_eigen\n        self._cmake.definitions[\"PAGMO_WITH_NLOPT\"] = self.options.with_nlopt\n        self._cmake.definitions[\"PAGMO_WITH_IPOPT\"] = self.options.with_ipopt\n        self._cmake.configure()\n        return self._cmake\n\n    def build(self):\n        for patch in self.conan_data.get(\"patches\", {}).get(self.version, []):\n            tools.patch(**patch)\n\n    def package(self):\n        self.copy(pattern=\"COPYING.*\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n\n    def package_info(self):\n        self.cpp_info.set_property(\"cmake_file_name\", \"pagmo\")\n        self.cpp_info.set_property(\"cmake_target_name\", \"Pagmo::pagmo\")\n        # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed\n        self.cpp_info.components[\"_pagmo\"].requires = [\"boost::headers\", \"boost::serialization\", \"onetbb::onetbb\"]\n        if self.options.with_eigen:\n            self.cpp_info.components[\"_pagmo\"].requires.append(\"eigen::eigen\")\n        if self.options.with_nlopt:\n            self.cpp_info.components[\"_pagmo\"].requires.append(\"nlopt::nlopt\")\n        if self.settings.os in [\"Linux\", \"FreeBSD\"]:\n            self.cpp_info.components[\"_pagmo\"].system_libs.append(\"pthread\")\n\n        # TODO: to remove in conan v2 once cmake_find_package_* generators removed\n        self.cpp_info.filenames[\"cmake_find_package\"] = \"pagmo\"\n        self.cpp_info.filenames[\"cmake_find_package_multi\"] = \"pagmo\"\n        self.cpp_info.names[\"cmake_find_package\"] = \"Pagmo\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"Pagmo\"\n        self.cpp_info.components[\"_pagmo\"].names[\"cmake_find_package\"] = \"pagmo\"\n        self.cpp_info.components[\"_pagmo\"].names[\"cmake_find_package_multi\"] = \"pagmo\"\n        self.cpp_info.components[\"_pagmo\"].set_property(\"cmake_target_name\", \"Pagmo::pagmo\")\n", "path": "recipes/pagmo2/pre_2.11/conanfile.py"}]}