On Sun, 2010-10-03 at 13:15 +0100, Paul McEnery wrote:
> Resolved!
> 
> The solution was to set CMAKE_EXE_LINKER_FLAGS using
"-Wl,--as-needed".
> 
> CMakeLists.txt:
> ==========================================
> cmake_minimum_required (VERSION 2.6)
> 
> project(galinette)
> 
> set(GALINETTE_VERSION         "1.1"             CACHE STRING
> "Software version" FORCE)
> set(bindir                    "bin"             CACHE FILEPATH "bin
> directory"    FORCE)
> set(libdir                    "lib"             CACHE FILEPATH "lib
> directory"    FORCE)
> set(sharedir                  "share/galinette" CACHE FILEPATH "share
> directory"  FORCE)
> set(CMAKE_EXE_LINKER_FLAGS    "-Wl,--as-needed -Wl,--no-undefined
> ${CMAKE_EXE_LINKER_FLAGS}")
> set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed
${CMAKE_SHARED_LINKER_FLAGS}")
> 
> add_definitions  (-Wall)
> 
> add_subdirectory (libgalinette)
> add_subdirectory (galinette-cli)
> add_subdirectory (galinette-gtk)
> ==========================================
> 
> Many thanks for all your help.
> 
> Regards,
> Paul.

Hi Paul,

Please checkout http://wiki.mandriva.com/en/Overlinking
It discusses the pkg-config issue you ran into, as well as underlinking
problems caused by the use of --as-needed. I'm afraid there's no silver
bullet :-(

Best regards,
Marcel Loose.

_______________________________________________
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

Reply via email to