From 62ae0fa55ea9f0d07a1c1c4949ee2a00da5ea7ee Mon Sep 17 00:00:00 2001 From: Daniel Adler Date: Wed, 14 Aug 2024 10:53:06 +0200 Subject: [PATCH] cmake/add_obx_schema: added dependency chain --- cmake/FindObjectBoxGenerator.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/FindObjectBoxGenerator.cmake b/cmake/FindObjectBoxGenerator.cmake index 1eaf759..40cdbc5 100644 --- a/cmake/FindObjectBoxGenerator.cmake +++ b/cmake/FindObjectBoxGenerator.cmake @@ -394,10 +394,16 @@ function (add_obx_schema) ${schema_filepath} DEPENDS ${schema_filepath} - USES_TERMINAL # Needed for ninja ) + set(custom_target gen-${ARG_TARGET}-${basefile}) + add_custom_target(${custom_target} DEPENDS ${cppfile} ${hppfile}) + if(previous_custom_target) + add_dependencies(${custom_target} ${previous_custom_target}) + endif() + set(previous_custom_target ${custom_target}) list(APPEND sources ${cppfile} ${hppfile}) endforeach() + add_dependencies(${ARG_TARGET} ${previous_custom_target}) target_sources(${ARG_TARGET} PRIVATE ${sources}) if (NOT ARG_INSOURCE)