[CMake] accessing value of <LINK_LIBRARIES>

Kevin Long kevin.long at ttu.edu
Sun Mar 15 04:11:53 EDT 2009


Hi,

Is there a way to access the string that would be spliced into the 
<LINK_LIBRARIES> field in a specified target's Makefile?

I'm trying to generate automatically a minimalist makefile to be used outside 
our build tree by a user of our libraries. I'd like to write a configurable 
file, say, Makefile.external.in, that looks something like 

CXX_COMPILER=@CMAKE_CXX_COMPILER@
CXX_FLAGS=@CMAKE_CXX_FLAGS@
CXX_LINK_LIBRARIES=@HOW_DO_I_DO_THIS????@

and produces something like:

CXX_COMPILER=/usr/local/gcc-4.3.2/bin/g++
CXX_FLAGS=-ansi -pedantic -Wall
CXX_LINK_LIBRARIES=-lfoo -lbar -lsnafu

according to the configuration determined by cmake.  The splicing of values 
for CXX_COMPILER and CXX_FLAGS works perfectly. How can I get the string 
containing the libraries? Obviously CMake has the information because it uses 
it to create makefiles. How do I access it? 

Thanks,

Kevin
-- 
------------------------------------------------------
Kevin Long
Associate Professor
Department of Mathematics and Statistics
Texas Tech University
Lubbock, TX 

"The end of fear is the beginning of wisdom" 
    -- Bertrand Russell
------------------------------------------------------


More information about the CMake mailing list