Repository: conan-io/conan-center-index

Issue:
[package] poco/1.10.1: Options not available / not correctly parsed
### Package and Environment Details
  * Package Name/Version: **poco/1.10.1**
  * Operating System+version: **Windows 10 64-bit**
  * Compiler+version: **Visual Studio 15**
  * Conan version: **conan 1.22.2**
  * Python version: **Python 3.7.1**

---

I'm currently setting up a Poco-example project with Conan and I'm basically disabling every option (project only relies on Poco::Foundation).
However, when I use a list of options to disable, which also includes
- `poco:enable_encodings=False`
- `poco:enable_jwt=False`

I get the errors:
```
ERROR: poco/1.10.1: 'options.enable_encodings' doesn't exist
```
or
```
ERROR: poco/1.10.1: 'options.enable_jwt' doesn't exist
```

Looking at the `conanfile.py` that totally makes sense since these options are not available. **Why is that?**

However, If I use upper case options
- `Poco:enable_encodings=False`
- `Poco:enable_jwt=False`

I don't get any error; all options that can be disabled are disabled after build and encodings and jwt (as well as depending libraries) are created.

So I guess if `poco` was written in lower case some kind of "option-check" is performed before building Poco. If `Poco` was written in upper case the check is not performed but the options are correctly sent to Conan.

Additionally I tested this by adding arbitrary options
- `poco:enable_foobar=False`
- `Poco:enable_foobar=False`

Both did not make any difference in detecting unsupported options.

I think it would make sense to inform a user 
- if upper case namespace options are not available (`Poco:enable_encodings=False`)
- if upper case / lower case options are not available at all (`poco:enable_foobar=False`)


Discussion:
Hi @akalali !

Where did you find `enable_encodings` and `enable_jwt`. Is there a link for that reference (docs, code, tutorial, ...)

Both these options are not part of Poco package. Even Poco project doesn't use them.
https://github.com/pocoproject/poco/blob/master/CMakeLists.txt#L160
and e.g.
https://github.com/pocoproject/poco/blob/master/CMakeLists.txt#L92

Also https://pocoproject.org/docs/00200-GettingStarted.html#9
I see, what you want is including both options to Poco package. Fair enough.
That is the first part of my question. I would have opened a PR (if this is your preferred workflow) but I wasn't sure if there might be a reason not to include these options.

Second part of the question is about the parsing of the options with regards to lower case / upper case.

Resolving patch:
diff --git a/recipes/poco/all/conanfile.py b/recipes/poco/all/conanfile.py
--- a/recipes/poco/all/conanfile.py
+++ b/recipes/poco/all/conanfile.py
@@ -31,6 +31,8 @@ class PocoConan(ConanFile):
                "enable_data_sqlite": [True, False],
                "enable_data_mysql": [True, False],
                "enable_data_odbc": [True, False],
+               "enable_encodings": [True, False],
+               "enable_jwt": [True, False],
                "enable_sevenzip": [True, False],
                "enable_zip": [True, False],
                "enable_apacheconnector": [True, False],
@@ -60,6 +62,8 @@ class PocoConan(ConanFile):
                 "enable_data_sqlite": True,
                 "enable_data_mysql": False,
                 "enable_data_odbc": False,
+                "enable_encodings": True,
+                "enable_jwt": True,
                 "enable_sevenzip": False,
                 "enable_zip": True,
                 "enable_apacheconnector": False,
@@ -101,7 +105,8 @@ def requirements(self):
         if self.options.enable_netssl or \
            self.options.enable_netssl_win or \
            self.options.enable_crypto or \
-           self.options.force_openssl:
+           self.options.force_openssl or \
+           self.options.enable_jwt:
             self.requires.add("openssl/1.0.2t")
 
     def _patch(self):


Test patch: