[CMake] Build/Link with static libs

Alexander Neundorf a.neundorf-work at gmx.net
Wed Apr 19 03:14:25 EDT 2006


> --- Ursprüngliche Nachricht --- 
> Von: Christian Lang <christian.lang at uni-bielefeld.de> 
> An: cmake at cmake.org 
> Betreff: [CMake] Build/Link with static libs 
> Datum: Tue, 18 Apr 2006 20:54:32 +0200 
>  
> Hi, 
>  
> I want to link a target (executable) against some static (not 
installed)  
> libs (e.g. "./foo.a"). How can I do this? "TARGET_LINK_LIBRARIES" does  
> not work. I cannot use "CMAKE_EXE_LINKER_FLAGS" either, because the  
> flags appear before the object files, leading to link failure for  
> dependency reasons. (The static libs have to appear after the last  
> object file.) 
>  
> Furthermore I want to build some static "noinst" libs in some  
> subdirectories (each with its own CMakeLists.txt) and link them into an  
> executable in the toplevel-directory. This executable does not require  
> any additional source files, it shall be build from this libs only. 
What  
> is an appropriate way to achieve this? 
 
AFAIK this should work. How does it fail ? 
 
Bye 
Alex 
 

-- 
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl


More information about the CMake mailing list