From f2503b2048d29cfd857877398739e1c1208a080b Mon Sep 17 00:00:00 2001 From: implicitfield <114500360+implicitfield@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:06:30 +0400 Subject: [PATCH] CMake: Allow the names of utilities to contain extensions Previously, we would remove the "longest extension" from each file name when parsing it as the name of a utility, which made it impossible for the names of utilities to contain any extensions. --- Userland/Utilities/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Utilities/CMakeLists.txt b/Userland/Utilities/CMakeLists.txt index be557f0848..cab1d51709 100644 --- a/Userland/Utilities/CMakeLists.txt +++ b/Userland/Utilities/CMakeLists.txt @@ -14,7 +14,8 @@ 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 ${CMD_SRC} NAME_WE) + get_filename_component(CMD_NAME_WITH_EXTENSION ${CMD_SRC} NAME) + string(REPLACE ".cpp" "" CMD_NAME ${CMD_NAME_WITH_EXTENSION}) if (CMD_NAME IN_LIST SPECIAL_TARGETS) set(TARGET_NAME "${CMD_NAME}-bin") else()