From d92d1e901953461ad2c5fe834c0d62cfce15ef33 Mon Sep 17 00:00:00 2001 From: jzlv Date: Wed, 28 Jul 2021 15:00:51 +0800 Subject: [PATCH] [chore] fix library check bug --- tools/cmake/tools.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/cmake/tools.cmake b/tools/cmake/tools.cmake index 727417b3..ef07190c 100644 --- a/tools/cmake/tools.cmake +++ b/tools/cmake/tools.cmake @@ -217,12 +217,10 @@ function(check_add_library target_name directory) if(NOT TARGET ${target_name}) add_subdirectory(${directory} ${CMAKE_SOURCE_DIR}/build/libraries/${target_name}) endif() - elseif() - if(EXISTS ${target_name}) + elseif(EXISTS ${target_name}) get_filename_component(lib_relative_dir ${target_name} DIRECTORY) get_filename_component(library_name ${target_name} NAME_WE) message(STATUS "[register extern library component: ${library_name}], path:${lib_relative_dir}") - endif() else() message(FATAL_ERROR "both ${target_name} and ${directory} is not exist") endif()