


$:/W0> passed to target_compile_options did not work. CMake behaviour change with SET SOURCE FILES PROPERTIES( OBJECT DEPENDS).
Cmake set source file porperties generator#
I wandered whenever generator expression could read GENERATED property of target source file, but AFAIK, generator expression would try to read it from the Library. This option may be used to specify a file from which to load cache entries before the first pass through the projects cmake listfiles. Is there any other approach I could take? That utilizes autogen target, which is quite handy (especially for other, non-advanced in CMake developers). With disable_warnings being interface library exposing /W0 flag, but with no luck. I’ve given a try to AUTOGEN_TARGET_DEPENDS set_target_properties(Library PROPERTIES AUTOGEN_TARGET_DEPENDS disable_warnings) I have to manually do it for all libraries + does not take AUTORRC or AUTOUI files into account. Source file properties are visible only to targets added in the same directory (CMakeLists.txt). See properties documentation for those known to CMake. As an alternative to explicitly building up a list of source files in a variable, some developers instead choose to let CMake find the source files and generate the contents of that variable automatically with the file (GLOBRECURSE. The only way I found to disable these is: set_source_files_properties($/Library_autogen/mocs_compilation.cpp PROPERTIES COMPILE_OPTIONS /W0)īut is not scaling. Set properties associated with source files using a key/value paired list. This makes autogenerated Library_autogen/mocs_compilation.cpp file being compiled with /Wall, which is quite noisy. It can be done with with simple target_compile_options(Library PRIVATE /Wall).īut, the Library target is Qt5 with AUTOMOC logic enabled. I want to customize warning flags in my Qt5 project. setsourcefilesproperties Source files can have properties that affect how they are built.
