From a871a2040b678ae0be882d4538ec866a19cc6fe3 Mon Sep 17 00:00:00 2001 From: sin-ack Date: Thu, 12 Aug 2021 01:19:51 +0000 Subject: Meta: Properly quote some CMake variables in serenity_component This probably isn't all of them, because I'm no CMake expert. :^) It does however allow "/bin/false" to build now. --- Meta/CMake/utils.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Meta/CMake/utils.cmake') diff --git a/Meta/CMake/utils.cmake b/Meta/CMake/utils.cmake index c5c4510620..9243304f71 100644 --- a/Meta/CMake/utils.cmake +++ b/Meta/CMake/utils.cmake @@ -150,8 +150,10 @@ function(serenity_component name) set_property(TARGET "Component${name}" PROPERTY SERENITY_COMPONENT_RECOMMENDED ${SERENITY_COMPONENT_RECOMMENDED}) set_property(TARGET "Component${name}" PROPERTY SERENITY_COMPONENT_REQUIRED ${SERENITY_COMPONENT_REQUIRED}) set_property(TARGET "Component${name}" PROPERTY SERENITY_COMPONENT_DEPENDS ${SERENITY_COMPONENT_DEPENDS}) - if(SERENITY_COMPONENT_TARGETS) - add_dependencies("Component${name}" ${SERENITY_COMPONENT_TARGETS}) + if(NOT "${SERENITY_COMPONENT_TARGETS}" STREQUAL "") + foreach(target IN LISTS SERENITY_COMPONENT_TARGETS) + add_dependencies("Component${name}" "${target}") + endforeach() endif() if(BUILD_EVERYTHING OR BUILD_${NAME_UPPER} OR SERENITY_COMPONENT_REQUIRED) add_dependencies(components "Component${name}") @@ -170,7 +172,7 @@ macro(export_components_helper file_name current_dir) get_property(targets DIRECTORY ${current_dir} PROPERTY BUILDSYSTEM_TARGETS) foreach(target ${targets}) get_property(component_name TARGET ${target} PROPERTY SERENITY_COMPONENT_NAME) - if(component_name) + if(NOT "${component_name}" STREQUAL "") get_property(component_name TARGET ${target} PROPERTY SERENITY_COMPONENT_NAME) get_property(component_description TARGET ${target} PROPERTY SERENITY_COMPONENT_DESCRIPTION) get_property(component_recommended TARGET ${target} PROPERTY SERENITY_COMPONENT_RECOMMENDED) -- cgit v1.2.3