Skip to contentSkip to conversation

how to specify alternative library locations from recipes using cmake

DISCUSSION Greg Kogut 3 participants 3 messages Jan 25, 2012 – Jan 26, 2012

lore
Share & tools
lore

Greg Kogut

author
#0 lore raw

I hope this isn't too much of a n00b question.

I've developed a dozen new recipes (which I'll submit once they're stable), most of which use cmake.

Some of them install libraries to alternative library locations, e.g. '/opt/myprog/lib'. � This works correctly, and I've verified the libraries are installed to the correct locations in the filesystem image.

However, while building binaries dependent on these new libraries, also using cmake, cmake tries to point the linker to these directories on the host machine, not the cross-compiler filesystem. �With predictable results.

What is the correct practice for correctly guiding cmake to the right location? �I've searched the existing recipes which use cmake without finding anything.

Regards,
Greg
From [email protected] Wed Jan 25 21:59:30 2012
Received: from sanddollar.geekisp.com ([216.168.135.167])

	by linuxtogo.org with esmtp (Exim 4.72)
	(envelope-from <[email protected]>) id 1Rq9wH-0003L4-M2
	for [email protected];
	Wed, 25 Jan 2012 21:59:29 +0100
Received: (qmail 13243 invoked by uid 1003); 25 Jan 2012 20:45:01 -0000
Received: from unknown (HELO ?192.168.1.104?)
	([email protected]@96.240.160.175)
	by mail.geekisp.com with (DHE-RSA-AES256-SHA encrypted) SMTP;
	25 Jan 2012 20:45:01 -0000

Message-ID: <[email protected]>
Date: Wed, 25 Jan 2012 15:45:00 -0500
From: Philip Balister <[email protected]>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;

	rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16
MIME-Version: 1.0
To: [email protected]
References: <1592899.mTy93uB97i@helios>
	<1908796.glHMrEiIxU@helios>	<[email protected]>
	<3543079.3rgjSx9VfG@helios>
	<1327514250.29933.37.camel@phil-desktop>

In-Reply-To: <1327514250.29933.37.camel@phil-desktop>
X-Enigmail-Version: 1.1.2
Content-Type: text/plain; charset

#1 lore raw
Quoted 10 lines · Greg Kogut

I hope this isn't too much of a n00b question.

I've developed a dozen new recipes (which I'll submit once they're stable), most of which use cmake.

Some of them install libraries to alternative library locations, e.g. '/opt/myprog/lib'.   This works correctly, and I've verified the libraries are installed to the correct locations in the filesystem image.

However, while building binaries dependent on these new libraries, also using cmake, cmake tries to point the linker to these directories on the host machine, not the cross-compiler filesystem.  With predictable results.

What is the correct practice for correctly guiding cmake to the right location?  I've searched the existing recipes which use cmake without finding anything.

Does adding something like
set( CMAKE_LIBRARY_PATH ${libdir} /opt/myprog/lib) to classes/cmake.bbclass help

Quoted 6 lines

Regards,
Greg
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#2 lore raw

2012/1/26 Khem Raj <[email protected]>:

Quoted 23 lines · Greg Kogut
Quoted 10 lines

I hope this isn't too much of a n00b question.

I've developed a dozen new recipes (which I'll submit once they're stable), most of which use cmake.

Some of them install libraries to alternative library locations, e.g. '/opt/myprog/lib'.   This works correctly, and I've verified the libraries are installed to the correct locations in the filesystem image.

However, while building binaries dependent on these new libraries, also using cmake, cmake tries to point the linker to these directories on the host machine, not the cross-compiler filesystem.  With predictable results.

What is the correct practice for correctly guiding cmake to the right location?  I've searched the existing recipes which use cmake without finding anything.

Does adding something like
set( CMAKE_LIBRARY_PATH ${libdir} /opt/myprog/lib) to classes/cmake.bbclass help

Quoted 6 lines

Regards,
Greg
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Quoted 4 lines

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Since CMake 2.4 it is possible to append without overwriting:
LIST( APPEND CMAKE_LIBRARY_PATH path_to_libs )

However, the same thing Khem proposed can be done per recipe, apply the following line to your recipe and change it to suit your needs:
EXTRA_OECMAKE = "-DCMAKE_LIBRARY_PATH=${libdir} ${path_to_libs}"

Maybe it is necessary to use escaped quoting marks like \"${libdir} ${path_to_libs}\" to group the values.

Signature · 2 lines
Regards
Samuel