Repository: conan-io/conan-center-index

Issue:
[package] sqlpp11/0.58: Exported CMake config name
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **sqlpp11/0.58**
  * Operating System+version: **Fedora 32**
  * Compiler+version: **GCC 10**
  * Docker image: **conanio/gcc8**
  * Conan version: **conan 1.24.1**
  * Python version: **Python 3.8.2**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=clang
compiler.version=10
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]

```


### Steps to reproduce (Include if Applicable)

Seems like recipe exports library name with wrong case. Upstream exports `Sqlpp11Config.cmake`, but the recipe exports `sqlpp11Config.cmake`. That affects my `sqlpp11-postgresql-connector`, which relies on `sqlpp11`.

Please synchronize library name with the upstream. Thank you.

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
CMake Error at CMakeLists.txt:41 (find_package):
  By not providing "FindSqlpp11.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Sqlpp11", but
  CMake did not find one.

  Could not find a package configuration file provided by "Sqlpp11" with any
  of the following names:

    Sqlpp11Config.cmake
    sqlpp11-config.cmake

  Add the installation prefix of "Sqlpp11" to CMAKE_PREFIX_PATH or set
  "Sqlpp11_DIR" to a directory containing one of the above files.  If
  "Sqlpp11" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
```

</details>



Discussion:
Probably the following lines are missed:
```
self.cpp_info.names["cmake_find_package"] = "Sqlpp11"
self.cpp_info.names["cmake_find_package_multi"] = "Sqlpp11"
```
@ZaMaZaN4iK Thanks for reporting, I'll provide a fix ASAP
Hi! I can see the `find_package` in the CMakeLists, but I cannot see where it is used (https://github.com/matthijs/sqlpp11-connector-postgresql/search?l=CMake&q=Sqlpp11%3A%3ASqlpp11) if not for the transitive dependency in a `.cmake` file we won't package in Conan Center...

I still need to know which one is the preferred casing for the target itself. I find `sqlpp11::sqlpp11` as the target generated by Sqlpp11 itself. We cannot change these names without changing the target too 😕 

Resolving patch:
diff --git a/recipes/sqlpp11/all/conanfile.py b/recipes/sqlpp11/all/conanfile.py
--- a/recipes/sqlpp11/all/conanfile.py
+++ b/recipes/sqlpp11/all/conanfile.py
@@ -10,7 +10,10 @@ class Sqlpp11Conan(ConanFile):
     description = "A type safe SQL template library for C++"
     topics = ("SQL", "DSL", "embedded", "data-base")
     no_copy_source = True
-    _source_subfolder = "source_subfolder"
+
+    @property
+    def _source_subfolder(self):
+        return "source_subfolder"
 
     def requirements(self):
         self.requires("date/2.4.1")
@@ -21,8 +24,12 @@ def source(self):
         os.rename(extracted_dir, self._source_subfolder)
 
     def package(self):
-        self.copy("*LICENSE", dst="licenses", keep_path=False)
-        self.copy("include/*", src=self._source_subfolder)
+        self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
+        self.copy("*.h", dst="include", src=os.path.join(self._source_subfolder, "include"))
 
     def package_id(self):
         self.info.header_only()
+
+    def package_info(self):
+        self.cpp_info.filenames["cmake_find_package"] = "Sqlpp11"
+        self.cpp_info.filenames["cmake_find_package_multi"] = "Sqlpp11"


Test patch:
diff --git a/recipes/sqlpp11/all/test_package/CMakeLists.txt b/recipes/sqlpp11/all/test_package/CMakeLists.txt
--- a/recipes/sqlpp11/all/test_package/CMakeLists.txt
+++ b/recipes/sqlpp11/all/test_package/CMakeLists.txt
@@ -1,10 +1,11 @@
 cmake_minimum_required(VERSION 3.1)
-
-project(PackageTest)
+project(PackageTest CXX)
 
 include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
 conan_basic_setup(TARGETS)
 
+find_package(Sqlpp11 CONFIG REQUIRED)
+
 add_executable(example example.cpp)
 set_property(TARGET example PROPERTY CXX_STANDARD 11)
-target_link_libraries(example CONAN_PKG::sqlpp11)
+target_link_libraries(example sqlpp11::sqlpp11)
diff --git a/recipes/sqlpp11/all/test_package/conanfile.py b/recipes/sqlpp11/all/test_package/conanfile.py
--- a/recipes/sqlpp11/all/test_package/conanfile.py
+++ b/recipes/sqlpp11/all/test_package/conanfile.py
@@ -4,7 +4,7 @@
 
 class Sqlpp11TestConan(ConanFile):
     settings = "os", "compiler", "build_type", "arch"
-    generators = "cmake"
+    generators = "cmake", "cmake_find_package_multi"
 
     def build(self):
         cmake = CMake(self)