I have a simple CMake recipe like this:
###########################
SUMMARY = “Simple helloworld cmake application”
SECTION = “examples”
LICENSE = “MIT”
LIC_FILES_CHKSUM = “file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302”
SRC_URI = “file://CMakeLists.txt
file://helloworld.c”
S = “${WORKDIR}”
inherit cmake
EXTRA_OECMAKE = “”
##########################
and the content of the CMakelists.txt is:
##########################
cmake_minimum_required(VERSION 2.8.10)
project(“Test” C)
add_executable(HelloWorldCMake helloworld.c)
install(TARGETS HelloWorldCMake RUNTIME DESTINATION bin)
##########################
I have another recipe does the same thing but i don’t use CMake
##########################
SUMMARY = “Simple helloworld application”
SECTION = “examples”
LICENSE = “MIT”
LIC_FILES_CHKSUM = “file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302”
SRC_URI = “file://helloworld.c”
S = “${WORKDIR}”
TARGET_CC_ARCH += “${LDFLAGS}”
do_compile() {
${CC} helloworld.c -o helloworld
}
do_install() {
install -d ${D}${bindir}
install -m 0755 helloworld ${D}${bindir}
}
##########################
Both recipes compile and install successfully but the executable generated by CMake recipe is much larger than that of the normal recipe.