<div dir="ltr">Have a look at '$<BUILD_INTERFACE:...>' and '$<INSTALL_INTERFACE:...>' generator expressions. </div><br><div class="gmail_quote"><div dir="ltr">Le mar. 9 oct. 2018 à 09:48, Biddiscombe, John A. <<a href="mailto:biddisco@cscs.ch">biddisco@cscs.ch</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div>I have a problem with exported flags from a project.</div>
<div><br>
</div>
<div>If I use `target_compile_options(hpx PUBLIC ${flags})` hpx is compiled with the flags, and all 500+ tests within the project that depend on hpx inherit the flags too, so they get built correctly. However, the `HPXTargets.cmake` file that is generated with
the exported targets, also inherits these flags and lists them in INTERFACE_COMPILE_OPTIONS, so now users are complaining that flags used to compile hpx are being passed onto their project and some of the stuff we use like `-Werror=sign-compare` causes a build
fail in their project. If I use `target_compile_options(hpx PRIVATE ${flags})` then the flags are not passed on to the user projects, but also not passed on to the tests either. Is there an easy way of saying, pass these flags to all my projects within this
'PROJECT' but don't export them via the PUBLIC/INTERFACE to 3rd party users?</div>
<div><br>
</div>
<div>Thanks</div>
<div><br>
</div>
<div>JB<br>
</div>
</div>
</div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>