From 34f45ad29cf849db9737fa067715fefee72395ad Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Wed, 17 Jun 2026 16:15:08 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=B8=BB=E7=BA=BF=E5=BE=85=E5=90=88?= =?UTF-8?q?=E3=80=91=E4=B8=8D=E5=86=8D=E7=A1=AC=E7=BC=96=E7=A0=81=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/Spoolold/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/project/Spoolold/CMakeLists.txt b/project/Spoolold/CMakeLists.txt index 9f9bfb3..8e60a3f 100644 --- a/project/Spoolold/CMakeLists.txt +++ b/project/Spoolold/CMakeLists.txt @@ -1,15 +1,17 @@ cmake_minimum_required(VERSION 3.10) +get_filename_component(TARGET_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) + set(COMMON_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../library/CMakeLists.txt") -if(EXISTS ${COMMON_CMAKE_PATH}) - include(${COMMON_CMAKE_PATH}) +if(EXISTS "${COMMON_CMAKE_PATH}") + include("${COMMON_CMAKE_PATH}") else() message(FATAL_ERROR "Cannot find common build logic at ${COMMON_CMAKE_PATH}") endif() if(TARGET stm32cubemx) - target_link_libraries(Spoolold PUBLIC stm32cubemx) + target_link_libraries(${TARGET_NAME} PUBLIC stm32cubemx) else() - message(WARNING "[Spoolold] Dependency 'stm32cubemx' not found.") + message(WARNING "[${TARGET_NAME}] Dependency 'stm32cubemx' not found.") endif() \ No newline at end of file