Gayane
Gayane

Reputation: 637

How to switch off CMake automoc for subdirectories?

I have directory aaa and aaa/bb. I want CMake to create the moc_compilation.o file only for aaa/*.cxx files, but it scans recursively aaa/bb/*.cxx files also. How can I disable the recursive scan for automoc?

Upvotes: 0

Views: 1037

Answers (1)

Kevin
Kevin

Reputation: 18243

You can use the SKIP_AUTOMOC source file property to skip automoc processing for one file, or an entire group of files. This works for header files as well:

file(GLOB MY_EXCLUDED_SOURCES aaa/bb/*.cxx)
set_property(SOURCE ${MY_EXCLUDED_SOURCES} PROPERTY SKIP_AUTOMOC ON)

Upvotes: 0

Related Questions