taocpp / taopq

C++ client library for PostgreSQL
Boost Software License 1.0
265 stars 40 forks source link

CMake policy CMP0074 #77

Open kostya416 opened 1 month ago

kostya416 commented 1 month ago

I am using set (PostgreSQL_ROOT "xxxxx") in my CMake file and getting following warning / error from CMake:

CMake Warning (dev) at 3rd-party/taopq/CMakeLists.txt:12 (find_package): Policy CMP0074 is not set: find_package uses _ROOT variables.

it can be fixed by adding following lines to CMakeLists.txt for taopq before find_package call:

if (POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif()

uilianries commented 1 month ago

@kostya416 Thank you for reporting your case, but I would prefer not customizing CMP0074 only due PostgreSQL_ROOT.

What could be done is moving taopq to use CMake targets instead, following the official CMake modules: https://cmake.org/cmake/help/latest/module/FindPostgreSQL.html#imported-targets