View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008992CMakeModulespublic2009-05-09 18:022016-06-10 14:30
ReporterDaniel Tihelka 
Assigned ToBill Hoffman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0008992: CMAKE_SHARED_LINKER_FLAGS are not taken into account in SWIG_LINK_LIBRARIES
DescriptionWhen UseSWIG modules is used and SWIG_LINK_LIBRARIES is called, it produces .so library - at least for Python and Java, I did not try other languages, but I suppose that it is the same for most (in not all) of them.

I expect that the fact that .so library is built implies that flags set for CMAKE_SHARED_LINKER_FLAGS define are used. However, it seems not to be truth. Is it design decision or just omission?

P.S. ADD_LIBRARY() works correctly.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0017470)
Bill Hoffman (manager)
2009-09-14 15:04

I think it uses a MODULE and not a shared library.
(0019046)
Daniel Tihelka (reporter)
2010-01-07 07:02

Well, but it builds shared library, didn't it ;-)

So I thought that the options set in CMAKE_SHARED_LINKER_FLAGS are/should be passed to a compiler when the shared library is built.

Setting verbose makefile, it produces something like (paths simplyfied):

[ 94%] Swig source
cd /home/.../wrap/python && /usr/bin/swig -python -I/home/.../wrap/python/ -outdir /home/.../wrap/python -c++ -I/home/.../src -I/usr/include/python2.5 -o /home/.../wrap/python/MyLibPYTHON_wrap.cxx /home/.../MyLib.i
/usr/bin/cmake -E cmake_progress_report /home/.../CMakeFiles 53

[ 96%] Building CXX object wrap/python/.../MyLibPYTHON_wrap.cxx.o
cd /home/.../wrap/python && /usr/bin/c++ -O3 -DNDEBUG -fPIC -I/home/.../src -I/usr/include/python2.5 -o CMakeFiles/.../MyLibPYTHON_wrap.cxx.o -c /home/.../wrap/python/MyLibPYTHON_wrap.cxx

Linking CXX shared module _mylib.so
cd /home/.../wrap/python && /usr/bin/cmake -E cmake_link_script CMakeFiles/_mylib.dir/link.txt --verbose=1

/usr/bin/c++ -fPIC -O3 -DNDEBUG -fPIC -shared -Wl,-soname,_mylib.so -o _mylib.so CMakeFiles/.../MyLibPYTHON_wrap.cxx.o ../../src/MyLib.a


but I would like the value of ${CMAKE_SHARED_LINKER_FLAGS} appear in the last step command, like:

/usr/bin/c++ -fPIC -O3 -DNDEBUG -fPIC -shared value_of_CMAKE_SHARED_LINKER_FLAGS_option .....
(0021224)
donblas (reporter)
2010-07-04 07:37

I've run into this issue as well. Any timetable on a solution/workaround?
(0021236)
donblas (reporter)
2010-07-04 14:28

So as a nasty workaround, one can use something like:

IF(UNIX)
     SET_TARGET_PROPERTIES(${SWIG_MODULE_${CSHARP_LIB_NAME}_REAL_NAME} PROPERTIES LINK_FLAGS "-Wl,-rpath,.")
ENDIF()

and use the internal REAL_NAME macro to set the needed LINK_FLAGS.

Post on issue:
http://iferrorthrownewbrick.blogspot.com/2010/07/will-penguin-in-room-please-stand-up.html [^]
(0041555)
Kitware Robot (administrator)
2016-06-10 14:27

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2009-05-09 18:02 Daniel Tihelka New Issue
2009-09-14 15:04 Bill Hoffman Note Added: 0017470
2009-09-14 15:04 Bill Hoffman Status new => assigned
2009-09-14 15:04 Bill Hoffman Assigned To => Bill Hoffman
2010-01-07 07:02 Daniel Tihelka Note Added: 0019046
2010-07-04 07:37 donblas Note Added: 0021224
2010-07-04 14:28 donblas Note Added: 0021236
2016-06-10 14:27 Kitware Robot Note Added: 0041555
2016-06-10 14:27 Kitware Robot Status assigned => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team