[Scons-users] library copy

Kraus Philipp philipp.kraus at flashpixx.de
Mon Sep 24 05:16:57 EDT 2012



Am 24.09.2012 um 00:19 schrieb Dirk Bächle:


> Hi Phil,

>

> On 22.09.2012 00:38, Philipp Kraus wrote:

>> On 2012-09-20 17:49:06 +0200, Kraus Philipp said:

>>

>>> Hello,

>>>

>>> I build a C++ program with env.Program and run first Configuration for detecting header & libraries. The executable is build under #build/release or #build/debug.

>>> I use some static and some dynamic libs. After the build process I would like to copy the shared libraries to the build directory. Can I read the full path of the shared library, which

>>> is linked to my executable or need I use FindFiles on env["libpath"] ?

>>

>

> why don't you simply use Install()?


I use install, but I have different lib versions in my source dir, so I need to find the correct lib. The lib which is used
is depened on linker command, exspecially the -L path (env["LIBPATH"]). At the moment I use FindFiles to find the lib
and the I use install for installing

It is somthing like that:

if env["version"] == "1.0" :
env.AppendUnique(LIBPATH = [""dir1", "dir2"])
elif env["version"] == "1.1" :
env.AppendUnique(LIBPATH = [""dir3", "dir4"])

for i in env["LIBS"] :
x = env.FindFiles(i, evn["LIBPATH"])
if x :
Install(x, "targetdir")


Is this a correct way or can I do this better?

Phil


More information about the Scons-users mailing list