blob: 6e718c5e3d6353e5f18b217e06b4612272c6679a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
diff --git a/cmake_modules/Findpg.cmake b/cmake_modules/Findpg.cmake
index 53037f2..d13f384 100644
--- a/cmake_modules/Findpg.cmake
+++ b/cmake_modules/Findpg.cmake
@@ -4,20 +4,14 @@
#
# This module defines PG_INCLUDE_DIRS, where to find header, etc. PG_LIBRARIES,
# the libraries needed to use PostgreSQL. pg_FOUND, If false, do not try to use
-# PostgreSQL.
-# pg_lib - The imported target library.
+# PostgreSQL. pg_lib - The imported target library.
find_package(PostgreSQL)
if(PostgreSQL_FOUND)
set(PG_LIBRARIES ${PostgreSQL_LIBRARIES})
set(PG_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIRS})
- message(STATUS "pg inc: " ${PostgreSQL_INCLUDE_DIRS})
add_library(pg_lib INTERFACE IMPORTED)
- set_target_properties(pg_lib
- PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
- "${PostgreSQL_INCLUDE_DIRS}"
- INTERFACE_LINK_LIBRARIES
- "${PostgreSQL_LIBRARIES}")
+ target_link_libraries(pg_lib INTERFACE PostgreSQL::PostgreSQL)
mark_as_advanced(PG_INCLUDE_DIRS PG_LIBRARIES)
endif(PostgreSQL_FOUND)
include(FindPackageHandleStandardArgs)
|