<div dir="ltr"><div dir="ltr">All the flags/options in the CMake they could be considered as a list.<div><br></div><div>So it's much more easier to handle it as this</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div dir="ltr"><div>set(WIN_DEFINITIONS -DNOMINMAX)</div></div></blockquote><div dir="ltr"><div><br></div><div>Remember the list is the object, so we could construct the new list for the specific target.</div><div><br></div><div>Then to the specific target, just use the 3 commands.</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div dir="ltr"><div>target_compile_options() </div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>target_include_directories()</div></div><div><div>target_link_libraries()</div></div></blockquote><div dir="ltr"><div><br></div><div>We use this method to organize the cross-platform with library and executable without any problem, and super easy to control and manage.</div><div><br></div><div>Thanks.</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 21, 2018 at 7:19 AM Unknown <<a href="mailto:ax487@gmx.de">ax487@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear community,<br>
<br>
I have been wondering on multiple occasions about how to get the<br>
linker flags (i.e. all -llib -Ldir) and include flags (-Idir)<br>
for a library (i.e. a target added to the project using <br>
add_library) within a cmake.<br>
<br>
There are many cases in which the flags are required, noticeably<br>
generating a suitable pkg-config file or creating a wrappers around<br>
C/C++ libraries.<br>
<br>
I think that it should be possible to derive the flags from<br>
some of the target properties of the library, but I don't<br>
know exactly how.<br>
<br>
Could you give me a hand?<br>
<br>
ax487<br>
<br>
-- <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>