VERIFY_INTERFACE_HEADER_SETS grouping in folders

I was planning on using VERIFY_INTERFACE_HEADER_SETS to replace custom equivalent code. But one thing I’ve noticed is that the targets generated ${TARGET}_verify_interface_header_sets don’t appear to be valid targets that you can apply properties to. I would like to be able to group all of the _verify_interface_header_sets into a folder on its own in my IDE. set_target_properties(${TARGET}_verify_interface_header_sets PROPERTIES FOLDER "Header Checkers"). Is there a way to do this? If its not possible its not the end of the world since really its only the CI that will ever enable the header verify but I like to keep things neat for when checking CI issues.

@kyle.edwards

Hello. I want to answer on this topic, as it is somewhat related to mine and the first one I found.

We want to compile specific generated tests with C++14 which would also involve setting information/properties on the target.

I tried something like this:

add_library(TestTarget INTERFACE)
target_sources(TestTarget
	PUBLIC FILE_SET HEADERS
	TYPE HEADERS
	FILES ${some_headers}	)
target_compile_features(TestTarget INTERFACE cxx_std_14)
set_target_properties(TestTarget PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)

But sadly the test does not try to run the lowest possible compiler flag for the header fileset.

I would therefore also be interested in accessing generated test targets, or at least adding some compile definitions for them.

Probably not as, I believe, the targets are made during generation time.

You mean you want the cxx_std_14 to be applied to the header test even if something else brings in the cxx_std_17 compile feature? I don’t believe there is a mechanism for that.

I’m not sure of the best way to allow access to these targets though. Maybe some cmake_language(DEFER) can access them somehow? Cc: @brad.king

cmake_language(DEFER) still runs at configure time. The “verify” targets are created after configuration is done so there is no way for .cmake code to access them.

Instead we could consider a companion property to VERIFY_INTERFACE_HEADER_SETS that can be used to set the FOLDER property of the generated target.