On 27.10.2015 19:58, Stephen Kelly wrote:
Chris Green wrote:

Ah, I see. It appears I was unclear on the difference between target and
test. What I actually want is the *test* property SKIP_RETURN_CODE,
which there does not seem to be any way to access via a generator
expression. Looks like I'm out of look, unless this is an upcoming
feature?
Generator expressions are generally only useful for things which are
determined at generate-time.

Can't you just read the test property at configure-time instead? You're the
one setting the property, right?

Deferring evaluation to generation time does have the advantage that you can set and change properties at any point after the test has been created and you can still be sure that the test is invoked with the final value.

Without the generator expression reading the property at configuration time is not really an option because the test's properties will not exist before add_test() and the test command itself is what was referring to that property.

You'd have to reorder logic so that the parameter for --skip-return-code is known before add_test() (and use e.g. variables or (custom) target properties).

Nils

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to