Use "Soci::" rather than "SOCI::" as the prefix, for consistency with
the other CMake variables defined by FindSoci.cmake.
Do not use "soci_" prefix for the library names which is completely
redundant with the other prefix, writing "Soci::soci_" is clearly
redundant.
See #982.
This allows targets to be used the same way when included as a subdirectory
as when using find_package (when using as a subdirectory, the existing
non-namespace usage still works too).
Using just target_link_libraries() is sufficient, so update the comment
about (not) using target_include_directories() in the example
CMakeLists.txt and also mention this in the installation instructions.
This shows both how to use SOCI API and, more importantly, how to build
a project using SOCI with CMake.
Note that CMake support is currently far from ideal:
- There is no way to get the compiler definitions and header directories
needed to include the SOCI headers.
- There is no way to determine if SOCI was built as static or shared
libraries or both and choose which ones to use.
- There is no way to check if a required backend is available.
- There is no way to get all the available backend libraries.
Ideally all of the above should be implemented, but for now this example
at least provides a testbed.