From c46c7f35702a786ad2f1c3f0654c165022e317ed Mon Sep 17 00:00:00 2001 From: An Tao Date: Tue, 24 Mar 2020 22:08:12 +0800 Subject: [PATCH] Fix DrogonConfig.cmake for Windows (#403) --- cmake/templates/DrogonConfig.cmake.in | 2 ++ cmake_modules/Findpg.cmake | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/templates/DrogonConfig.cmake.in b/cmake/templates/DrogonConfig.cmake.in index 92dbf787..907d37fe 100644 --- a/cmake/templates/DrogonConfig.cmake.in +++ b/cmake/templates/DrogonConfig.cmake.in @@ -14,7 +14,9 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) find_dependency(Jsoncpp REQUIRED) find_dependency(Trantor REQUIRED) +if(NOT WIN32) find_dependency(UUID REQUIRED) +endif(NOT WIN32) find_dependency(ZLIB REQUIRED) if(@pg_FOUND@) find_dependency(pg) diff --git a/cmake_modules/Findpg.cmake b/cmake_modules/Findpg.cmake index 88a6eb73..53037f2b 100644 --- a/cmake_modules/Findpg.cmake +++ b/cmake_modules/Findpg.cmake @@ -19,5 +19,9 @@ if(PostgreSQL_FOUND) INTERFACE_LINK_LIBRARIES "${PostgreSQL_LIBRARIES}") mark_as_advanced(PG_INCLUDE_DIRS PG_LIBRARIES) - set(pg_FOUND TRUE) -endif() +endif(PostgreSQL_FOUND) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(pg + DEFAULT_MSG + PG_LIBRARIES + PG_INCLUDE_DIRS)