OCT 1. 修正使用内置开源库时找不到头文件问题

This commit is contained in:
huangxin 2023-01-31 16:55:29 +08:00
parent d2e49f254e
commit c13bb5d3cd
3 changed files with 11 additions and 6 deletions

View File

@ -66,6 +66,13 @@ CONFIGURE_FILE(prj_config.h.in prj_config.h)
MESSAGE("Git Tag: " ${VERSION_GIT_TAG}) MESSAGE("Git Tag: " ${VERSION_GIT_TAG})
#
FIND_PACKAGE(PkgConfig)
SET(COMMON_LIBS "")
INCLUDE(./depend/third_libs.cmake)
IF (USED_USER_VNI) IF (USED_USER_VNI)
LIST(APPEND COMMON_DEFINE "-DUSER_VNI") LIST(APPEND COMMON_DEFINE "-DUSER_VNI")
MESSAGE("Select Option USED_USER_VNI") MESSAGE("Select Option USED_USER_VNI")

View File

@ -42,6 +42,7 @@ IF (NOT LIBUV_FOUND)
FETCHCONTENT_POPULATE(libuv) FETCHCONTENT_POPULATE(libuv)
ADD_SUBDIRECTORY(${libuv_SOURCE_DIR} ${libuv_BINARY_DIR}) ADD_SUBDIRECTORY(${libuv_SOURCE_DIR} ${libuv_BINARY_DIR})
ENDIF () ENDIF ()
INCLUDE_DIRECTORIES(${libuv_SOURCE_DIR}/include)
LIST(APPEND COMMON_LIBS "uv_a") LIST(APPEND COMMON_LIBS "uv_a")
ELSE () ELSE ()
MESSAGE(STATUS "libuv found ${LIBUV_VERSION} at ${LIBUV_LIBRARY_DIRS}") MESSAGE(STATUS "libuv found ${LIBUV_VERSION} at ${LIBUV_LIBRARY_DIRS}")
@ -55,6 +56,7 @@ IF (NOT LIBCONFIG_FOUND)
FETCHCONTENT_POPULATE(libconfig) FETCHCONTENT_POPULATE(libconfig)
ADD_SUBDIRECTORY(${libconfig_SOURCE_DIR} ${libconfig_BINARY_DIR}) ADD_SUBDIRECTORY(${libconfig_SOURCE_DIR} ${libconfig_BINARY_DIR})
ENDIF () ENDIF ()
INCLUDE_DIRECTORIES(${libconfig_SOURCE_DIR}/lib)
LIST(APPEND COMMON_LIBS "config") LIST(APPEND COMMON_LIBS "config")
ELSE () ELSE ()
MESSAGE(STATUS "libconfig found ${LIBCONFIG_VERSION} at ${LIBCONFIG_LIBRARY_DIRS}") MESSAGE(STATUS "libconfig found ${LIBCONFIG_VERSION} at ${LIBCONFIG_LIBRARY_DIRS}")
@ -68,6 +70,7 @@ IF (LIBZLOG STREQUAL "LIBZLOG-NOTFOUND")
FETCHCONTENT_POPULATE(zlog) FETCHCONTENT_POPULATE(zlog)
ADD_SUBDIRECTORY(${zlog_SOURCE_DIR} ${zlog_BINARY_DIR}) ADD_SUBDIRECTORY(${zlog_SOURCE_DIR} ${zlog_BINARY_DIR})
ENDIF () ENDIF ()
INCLUDE_DIRECTORIES(${zlog_SOURCE_DIR}/src)
LIST(APPEND COMMON_LIBS "zlog") LIST(APPEND COMMON_LIBS "zlog")
ELSE () ELSE ()
MESSAGE(STATUS "zlog found of ${LIBZLOG}") MESSAGE(STATUS "zlog found of ${LIBZLOG}")

View File

@ -6,8 +6,7 @@ ENDIF ()
PROJECT(${PROJECT_TARGET}) PROJECT(${PROJECT_TARGET})
#
FIND_PACKAGE(PkgConfig)
PKG_SEARCH_MODULE(LIBCURL QUIET libcurl) PKG_SEARCH_MODULE(LIBCURL QUIET libcurl)
PKG_SEARCH_MODULE(LIBSSL QUIET libssl) PKG_SEARCH_MODULE(LIBSSL QUIET libssl)
@ -18,10 +17,6 @@ IF ((NOT LIBZMQ_FOUND) OR (NOT LIBCRYPTO_FOUND) OR (NOT LIBSSL_FOUND) OR (NOT LI
LINUX_INSTALL_SYSTEM_PACKAGE() LINUX_INSTALL_SYSTEM_PACKAGE()
ENDIF () ENDIF ()
SET(COMMON_LIBS "")
INCLUDE(../depend/third_libs.cmake)
LIST(APPEND COMMON_LIBS "${LIBCURL_LDFLAGS} ${LIBSSL_LDFLAGS} ${LIBCRYPTO_LDFLAGS}") LIST(APPEND COMMON_LIBS "${LIBCURL_LDFLAGS} ${LIBSSL_LDFLAGS} ${LIBCRYPTO_LDFLAGS}")
LIST(APPEND COMMON_LIBS "${LIBZMQ_LDFLAGS}") LIST(APPEND COMMON_LIBS "${LIBZMQ_LDFLAGS}")
LIST(APPEND COMMON_LIBS "-lm -lpthread") LIST(APPEND COMMON_LIBS "-lm -lpthread")