diff --git a/scripts/cmake/Functions.cmake b/scripts/cmake/Functions.cmake index 0c372bbe64710ea398fb1c82766f7da3570c17ed..c09da9094f66662cd028a30058ebb1ce26d1eed7 100644 --- a/scripts/cmake/Functions.cmake +++ b/scripts/cmake/Functions.cmake @@ -65,3 +65,16 @@ macro(ADD_GOOGLE_TESTS executable) endforeach() endforeach() endmacro() + +# Adds the include dir containing the autogenerated files to the PUBLIC +# interface of the given target +function(add_autogen_include target) + get_property(IsMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(IsMultiConfig) + target_include_directories(${target} PUBLIC + ${CMAKE_CURRENT_BINARY_DIR}/${target}_autogen/include_$<CONFIG>) + else() + target_include_directories(${target} PUBLIC + ${CMAKE_CURRENT_BINARY_DIR}/${target}_autogen/include) + endif() +endfunction() \ No newline at end of file