<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>swig modules created with command SWIG_ADD_LIBRARY are "standard" CMake targets so, same approach apply.</p>
<p><br>
</p>
<p>From convenience, you can use command SWIG_LINK_LIBRARIES (same semantic as TARGET_LINK_LIBRARIES) to manage custom link flags.</p>
<p><br>
</p>
<p>Now, regarding specifically flag -fPIC you can manage more easily and in a portable way the 'Position Independent Code' generation by setting variable CMAKE_POSITION_INDEPENDENT_CODE=ON. And I think this flag is for the compiler, not the linker...</p>
<p><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> CMake <cmake-bounces@cmake.org> on behalf of Stéphane Ancelot <sancelot@numalliance.com><br>
<b>Sent:</b> Wednesday, April 25, 2018 3:40:45 PM<br>
<b>To:</b> cmake@cmake.org<br>
<b>Subject:</b> [CMake] swig module add -fPIC flag</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi,<br>
<br>
I have not found how to add -fPIC link flag to a SWIG module.<br>
<br>
Regards<br>
<br>
S.Ancelot<br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com">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">
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">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html">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">
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">https://cmake.org/mailman/listinfo/cmake</a><br>
</div>
</span></font>
</body>
</html>