cmake: How to include another project generated header

204 views Asked by At

gflags had cmake-migration branch,
it will genrate header in ${buildir}/include,
how can i include the genrated header?
Is there a var liked gflags_generated_headers? Thanks!

1

There are 1 answers

0
123r789 On

You have to include the entire directory with Include_directories command.

INCLUDE_DIRECTORIES(${buildir}/include)

Then set the Generated property of the specific file to True.

set_source_files_properties(${buildir}/include/Myheader.h PROPERTIES GENERATED TRUE)