From 27c8a17f99bcc3e1ee5275e4859850b33d8b44e7 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 1 Jan 2021 18:38:09 +0100 Subject: [PATCH] Allow enforcing absence of a target suffix for Syncthing Tray's test helper --- cmake/modules/BasicConfig.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/modules/BasicConfig.cmake b/cmake/modules/BasicConfig.cmake index 919038c..554d5cb 100644 --- a/cmake/modules/BasicConfig.cmake +++ b/cmake/modules/BasicConfig.cmake @@ -62,9 +62,12 @@ endif () # allow setting a library/application target suffix - A different configuration name might not require a different target # name since it might differ anyways (e.g. library extensions for static and shared configuration). Hence there's not simply # the configuration name used to distinguish targets as well. -set(${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_TARGET_SUFFIX - "" - CACHE STRING "sets a target suffix for ${META_PROJECT_NAME}") +if (NOT DEFINED ${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_TARGET_SUFFIX) + # wrap this within "if (NOT DEFINED" so absence of a target suffix can be enforced within certain project files + set(${META_PROJECT_VARNAME_UPPER}_CONFIGURATION_TARGET_SUFFIX + "" + CACHE STRING "sets a target suffix for ${META_PROJECT_NAME}") +endif () set(CONFIGURATION_TARGET_SUFFIX "" CACHE STRING "sets the target suffix for all projects within the current build")