cmake: How to include another project generated header

220 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 best solutions below

0
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)