From 599bb5b32e1405df50dd655192cc032aa87c62e7 Mon Sep 17 00:00:00 2001
From: Frederik Hennig <frederik.hennig@fau.de>
Date: Mon, 18 Nov 2024 18:55:57 +0100
Subject: [PATCH] Fix Cmake module to add `gen` path to target_include_dirs

---
 src/pystencilssfg/cmake/modules/PystencilsSfg.cmake | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/pystencilssfg/cmake/modules/PystencilsSfg.cmake b/src/pystencilssfg/cmake/modules/PystencilsSfg.cmake
index a29d70e..deb97ce 100644
--- a/src/pystencilssfg/cmake/modules/PystencilsSfg.cmake
+++ b/src/pystencilssfg/cmake/modules/PystencilsSfg.cmake
@@ -4,8 +4,6 @@ set(PystencilsSfg_GENERATED_SOURCES_DIR "${CMAKE_BINARY_DIR}/sfg_sources" CACHE
 mark_as_advanced(PystencilsSfg_GENERATED_SOURCES_DIR)
 
 file(MAKE_DIRECTORY "${PystencilsSfg_GENERATED_SOURCES_DIR}")
-include_directories(${PystencilsSfg_GENERATED_SOURCES_DIR})
-
 
 function(_pssfg_add_gen_source target script)
     set(options)
@@ -39,6 +37,7 @@ function(_pssfg_add_gen_source target script)
                        WORKING_DIRECTORY "${generatedSourcesDir}")
 
     target_sources(${target} PRIVATE ${generatedSourcesAbsolute})
+    target_include_directories(${target} PRIVATE ${PystencilsSfg_GENERATED_SOURCES_DIR})
 endfunction()
 
 
-- 
GitLab