Open danny-mhlv opened 5 months ago
Sorry, I don't understand how exactly does this differ from building SOCI directly which definitely does work. CMake is not my strong point (and I'm being euphemistic here), so it's quite possible that there is a bug in SOCI CMakefiles but I have no idea why would it happen only when it's included as a subdirectory, would you?
This will be (or should be at least) resolved via #1118
Issue with CMake
Setup:
OS: Ubuntu 22.04.3 LTS
,Compiler: Clang 15.0.7 x86_64
,C++ standard: c++20
,CMake version: 3.28.1
.I've just started using SOCI for my project and encountered an odd error:
As follows from the error - I am using PostgreSQL. Seems like main header of
libpq++
is not included.I'm going
add_subdirectory(...)
route in my project (I'm usinggit-submodules
) and building a shared library version of SOCI (SOCI_SHARED
set toON
). Before using SOCI I've read the documentation and checked out the examples. Nothing helped. Then I've started debugging CMake and figured out something.In
soci/cmake/SociBackend.cmake
file:No include directories are provided for target (soci_postgresql in my case). Considering this - I've added:
I do understand, that I can as well include PostgreSQL's headers directly to my target, but wouldn't it be more convenient to include
libpq-fe.h
in SOCI (file:SociBackend.cmake
), when initializing PostgreSQL's backend, considering it is already successfully locates said headers? Am I missing something?For better understanding I've provided a minimal reproduction repository.
Thank you in advance.