Commit Graph

49 Commits

Author SHA1 Message Date
Andre McCurdy 33f378ee33 cmake.bbclass: use weakest ??= assignment for default OECMAKE_SOURCEPATH
Make it slightly easier to support situations where the default path
needs to be over-ridden more than once.

(From OE-Core rev: 07390e3d45cdf244079a6b91175512ebac789da0)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-29 11:17:23 +01:00
Peter Kjellerstedt edb7672c27 cmake.bbclass: Do not use bitbake variable syntax for shell variables
Using bitbake variable syntax (i.e., ${FOO}) for shell variables is
bad practice. First of all it is confusing, but more importantly it
can lead to weird problems if someone actually defines a bitbake
variable with the same name as the shell variable.

Also use lower case for local shell variables.

(From OE-Core rev: ea6befae799f45cf93771442f242cb023dd809d1)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-29 11:17:22 +01:00
Kyle Russell 3b3aab0e8d cmake.bbclass: Set CMAKE_CROSSCOMPILING correctly
If CMAKE_SYSTEM_NAME is defined, CMake assumes we're cross-compiling,
which is not necessarily the case.

(From OE-Core rev: bd082c9be6191e67ea1b1bf10ce5e130a3433ab5)

Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-19 10:18:43 +01:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Khem Raj 47594d59ec cmake.bbclass: Set CXXFLAGS and CFLAGS
We strip the TOOLCHAIN_OPTIONS and HOST_CC_ARCH from CC/CXX in cmake.bbclass
whereas CFLAFS and CXXFLAGS assume that TOOLCHAIN_OPTIONS are
part of CC/CXX variables, this causes compile failures when cmake
is running compiler tests during configure on some architectures
especially armhf, because hf ABI information -mfloat-abi is part
of TOOLCHAIN_OPTIONS, so what happens is that testcase gets compiled
without hard-float, howver, during linking the float ABI option
is passed via LDFLAGS, now linker rejects this and fails like
/mnt/a/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/6.2.0/ld: error: cmTC_27947 uses VFP register arguments, CMakeFiles/cmTC_27947.dir/src.cxx.o does not
mnt/a/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/6.2.0/ld: failed to merge target specific data of file CMakeFiles/cmTC_27947.dir/src.cxx.o
collect2: error: ld returned 1 exit status

This means that CMake now fails the configure time test too
which is not right, e.g. it might disable features which actually do exist
and should be enabled e.g. in case above it is resulting as below

Performing C++ SOURCE FILE Test HAS_BUILTIN_SYNC_SUB_AND_FETCH failed with the following output:

Its actually a bug in CMake see
https://gitlab.kitware.com/cmake/cmake/issues/16421

CMake is ignoring CMAKE_CXX_FLAGS when using CHECK_CXX_SOURCE_COMPILES
function.

Until it is fixed upstream, we add HOST_CC_ARCH and TOOLCHAIN_OPTIONS
to CFLAGS and CXXFLAGS, so that we can ensure that compiler invocation
remains consistent.

(From OE-Core rev: 826f3cdb474b5728b22f08d2342fc90235ca9e7d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:12 +00:00
Paul Eggleton f7259298a2 classes/externalsrc: re-run do_configure when configure files change
If the user modifies files such as CMakeLists.txt in the case of cmake,
we want do_configure to re-run so that those changes can take effect. In
order to accomplish that, have a variable CONFIGURE_FILES which
specifies a list of files that will be put into do_configure's checksum
(either full paths, or just filenames which will be searched for in the
entire source tree). CONFIGURE_FILES then just needs to be set
appropriately depending on what do_configure is doing; for now I've set
this for autotools and cmake which are the most common cases.

Fixes [YOCTO #7617].

(From OE-Core rev: 923fc20c2862a6d75f949082c9f6532ab7e2d2cd)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-11 23:04:44 +01:00
Andreas Müller 79d45bf56d cmake.bbclass: avoid treating imports as system includes
CMake sets all imported headers as system headers. This causes trouble for c++
projects [1].

Thanks to Jack Mitchell for pointing to the setting [2]. Build tested upon
meta-qt5-extra-world which had lots of fallout before.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
[2] http://lists.openembedded.org/pipermail/openembedded-core/2016-September/126067.html

(From OE-Core rev: a5bf690e27a32c5470a4e110ab58ed0a92b9d039)

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-08 00:32:43 +01:00
Thomas Witt 7afa09db2e cmake.bbclass: call cmake with a relative path
CMake wants a relative path for CMAKE_INSTALL_*DIR, an absolute path
breaks cross-compilation. This fact is documented in the following
ticket: https://cmake.org/Bug/view.php?id=14367

$sysconfdir and $localstatedir are not relative to $prefix, so they are
still set as absolute paths. With his change ${PROJECT}Targets.cmake
that are generated by cmakes "export" function will contain relative
paths instead of absolute ones.

(From OE-Core rev: c03b32bd71dbe04f2f239556fea0b53215e403d7)

Signed-off-by: Thomas Witt <Thomas.Witt@bmw.de>
Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-23 17:44:42 +01:00
Paul Eggleton 4ebe0e1175 classes/cmake: enable progress for do_compile
cmake outputs percentage complete as part of its compilation process, so
we can enable BitBake's new progress scanning for do_compile here.

(From OE-Core rev: f77ea95ba5cd337f01f2a1b4fe9466feb6af9440)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Richard Purdie 09d08340fe Revert "cmake.bbclass: set the modules directory correctly"
This reverts commit 642bd49964690259328f506df41a1764c5ac6226.

This broke "bitbake cmake":

| CMake Error at /home/jku/src/poky/build/tmp/work/core2-64-poky-linux/cmake/3.5.2-r0/toolchain.cmake:34 (list):
|   Syntax error in cmake code at
|
|     /home/jku/src/poky/build/tmp/work/core2-64-poky-linux/cmake/3.5.2-r0/toolchain.cmake:34
|
|   when parsing string
|
|     /home/jku/src/poky/build/tmp/sysroots/qemux86-64/usr/share/cmake-\3.5.${CMAKE_MINOR_VERSION}/Modules/
|
|   Invalid character escape '\3'.
| Call Stack (most recent call first):
|   /home/jku/src/poky/build/tmp/sysroots/x86_64-linux/usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake:98 (include)
|   CMakeLists.txt:19 (project)

https://autobuilder.yoctoproject.org/main/builders/nightly-world/builds/832
https://autobuilder.yoctoproject.org/main/builders/nightly-world-lsb/builds/550

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-20 08:40:21 +01:00
Jose Pardeiro 7b9e1f5ad8 cmake.bbclass: set the modules directory correctly
The CMake recipes contain a mismatch between the environmental variable
which defines where the Modules are installed and the location where they
actually are. This patch fixes the environmental variable to point to the
proper folder defined according to the cmake version.

(From OE-Core rev: 642bd49964690259328f506df41a1764c5ac6226)

Signed-off-by: Jose Pardeiro <jpardeiro@rapyuta-robotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-17 17:14:55 +01:00
Ross Burton 36912cd2e4 cmake: enable verbose builds
To help debugging build problems pass VERBOSE=1 to make so that the makefiles
print their commands, just like we do with autotools.

(From OE-Core rev: 62f95a769ec9e11c72fbf78257badbfb59f1b354)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14 23:05:11 +01:00
Martin Jansa c2f7da23d0 base.bbclass: Introduce PACKAGECONFIG_CONFARGS variable
* add separate variable for configuration options generated from
  PACKAGECONFIG setting, this helps other bbclasses and recipes
  to take advantage of PACKAGECONFIG mechanism, without including
  other options from EXTRA_OECONF
* e.g. meta-qt5 recipes are abusing EXTRA_OECONF to get options
  from PACKAGECONFIG:
  EXTRA_QMAKEVARS_PRE +=
  but with
  conf/distro/include/no-static-libs.inc
  it means getting --disable-static as invalid option inside
  EXTRA_QMAKEVARS_PRE as reported by Alexandre Belloni who tried
  to use poky with meta-qt5.
* once we migrate all bbclasses and recipes to PACKAGECONFIG_CONFARGS
  we should also restrict EXTRA_OECONF append only to autotools.bbclass
  like I did for cmake.bbclass

(From OE-Core rev: 0ea4a47bfc27d02594d489b27c029d3d3badf3d4)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:24 +01:00
Ross Burton 35011d9ac6 cmake: don't inherit autotools
autotools was inherited for some functions some time ago, but now all it's using
it for explicitly is autotools_do_install(), which is basically just "make
install".  Invoke that directly and we can remove the inherit autotools.

(From OE-Core rev: 1cbc0400621c23243d96dedf4a226a732f5c87c9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-18 07:39:30 +00:00
Andre McCurdy 3d377686a4 cmake.bbclass: don't duplicate CMAKE_C_FLAGS in CMAKE_C_FLAGS_RELEASE
The base CMAKE_<LANG>_FLAGS are included for all build types,
therefore the CMAKE_<LANG>_FLAGS_RELEASE should contain only
additional flags or over-rides.

  https://cmake.org/cmake/help/v3.2/variable/CMAKE_LANG_FLAGS.html

(From OE-Core rev: 961740d5d81ce44a595d5465bafb48a0cbab5159)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:33 +00:00
Alexander Kanavin c89a1eb877 classes/cmake: add arch conversion routine
cmake expects target architecture strings in the format of uname(2),
which do not always match TARGET_ARCH (e.g. powerpc vs ppc).

(From OE-Core rev: 7c61d022aa9bbba3c2f8a2df46eeb19e2772c89a)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:46:58 +01:00
Koen Kooi d451627132 cmake bbclass: fix support for native builds
For native builds  of recipes (e.g. mariadb-native) cmake *must* look outside of its sysroot to find the compiler, so instruct it to do so.

(From OE-Core rev: 907828acebcf07d7a9367432432d04e0dab283d3)

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:40 +01:00
Ross Burton 7b08012204 cmake: extend CMAKE_MODULE_PATH instead of setting
Some (e.g. piglit) CMakeList.txt files will extend CMAKE_MODULE_PATH before
calling project(), which is when the toolchain.cmake file is parsed.  In this
situation the CMAKE_MODULE_PATH is overwritten, so handle this by appending in
toolchain.cmake instead of assigning.

(From OE-Core rev: 2cfa8427d77f680df37c12d00125501ebe7c38a3)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:17 +01:00
Moritz Blume 9c8ed1b197 cmake: Whitespace fix
(From OE-Core rev: f0d6523302fe1d246833b5d0b2dcfe0c0efd5239)

Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-08 17:34:03 +01:00
Cody P Schafer 60d504b431 cmake: supply CMAKE_AR in toolchain file
(From OE-Core rev: 79144da00f005b5a3ab8f7404730216cfc684616)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-05 18:01:04 +00:00
Richard Purdie c1f4b1f766 cmake: Try and improve cleaning of builds when B==S
Currently if B==S for a cmake recipe, the build will not reconfigure. This patch adds
code to remove the generated cmake files, meaning cmake will then be forced to regenerate
them. This forces cmake to see configuration changes it may not otherwise see.

(From OE-Core rev: 01f4ed0cfbc60859aabfa5bff33ed966117a05d7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:11:51 +00:00
Philip Balister 3e6df77b23 cmake.bbclass : Add support for cmake projects that use .S files.
UHD and GNU radio use the cmake build system. The toolchain file made
from cmake.bbclass does not set the variable needs by cmake projects
that use .S files. UHD added some .S files and these changes are required
to build recent UHD.

(From OE-Core rev: 43ce4b804d433662fe77c6f5298060ba74a0e639)

Signed-off-by: Philip Balister <philip@balister.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-22 13:04:21 +01:00
Martin Jansa b8a001dc24 cmake: drop -fpermissive
* it was dropped from default CXXFLAGS in:
  commit 24dd8e129447013ee98609f3892ec414b1b21340
  Author: Richard Purdie <richard.purdie@linuxfoundation.org>
  Date:   Sun Mar 2 17:38:33 2014 +0000

    bitbake.conf: Drop -fpermissive

    Drop the -fpermissive C++ compiler flag. We've had this around for years, most
    code should have been fixed long ago. Its possible some recipes may fail
    however we can (and should) just use the flag where needed.

* I haven't build world with this yet, but maybe it's time to
  drop it here as well at least for consistency

(From OE-Core rev: 578124aedd3dbffd79ea01862d57223ffaa7216a)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:49 +01:00
Ross Burton f3d2e32a14 cmake.bbclass: restore OECMAKE_SOURCEPATH
Some packages put their CMakeLists.txt file in a subdirectory, so assuming that
it is in ${S} won't work.

Restore OECMAKE_SOURCEPATH (defaulting to ${S}) so that the location of
CMakeLists.txt can be set if required.

Based on a patch by Miroslav Keš <miroslav.kes@gmail.com>

(From OE-Core rev: 2c23d7ab913a636aa0ab6a6e899cf6211d1e2714)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-25 13:51:46 +01:00
Ross Burton 42e122de0f cmake.bbclass: fix note when warning about deprecated variables
The note issues when OECMAKE_BUILDPATH and OECMAKE_SOURCEPATH were being used
stated that an in-tree build would be done, but the default is in fact an
out-of-tree build.

(From OE-Core rev: 0dafb9f78e9ab9ec1a1483efc37902c2e8de3623)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-22 07:20:04 +00:00
Ross Burton 18e62b88e9 cmake: specify all install paths
Specify the full set of install paths (bindir, libdir, etc) for packages that
use the GNUInstallDirs module, instead of just the prefix and leaving the rest
as default (which breaks with multilib).

(From OE-Core rev: d3995ac14ba05c0420f15f264f7e9d0c3af71f74)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14 17:03:55 +00:00
Ross Burton d6ed40fa2a cmake: default to out-of-tree builds
Set B=${WORKDIR}/build in cmake.bbclass so that recipes using cmake.bbclass do
out-of-tree builds by default.

(From OE-Core rev: 783fb88f476c94d5d4f4b954f7053464d9a6dff5)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14 11:33:56 +00:00
Ross Burton 6aafc529d7 cmake: respect ${S} and ${B}
Instead of the class-specific variables OECMAKE_BUILDPATH and
OECMAKE_SOURCEPATH, just use ${B} and ${S}.

If these two paths are different, delete any existing ${B} before running a
build so that previous builds don't taint the current build.

Note that OECMAKE_SOURCEPATH and OECMAKE_BUILDPATH are not respected, so recipes
that manually set these in the past will need to be updated to either use
something along the lines of separatebuilddir.inc or set B themselves.  If the
old variables are set, a warning is displayed.

(From OE-Core rev: 43073569cb67d98c11aa71211d77b566b64f9145)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14 11:33:55 +00:00
Saul Wold 5f2748e492 cmake.bbclass: ensure CMAKE_SYSTEM_NAME is correct
Using TARGET_OS can add the ABIEXTENSION so ensure that is is removed for the Linux
TARGET_OS, we might have other TARGET_OSes so don't hard code CMAKE_SYSTEM_NAME

[YOCTO #5145]

(From OE-Core rev: 7d8b700242b1b32c6b6d0735b497701800f54fc4)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-10 22:58:33 +01:00
Richard Purdie 31709ed0af cmake: set system name correctly
For unknown reasons, the cmake class is using SDK_OS as the
target system OS. This makes no sense but only shows up as a problem
when you try a different SDK OS. Fix it to use TARGET_OS which is
the correct thing to do. For the vast majority of users this will
make no difference.

(From OE-Core rev: 57be84259f0885865c85d7bac350979430b956b5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-08 10:51:56 +01:00
Stefan Herbrechtsmeier 8db18b6057 cmake.bbclass: Don't use packages from the native build machine
(From OE-Core rev: 044037d8add3556a90ac4da5991e1e5975d62e25)

Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16 11:14:33 +01:00
Joe Slater 84de4f5b40 cmake.bbclass: modify construction of compiler flags
Use CFLAGS instead of CPPFLAGS for C_FLAGS variants.

When debug optimization is enabled in the local.conf, the debug (-O0) vs
production (-O2) does not change in the builds.  As the CPPFLAGS do not
contain the optimization settings.

Also the CXX_FLAGS are based on CXXFLAGS, so it makes sense to similarly
set the C_FLAGS based on CFLAGS.

(From OE-Core rev: 558662927be550aeb8dd163f65e16b1750bbd127)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-29 22:18:49 +01:00
Ross Burton 3c1b1312a6 cmake: reset B from autotools, as this class doesnt like it
(From OE-Core rev: f8eae815186976f6111f30ae88ac33e723863982)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-04 12:41:57 +00:00
Ross Burton c2cb4c0645 cmake.bbclass: use DEPENDS_prepend instead of += for cmake-native
Otherwise when a recipe using DEPENDS=, the cmake-native dependency disappears.

(From OE-Core rev: 2b35539d96325d8e687451543d4f52f1a07bf1c6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-18 16:42:09 +00:00
Khem Raj 429004f6a5 cmake.bbclass: Add OECMAKE_C_LINK_FLAGS and OECMAKE_CXX_LINK_FLAGS variables
In some cases we need to specify linker flags and right
now we do not have a way to communicate that to cmake
based systems. cmake defines CMAKE_C_LINK_FLAGS and CMAKE_CXX_LINK_FLAGS
for these needs. This patch therefore defines two local variables
namely OECMAKE_C_LINK_FLAGS and OECMAKE_CXX_LINK_FLAGS which
can be altered by recipes to tweak linker flags

(From OE-Core rev: 9e00a74749ba8e1cf0d15efe8e16af60b189e080)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-11 13:49:51 +01:00
Nitin A Kamble 520668862a cmake.bbclass: add ${base_libdir} to CMAKE_LIBRARY_PATH
Some libraries like libcrypto.so are installed at base_libdir
instead of libdir. So add the base_libdir to CMAKE_LIBRARY_PATH
so that these libraries can be found correctly.

This resolves an issues with libzypp, which was not finding the
libcrypo library correctly in an x32 build.

(From OE-Core rev: f47ada62a3da879006e7cb27479dc9b72c56e923)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-13 11:45:02 +00:00
Ken Werner 4be9d82596 Add EXTERNAL_TOOLCHAIN to CMAKE_FIND_ROOT_PATH
This allows cmake to find the binaries of an external toolchain.

(From OE-Core rev: 7b355ad09a622cfe57c66674ed1affd61c4d872e)

Signed-off-by: Ken Werner <ken.werner@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-03 16:33:21 +00:00
Andrew Gabbasov 2d59e4d36e cmake.bbclass: adding extendable extra variable to root path
Introducing a hook variable for various .conf files to add
extra path elements to cmake. For example, it can be used
in external toolchain conf file to add ${TOOLCHAIN_PATH}
to cmake root path search.

(From OE-Core rev: 23be60dad6a705f151520e3eda2da5e02230f5fd)

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-28 21:41:44 +01:00
Phil Blundell b7937a4f39 cmake.bbclass, perlnative.bbclass: arrange for cmake to find perl-native
When CMake is looking for perl, it only searches in the specific directories
that it's told about and ignores ${PATH}.  If perlnative is in use, ensure
that the appropriate installation path is added to the list of places that
cmake will look for perl, otherwise it won't ever be found.

(From OE-Core rev: add9e4e30e0b1e0f93479b43ce61953efb90985d)

Signed-off-by: Phil Blundell <philb@gnu.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-17 15:14:54 +01:00
Yu Ke 4a75a370fd cmake.bbclass: add ${libdir} for multilib case
(From OE-Core rev: e198b72bc03c7545417944dcb3c930aaf2376488)

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-27 15:45:49 +01:00
Yu Ke 4e01f730bf sat-solver: fix for non /usr/lib libdir case
when libdir set to non /usr/lib like /usr/lib64, there is do_configure error:
"
-- Libraries will be installed in /usr/lib
CMake Error at /home/kyu3/sdb/lib64/tmp/sysroots/x86_64-linux/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91  (MESSAGE):
  Please install 'check' and 'check-devel' packages (missing: CHECK_LIBRARY)
Call Stack (most recent call first):
  /home/kyu3/sdb/lib64/tmp/sysroots/x86_64-linux/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252              (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindCheck.cmake:17 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:35 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
"

The reason is that cmake did not search /usr/lib64 for libcheck, thus report error

add ${libdir} to the CMAKE_SYSTEM_LIBRARY_PATH can fix this issue.

(From OE-Core rev: f4de87ce30a37bb2f09855d442b34d153ada8c0e)

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-13 12:14:20 +01:00
Otavio Salvador 21f1314495 cmake.bbclass: use CPPFLAGS and CXXFLAGS
Some classes, as for example nativesdk, defines CPPFLAGS and CXXFLAGS
to be passed to compiler. Using those makes more sense and avoid some
hacks on packages using CMake.

(From OE-Core rev: de60d1d91b28c3f5568b132a8eb29d9a754e68a0)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-07-08 16:39:11 +01:00
Otavio Salvador 9c272d93c6 cmake.bbclass: fix qmake and rpath issues
Sync with OE at 3b7d83362027fde4f6850533ab83277d95dda961 however
without changing the way of generating the toolchain file and making
it branding agnostic.

(From OE-Core rev: ee98c2b095b991901b6c2125b2428985c873b4bd)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-11 16:41:52 +01:00
Qing He be291999de cmake.bbclass: sync from openembedded
this fixes:
  - toolchain detection error (e.g. ar and ranlib)

changes from openembedded:
  - reformatting
  - cmake modules search path
  - use 'cat <<EOF' instead of echos for clarity

Signed-off-by: Qing He <qing.he@intel.com>
2010-08-31 17:19:53 +01:00
Qing He 5bb55610f3 cmake.bbclass: sync from openembedded
this fixes:
  - toolchain detection error (e.g. ar and ranlib)
  - cmake modules search path

Signed-off-by: Qing He <qing.he@intel.com>
2010-08-27 13:29:49 +01:00
Kevin Tian ea3cfbaf26 cmake: only search root directory for FIND_***
default cmake behavior for FIND_***, is to first search listed directories prefixed
with CMAKE_FIND_ROOT_PATH, and if not found then go to unprefixed directories. This
is not desired as build system may be referenced.

this commit refine the search path only on prefixed directories, and thus fix
libmusicbrains build failure on some systems

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2010-07-27 22:51:34 -07:00
Richard Purdie cb249ed2f0 cmake.bbclass: Make sure EXTRA_OECMAKE has a sane default
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-21 21:43:38 +01:00
Jeff Dike 0e0830109c libproxy: Disabled webkit support
This package changed from autoconf to cmake during the last recipe
upgrade.  This made the existing EXTRA_OECONF, which disabled wekbit
support among other things, non-functional, which in turn, broke the
build.

This patch disables webkit in a CMAKE way by adding EXTRA_OECMAKE to
the cmake class description, and setting it to "-DWEBKIT=no" in the
libproxy recipe and also reproduces the EXTRA_OECONF settings.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
2010-07-21 21:23:21 +01:00
Marcin Juszkiewicz da3040f297 cmake.bbclass: added version from OE + cross-compilation support
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4688 311d38ba-8fff-0310-9ca6-ca027cbcb966
2008-06-18 08:35:24 +00:00