diff --git a/cmake/FindModule.cmake b/cmake/FindModule.cmake index eab39b10..d0c85da2 100644 --- a/cmake/FindModule.cmake +++ b/cmake/FindModule.cmake @@ -3,16 +3,11 @@ name - find the library name path - find the library path #]] -function(find_module module name) +function(find_module module name path) if (TARGET ${module}) return() endif() - - set(options) - set(oneValueArgs) - set(multiValueArgs) - cmake_parse_arguments(MODULE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(path ${MODULE_UNPARSED_ARGUMENTS}) + add_library(${module} INTERFACE) find_library(${module}_LIBRARY_DIR NAMES ${name} NAMES_PER_DIR PATHS ${path} PATH_SUFFIXES lib ) @@ -21,9 +16,5 @@ function(find_module module name) if ("${${module}_LIBRARY_DIR}" STREQUAL "${module}_LIBRARY_DIR-NOTFOUND") message(FATAL_ERROR "${name} not found in ${path}") endif() - - add_library(${module} SHARED IMPORTED) - set_target_properties(${module} PROPERTIES - IMPORTED_LOCATION ${${module}_LIBRARY_DIR} - ) + target_link_libraries(${module} INTERFACE ${${module}_LIBRARY_DIR}) endfunction() diff --git a/cmake/external_libs/gtest.cmake b/cmake/external_libs/gtest.cmake index c5edcd72..15dfb825 100755 --- a/cmake/external_libs/gtest.cmake +++ b/cmake/external_libs/gtest.cmake @@ -11,7 +11,8 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR endif() if (GE_PB_PKG) - set(REQ_URL "${GE_PB_PKG}/libs/gtest/release-1.8.0.tar.gz") + #set(REQ_URL "${GE_PB_PKG}/libs/gtest/release-1.8.0.tar.gz") + set(REQ_URL "https://gitee.com/mirrors/googletest/repository/archive/release-1.8.0.tar.gz") set(MD5 "") elseif (ENABLE_GITEE) set(REQ_URL "https://gitee.com/mirrors/googletest/repository/archive/release-1.8.0.tar.gz")