[CMake] Add header files to project when there are no cpp files

David Doria daviddoria at gmail.com
Tue Aug 28 10:58:07 EDT 2012


> Not sure if it works with QtCreator or not, but you should be able to
> add_custom_target and use the SOURCES argument to get "source" files
> to show up in the generated project.

Ah, thanks. I had tried:

add_custom_target(MyProject MyProject.h)

but not:

add_custom_target(MyProject SOURCES MyProject.h)

It does do the trick for QtCreator.

Thanks,

David


More information about the CMake mailing list