El Miércoles 27 Mayo 2009ES 09:06:05 Alberto Luaces escribió: > Hello, > > is there any way of appending additonal libraries to a CMake project > without touching the CMakeLists.txt file? Something like > > cmake EXTRA_LIBS=-lfoo . > > or > > make EXTRA_LIBS=-lfoo > > My problem is that I have a system where some additonal system libraries > are required at the end of the linking command line and, since the project > is from a 3rd party, I don't want to modify the CMakeLists.txt file unless > absolutely necessary.
Just in case someone has to deal with this in the future, I found a temporal solution for the ld linker: use CMAKE_*_LINKER_FLAGS with the --whole-archive option, so the required symbols are being used even they are listed at the beginnig of the linker command line, for example: CMAKE_SHARED_LINKER_FLAGS="-Wl,--whole-archive -lgcc -lgcc_s -Wl,--no-whole-archive" Regards, Alberto _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
