From 556552d2246810c61f7640f7ee8710eaad1cf927 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 13 Oct 2017 15:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9cmake=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- cmake/FindZLTOOLKIT.cmake | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a794d4c0..6d7bef1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,7 @@ endif(FAAC_FOUND) find_package(ZLTOOLKIT QUIET) if(ZLTOOLKIT_FOUND) message(STATUS "找到ZLToolKit库:\"${ZLTOOLKIT_INCLUDE_DIR}\"") -include_directories(${ZLTOOLKIT_INCLUDE_DIR}/ZLToolKit) +include_directories(${ZLTOOLKIT_INCLUDE_DIR}) list(APPEND LINK_LIB_LIST ${ZLTOOLKIT_LIBRARIES}) endif(ZLTOOLKIT_FOUND) diff --git a/cmake/FindZLTOOLKIT.cmake b/cmake/FindZLTOOLKIT.cmake index 5fcaa4c0..664ae906 100644 --- a/cmake/FindZLTOOLKIT.cmake +++ b/cmake/FindZLTOOLKIT.cmake @@ -1,10 +1,18 @@ find_path(ZLTOOLKIT_INCLUDE_DIR - NAMES ZLToolKit/Network/Socket.h - PATHS $ENV{HOME}/ZLToolKit/include) + NAMES Network/Socket.h + PATHS + ${PROJECT_SOURCE_DIR}/../ZLToolKit/build/include + $ENV{HOME}/ZLToolKit/include/ZLToolKit) + +message(STATUS "${ZLTOOLKIT_INCLUDE_DIR}") find_library(ZLTOOLKIT_LIBRARY NAMES ZLToolKit - PATHS $ENV{HOME}/ZLToolKit/lib) + PATHS + ${PROJECT_SOURCE_DIR}/../ZLToolKit/build/lib + $ENV{HOME}/ZLToolKit/lib) + +message(STATUS "${ZLTOOLKIT_LIBRARY}") set(ZLTOOLKIT_LIBRARIES ${ZLTOOLKIT_LIBRARY}) set(ZLTOOLKIT_INCLUDE_DIRS ${ZLTOOLKIT_INCLUDE_DIR})