2020-06-24 04:03:23 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2021-03-20 00:51:52 +08:00
|
|
|
index 1efecf8..198f429 100755
|
2020-06-24 04:03:23 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2021-03-20 00:51:52 +08:00
|
|
|
@@ -87,9 +85,9 @@ if(WIN32)
|
2020-06-24 04:03:23 +08:00
|
|
|
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/third_party/mman-win32>)
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
-add_subdirectory(trantor)
|
|
|
|
+find_package(Trantor CONFIG REQUIRED)
|
|
|
|
|
|
|
|
-target_link_libraries(${PROJECT_NAME} PUBLIC trantor)
|
|
|
|
+target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor)
|
|
|
|
|
|
|
|
if(NOT WIN32)
|
2021-02-03 06:35:45 +08:00
|
|
|
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
2021-03-20 00:51:52 +08:00
|
|
|
@@ -188,11 +196,10 @@ endif(NOT WIN32)
|
2020-11-03 05:58:02 +08:00
|
|
|
|
|
|
|
if(BUILD_ORM)
|
|
|
|
# find postgres
|
|
|
|
- find_package(pg)
|
|
|
|
- if(pg_FOUND)
|
|
|
|
- message(STATUS "libpq inc path:" ${PG_INCLUDE_DIRS})
|
|
|
|
- message(STATUS "libpq lib:" ${PG_LIBRARIES})
|
|
|
|
- target_link_libraries(${PROJECT_NAME} PRIVATE pg_lib)
|
|
|
|
+ find_package(PostgreSQL REQUIRED)
|
|
|
|
+ if(PostgreSQL_FOUND)
|
2021-03-20 00:51:52 +08:00
|
|
|
+ set(pg_FOUND true)
|
|
|
|
+ target_link_libraries(${PROJECT_NAME} PRIVATE PostgreSQL::PostgreSQL)
|
2020-11-03 05:58:02 +08:00
|
|
|
set(DROGON_SOURCES ${DROGON_SOURCES}
|
|
|
|
orm_lib/src/postgresql_impl/PostgreSQLResultImpl.cc)
|
|
|
|
if(LIBPQ_BATCH_MODE)
|
2021-03-20 00:51:52 +08:00
|
|
|
@@ -211,8 +224,7 @@ if(BUILD_ORM)
|
2021-02-03 06:35:45 +08:00
|
|
|
set(DROGON_SOURCES ${DROGON_SOURCES}
|
|
|
|
orm_lib/src/postgresql_impl/PgConnection.cc)
|
|
|
|
endif(libpq_supports_batch)
|
|
|
|
- endif(pg_FOUND)
|
2021-03-20 00:51:52 +08:00
|
|
|
-
|
2021-02-03 06:35:45 +08:00
|
|
|
+ endif(PostgreSQL_FOUND)
|
|
|
|
# Find mysql, only mariadb client liberary is supported
|
|
|
|
find_package(MySQL)
|
2021-03-20 00:51:52 +08:00
|
|
|
if(MySQL_FOUND)
|