From e91f60e0f5009e43fb5da7cd08d8a22447223801 Mon Sep 17 00:00:00 2001 From: implicitfield <114500360+implicitfield@users.noreply.github.com> Date: Mon, 26 Feb 2024 17:45:28 +0400 Subject: [PATCH] CMake: Replace bespoke utility name mangling logic Instead of manually removing the '.cpp' extension, we can simply ask CMake to give us the file name without the last extension. --- Userland/Utilities/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index 9792ab1c3d..4ef7098cd5 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -14,8 +14,7 @@ list(APPEND RECOMMENDED_TARGETS # FIXME: Support specifying component dependencies for utilities (e.g. WebSocket for telws) foreach(CMD_SRC ${CMD_SOURCES}) - get_filename_component(CMD_NAME_WITH_EXTENSION ${CMD_SRC} NAME) - string(REPLACE ".cpp" "" CMD_NAME ${CMD_NAME_WITH_EXTENSION}) + get_filename_component(CMD_NAME ${CMD_SRC} NAME_WLE) if (CMD_NAME IN_LIST SPECIAL_TARGETS) set(TARGET_NAME "${CMD_NAME}-bin") else()