diff options
Diffstat (limited to 'yocto-poky/meta/recipes-devtools/cmake')
9 files changed, 320 insertions, 0 deletions
diff --git a/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.3.1.bb b/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.3.1.bb new file mode 100644 index 000000000..cb4e749d7 --- /dev/null +++ b/yocto-poky/meta/recipes-devtools/cmake/cmake-native_3.3.1.bb @@ -0,0 +1,16 @@ +require cmake.inc +inherit native + +# Using cmake's internal libarchive, so some dependencies are needed +DEPENDS += "bzip2-native zlib-native" + +SRC_URI += "\ + file://cmlibarchive-disable-ext2fs.patch \ +" + +# Disable ccmake since we don't depend on ncurses +CMAKE_EXTRACONF = "\ + -DBUILD_CursesDialog=0 \ + -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \ + -DHAVE_SYS_ACL_H=0 \ +" diff --git a/yocto-poky/meta/recipes-devtools/cmake/cmake.inc b/yocto-poky/meta/recipes-devtools/cmake/cmake.inc new file mode 100644 index 000000000..57e93ac07 --- /dev/null +++ b/yocto-poky/meta/recipes-devtools/cmake/cmake.inc @@ -0,0 +1,52 @@ +# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved +# Released under the MIT license (see packages/COPYING) + +SUMMARY = "Cross-platform, open-source make system" +HOMEPAGE = "http://www.cmake.org/" +BUGTRACKER = "http://public.kitware.com/Bug/my_view_page.php" +SECTION = "console/utils" +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://Copyright.txt;md5=3ba5a6c34481652ce573e5c4e1d707e4 \ + file://Source/cmake.h;beginline=1;endline=10;md5=341736dae83c9e344b53eeb1bc7d7bc2" + +CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV',1).split('.')[0:2])}" + +SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \ + file://support-oe-qt4-tools-names.patch \ + file://qt4-fail-silent.patch \ + " + +SRC_URI[md5sum] = "52638576f4e1e621fed6c3410d3a1b12" +SRC_URI[sha256sum] = "cd65022c6a0707f1c7112f99e9c981677fdd5518f7ddfa0f778d4cee7113e3d6" + +inherit autotools + +# Ugly hack to work around undefined OE_QMAKE_PATH_EXTERNAL_HOST_BINS variable +# and possibly missing qmake binary (qtbase-native can be removed from sysroot +# e.g. in order to upgrade it, even when there is target qtbase) + +# Fixes errors like this in cmake(-native).do_configure: +#| -- Performing Test run_pic_test - Success +#| CMake Error at tmp-eglibc/sysroots/qemuarm/usr/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:27 (message): +#| The imported target "Qt5::Core" references the file +#| +#| "/qmake" +#| +#| but this file does not exist. Possible reasons include: + +do_configure_prepend() { + sed -i 's/^find_package(Qt5Core QUIET)$/#find_package(Qt5Core QUIET)/g' ${S}/Tests/RunCMake/CMakeLists.txt + sed -i 's/^ find_package(Qt5Core REQUIRED)/# find_package(Qt5Core REQUIRED)/g' ${S}/Tests/Qt4And5Automoc/CMakeLists.txt + sed -i 's/^ find_package(Qt5Widgets QUIET NO_MODULE)/# find_package(Qt5Widgets QUIET NO_MODULE)/g' ${S}/Tests/CMakeLists.txt + sed -i 's/^find_package(Qt5Widgets QUIET)/#find_package(Qt5Widgets QUIET)/g' ${S}/Source/QtDialog/CMakeLists.txt + sed -i 's/^ find_package(Qt5Widgets REQUIRED)/# find_package(Qt5Widgets REQUIRED)/g' ${S}/Tests/QtAutoUicInterface/CMakeLists.txt + sed -i 's/^ find_package(Qt5Widgets REQUIRED)/# find_package(Qt5Widgets REQUIRED)/g' ${S}/Tests/QtAutogen/CMakeLists.txt + sed -i 's/^ find_package(Qt5Core REQUIRED)/# find_package(Qt5Core REQUIRED)/g' ${S}/Tests/QtAutogen/autorcc_depends/CMakeLists.txt +} + +# Extra flags to pass to cmake invoked by bootstrap +CMAKE_EXTRACONF = "" + +do_configure () { + ${S}/configure --prefix=${prefix} -- ${CMAKE_EXTRACONF} +} diff --git a/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake new file mode 100644 index 000000000..60014bbf2 --- /dev/null +++ b/yocto-poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake @@ -0,0 +1,18 @@ +set( CMAKE_SYSTEM_NAME Linux ) +set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE ) +set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE ) +set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE ) +set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE ) +set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} ) +set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) +set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) +set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) + +string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT}) +string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}) + +# Include the toolchain configuration subscripts +file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" ) +foreach(config ${toolchain_config_files}) + include(${config}) +endforeach() diff --git a/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch b/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch new file mode 100644 index 000000000..bf3671259 --- /dev/null +++ b/yocto-poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch @@ -0,0 +1,26 @@ +Disable use of ext2fs/ext2_fs.h by cmake's internal libarchive copy + +We don't want to add a dependency on e2fsprogs-native for cmake-native, +and we don't use CPack so just disable this functionality. + +Upstream-Status: Inappropriate [config] + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> + +--- a/Utilities/cmlibarchive/CMakeLists.txt ++++ b/Utilities/cmlibarchive/CMakeLists.txt +@@ -237,12 +237,8 @@ LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H) + LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H) + LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) + LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H) +-LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H) +- +-CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h> +-#include <ext2fs/ext2_fs.h> +-int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS) +- ++SET(HAVE_EXT2FS_EXT2_FS_H 0) ++SET(HAVE_WORKING_EXT2_IOC_GETFLAGS 0) + LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H) + LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H) + LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) diff --git a/yocto-poky/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch b/yocto-poky/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch new file mode 100644 index 000000000..0c059f12e --- /dev/null +++ b/yocto-poky/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch @@ -0,0 +1,23 @@ +cmake: don't run cross-binaries on host machine + +When doing the cross build we obviously cannot run those binaries on +host since they can be binary incompatible. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> + +Index: cmake-2.8.10.1/CMakeLists.txt +=================================================================== +--- cmake-2.8.10.1.orig/CMakeLists.txt ++++ cmake-2.8.10.1/CMakeLists.txt +@@ -588,7 +588,8 @@ mark_as_advanced(CMAKE_STRICT) + + # build the remaining subdirectories + add_subdirectory(Source) +-add_subdirectory(Utilities) ++# Come on! Running the cross-binaries on host is not a good idea. ++#add_subdirectory(Utilities) + add_subdirectory(Tests) + + if(BUILD_TESTING) diff --git a/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh b/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh new file mode 100644 index 000000000..0eb56b66f --- /dev/null +++ b/yocto-poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh @@ -0,0 +1 @@ +alias cmake="cmake -DCMAKE_TOOLCHAIN_FILE=$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake" diff --git a/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch b/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch new file mode 100644 index 000000000..80fc277fa --- /dev/null +++ b/yocto-poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch @@ -0,0 +1,77 @@ +Fail silently if system Qt installation is broken + +Fixes a regression in behaviour from 2.8.10 to 2.8.11 resulting in the +following error if the system Qt installation is broken: + +CMake Error at Modules/FindQt4.cmake:1028 (set_property): + set_property could not find TARGET Qt4::QtCore. Perhaps it has not yet + been created. +Call Stack (most recent call first): + Tests/RunCMake/CMakeLists.txt:79 (find_package) + +Upstream-Status: Pending + +Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> + +The patch was slightly adapted in order to match cmake 3.2.2: +Another set_property was introduced which had to be included +within the if(QT_QTCORE_FOUND) statement. + +Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de> +--- + Modules/FindQt4.cmake | 39 ++++++++++++++++++++------------------- + 1 file changed, 20 insertions(+), 19 deletions(-) + +diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake +index 6704769..9048e35 100644 +--- a/Modules/FindQt4.cmake ++++ b/Modules/FindQt4.cmake +@@ -1000,25 +1000,26 @@ if (QT_QMAKE_EXECUTABLE AND + endif() + endmacro() + +- +- # Set QT_xyz_LIBRARY variable and add +- # library include path to QT_INCLUDES +- _QT4_ADJUST_LIB_VARS(QtCore) +- set_property(TARGET Qt4::QtCore APPEND PROPERTY +- INTERFACE_INCLUDE_DIRECTORIES +- "${QT_MKSPECS_DIR}/default" +- ${QT_INCLUDE_DIR} +- ) +- set_property(TARGET Qt4::QtCore APPEND PROPERTY +- INTERFACE_COMPILE_DEFINITIONS +- $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG> +- ) +- set_property(TARGET Qt4::QtCore PROPERTY +- INTERFACE_QT_MAJOR_VERSION 4 +- ) +- set_property(TARGET Qt4::QtCore APPEND PROPERTY +- COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION +- ) ++ if(QT_QTCORE_FOUND) ++ # Set QT_xyz_LIBRARY variable and add ++ # library include path to QT_INCLUDES ++ _QT4_ADJUST_LIB_VARS(QtCore) ++ set_property(TARGET Qt4::QtCore APPEND PROPERTY ++ INTERFACE_INCLUDE_DIRECTORIES ++ "${QT_MKSPECS_DIR}/default" ++ ${QT_INCLUDE_DIR} ++ ) ++ set_property(TARGET Qt4::QtCore APPEND PROPERTY ++ INTERFACE_COMPILE_DEFINITIONS ++ $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG> ++ ) ++ set_property(TARGET Qt4::QtCore PROPERTY ++ INTERFACE_QT_MAJOR_VERSION 4 ++ ) ++ set_property(TARGET Qt4::QtCore APPEND PROPERTY ++ COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION ++ ) ++ endif() + + foreach(QT_MODULE ${QT_MODULES}) + _QT4_ADJUST_LIB_VARS(${QT_MODULE}) +-- +1.9.1 + diff --git a/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch b/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch new file mode 100644 index 000000000..15cbca89d --- /dev/null +++ b/yocto-poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch @@ -0,0 +1,54 @@ +cmake: support OpenEmbedded Qt4 tool binary names + +The FindQt4 module looks for Qt4 binaries to be able to gather the +paths used for compilation and also to be using during other processes +(translation update, translation binary generating and like) however +OpenEmbedded has renamed those to allow old QMake to be used in +parallel with the current one. This patch adds support for the +OpenEmbedded specific binary names. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> + +The patch was slightly adapted in order to match cmake 3.2.2: +Instead of find_program, _find_qt4_program is now used. + +Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de> +--- + Modules/FindQt4.cmake | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake +index 11091b5..6704769 100644 +--- a/Modules/FindQt4.cmake ++++ b/Modules/FindQt4.cmake +@@ -522,7 +522,7 @@ endfunction() + + set(QT4_INSTALLED_VERSION_TOO_OLD FALSE) + +-set(_QT4_QMAKE_NAMES qmake qmake4 qmake-qt4 qmake-mac) ++set(_QT4_QMAKE_NAMES qmake qmake2 qmake4 qmake-qt4 qmake-mac) + _qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION) + + if (QT_QMAKE_EXECUTABLE AND +@@ -1148,12 +1148,12 @@ if (QT_QMAKE_EXECUTABLE AND + _find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc4 moc) + _find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic4 uic) + _find_qt4_program(QT_UIC3_EXECUTABLE Qt4::uic3 uic3) +- _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc) +- _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml) +- _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp) ++ _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc4 rcc) ++ _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml4 qdbuscpp2xml) ++ _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp4 qdbusxml2cpp) + _find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate-qt4 lupdate4 lupdate) + _find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease-qt4 lrelease4 lrelease) +- _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator) ++ _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator qcollectiongenerator4) + _find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer-qt4 designer4 designer) + _find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist-qt4 linguist4 linguist) + +-- +1.9.1 + diff --git a/yocto-poky/meta/recipes-devtools/cmake/cmake_3.3.1.bb b/yocto-poky/meta/recipes-devtools/cmake/cmake_3.3.1.bb new file mode 100644 index 000000000..2f188f071 --- /dev/null +++ b/yocto-poky/meta/recipes-devtools/cmake/cmake_3.3.1.bb @@ -0,0 +1,53 @@ +require cmake.inc + +inherit cmake + +DEPENDS += "curl expat zlib libarchive xz ncurses bzip2" + +SRC_URI_append_class-nativesdk = " \ + file://OEToolchainConfig.cmake \ + file://environment.d-cmake.sh" + +# Strip ${prefix} from ${docdir}, set result into docdir_stripped +python () { + prefix=d.getVar("prefix", True) + docdir=d.getVar("docdir", True) + + if not docdir.startswith(prefix): + raise bb.build.FuncFailed('docdir must contain prefix as its prefix') + + docdir_stripped = docdir[len(prefix):] + if len(docdir_stripped) > 0 and docdir_stripped[0] == '/': + docdir_stripped = docdir_stripped[1:] + + d.setVar("docdir_stripped", docdir_stripped) +} + +EXTRA_OECMAKE=" \ + -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \ + -DCMAKE_USE_SYSTEM_LIBRARY_BZIP2=1 \ + -DCMAKE_USE_SYSTEM_LIBRARY_CURL=1 \ + -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=1 \ + -DCMAKE_USE_SYSTEM_LIBRARY_FORM=1 \ + -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=1 \ + -DCMAKE_USE_SYSTEM_LIBRARY_LIBLZMA=1 \ + -DCMAKE_USE_SYSTEM_LIBRARY_ZLIB=1 \ + -DKWSYS_CHAR_IS_SIGNED=1 \ + -DBUILD_CursesDialog=0 \ + ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-DKWSYS_LFS_WORKS=1', '-DKWSYS_LFS_DISABLE=1', d)} \ +" + +do_install_append_class-nativesdk() { + mkdir -p ${D}${datadir}/cmake + install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/ + + mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d + install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh +} + +FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}" + +FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION}" +FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}" + +BBCLASSEXTEND = "nativesdk" |