Hi Deniz,

Thanks for the response!  I tested it out and it seems to work exactly as you 
describe :)

I don’t want to depend on an un-released version of CMake though.  The original 
desire is because I kept making mistakes / adding definitions for one and not 
the other (code duplication at its finest…).

I discovered that I can populate one, e.g. only modify mylib_obj and then later 
grab these properties to add to the interface:

    get_target_property(MYLIB_OBJ_INTERFACE_COMPILE_DEFINITIONS mylib_obj 
INTERFACE_COMPILE_DEFINITIONS)

and also the same for INTERFACE_COMPILE_OPTIONS etc. (Note: for anybody reading 
this, understand that INTERFACE_COMPILE_DEFINITIONS is desired here, 
COMPILE_DEFINITIONS includes private items which I do not want in this case).

Is getting the properties and then later setting them a reasonable solution 
here, or is this a bad idea?

-Stephen

-- 

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to