aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/cmake.bbclass
AgeCommit message (Collapse)Author
2016-10-12classes/externalsrc: re-run do_configure when configure files changepaule/externalsrc-configurePaul Eggleton
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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-09-08cmake.bbclass: avoid treating imports as system includesAndreas Müller
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 Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-23cmake.bbclass: call cmake with a relative pathThomas Witt
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. 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>
2016-07-07classes/cmake: enable progress for do_compilePaul Eggleton
cmake outputs percentage complete as part of its compilation process, so we can enable BitBake's new progress scanning for do_compile here. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-19Revert "cmake.bbclass: set the modules directory correctly"Richard Purdie
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
2016-06-17cmake.bbclass: set the modules directory correctlyJose Pardeiro
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. Signed-off-by: Jose Pardeiro <jpardeiro@rapyuta-robotics.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13cmake: enable verbose buildsRoss Burton
To help debugging build problems pass VERBOSE=1 to make so that the makefiles print their commands, just like we do with autotools. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19base.bbclass: Introduce PACKAGECONFIG_CONFARGS variableMartin Jansa
* 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 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-02-18cmake: don't inherit autotoolsRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16cmake.bbclass: don't duplicate CMAKE_C_FLAGS in CMAKE_C_FLAGS_RELEASEAndre McCurdy
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 Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-24classes/cmake: add arch conversion routineAlexander Kanavin
cmake expects target architecture strings in the format of uname(2), which do not always match TARGET_ARCH (e.g. powerpc vs ppc). Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-02cmake bbclass: fix support for native buildsKoen Kooi
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. Signed-off-by: Koen Kooi <koen.kooi@linaro.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-11cmake: extend CMAKE_MODULE_PATH instead of settingRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-08cmake: Whitespace fixMoritz Blume
Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05cmake: supply CMAKE_AR in toolchain fileCody P Schafer
Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-10-30cmake: Try and improve cleaning of builds when B==SRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-22cmake.bbclass : Add support for cmake projects that use .S files.Philip Balister
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. Signed-off-by: Philip Balister <philip@balister.org>
2014-08-15cmake: drop -fpermissiveMartin Jansa
* 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 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-25cmake.bbclass: restore OECMAKE_SOURCEPATHRoss Burton
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> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-22cmake.bbclass: fix note when warning about deprecated variablesRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14cmake: specify all install pathsRoss Burton
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). Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14cmake: default to out-of-tree buildsRoss Burton
Set B=${WORKDIR}/build in cmake.bbclass so that recipes using cmake.bbclass do out-of-tree builds by default. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-01-14cmake: respect ${S} and ${B}Ross Burton
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. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-09-10cmake.bbclass: ensure CMAKE_SYSTEM_NAME is correctSaul Wold
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] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-08cmake: set system name correctlyRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16cmake.bbclass: Don't use packages from the native build machineStefan Herbrechtsmeier
Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-29cmake.bbclass: modify construction of compiler flagsJoe Slater
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. 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-02-04cmake: reset B from autotools, as this class doesnt like itRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-11-18cmake.bbclass: use DEPENDS_prepend instead of += for cmake-nativeRoss Burton
Otherwise when a recipe using DEPENDS=, the cmake-native dependency disappears. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-11cmake.bbclass: Add OECMAKE_C_LINK_FLAGS and OECMAKE_CXX_LINK_FLAGS variablesKhem Raj
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 Signed-off-by: Khem Raj <raj.khem@gmail.com>
2012-03-12cmake.bbclass: add ${base_libdir} to CMAKE_LIBRARY_PATHNitin A Kamble
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. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-03Add EXTERNAL_TOOLCHAIN to CMAKE_FIND_ROOT_PATHKen Werner
This allows cmake to find the binaries of an external toolchain. Signed-off-by: Ken Werner <ken.werner@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-28cmake.bbclass: adding extendable extra variable to root pathAndrew Gabbasov
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. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-08-16cmake.bbclass, perlnative.bbclass: arrange for cmake to find perl-nativePhil Blundell
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. Signed-off-by: Phil Blundell <philb@gnu.org>
2011-07-27 cmake.bbclass: add ${libdir} for multilib caseYu Ke
Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-07-13sat-solver: fix for non /usr/lib libdir caseYu Ke
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. Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-07-08cmake.bbclass: use CPPFLAGS and CXXFLAGSOtavio Salvador
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. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-11cmake.bbclass: fix qmake and rpath issuesOtavio Salvador
Sync with OE at 3b7d83362027fde4f6850533ab83277d95dda961 however without changing the way of generating the toolchain file and making it branding agnostic. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2010-08-31cmake.bbclass: sync from openembeddedQing He
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-27cmake.bbclass: sync from openembeddedQing He
this fixes: - toolchain detection error (e.g. ar and ranlib) - cmake modules search path Signed-off-by: Qing He <qing.he@intel.com>
2010-07-27cmake: only search root directory for FIND_***Kevin Tian
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-21cmake.bbclass: Make sure EXTRA_OECMAKE has a sane defaultRichard Purdie
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-21libproxy: Disabled webkit supportJeff Dike
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>
2008-06-18cmake.bbclass: added version from OE + cross-compilation supportMarcin Juszkiewicz
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4688 311d38ba-8fff-0310-9ca6-ca027cbcb966