[CMake] Fwd: Removing overkill linking

Paul McEnery pmcenery at gmail.com
Sun Oct 3 08:15:41 EDT 2010


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.


More information about the CMake mailing list