swig modules created with command SWIG_ADD_LIBRARY are "standard" CMake targets so, same approach apply.
>From convenience, you can use command SWIG_LINK_LIBRARIES (same semantic as >TARGET_LINK_LIBRARIES) to manage custom link flags. 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... ________________________________ From: CMake <cmake-boun...@cmake.org> on behalf of Stéphane Ancelot <sance...@numalliance.com> Sent: Wednesday, April 25, 2018 3:40:45 PM To: cmake@cmake.org Subject: [CMake] swig module add -fPIC flag Hi, I have not found how to add -fPIC link flag to a SWIG module. Regards S.Ancelot -- Powered by www.kitware.com<http://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
-- 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