Hi all,

The attached patch against trunk adds CMake host tool support. When
CONFIG_CMAKE is set in .config, the CMake tools will be build and
installed in staging_dir/host/bin.

To enable CONFIG_CMAKE, select "Advanced configuration options (for
developers) in the main menu and select "Build CMake tool". When a
package needs CMake to build, it just needs to have the line

DEPENDS:=...@cmake

in the Makefile.

Please review this patch and add it to trunk. I'm working on creating an
OpenWRT package of Gammu (http://wammu.eu/gammu/) that needs cmake to
build, see https://dev.openwrt.org/ticket/7649

Can this patch please be added to backfire too? I'm working on a
customer project based upon backfire that needs Gammu for communication
with a GSM modem. It would be very nice to use backfire unmodified in
the project.

Thanks a lot in advance,

Regards,

-- 
Bas
Index: tools/cmake/Makefile
===================================================================
--- tools/cmake/Makefile        (revision 0)
+++ tools/cmake/Makefile        (revision 0)
@@ -0,0 +1,35 @@
+# 
+# Copyright (C) 2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/target.mk
+
+PKG_NAME:=cmake
+PKG_VERSION_MAJOR=2.8
+PKG_VERSION_MINOR=3
+PKG_VERSION:=$(PKG_VERSION_MAJOR).$(PKG_VERSION_MINOR)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.cmake.org/files/v$(PKG_VERSION_MAJOR)
+PKG_MD5SUM:=a76a44b93acf5e3badda9de111385921
+PKG_CAT:=zcat
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Compile
+       $(MAKE) CC="$(HOSTCC)" -C $(HOST_BUILD_DIR)
+endef
+
+define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) install
+endef
+
+define Host/Clean
+       -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
+       $(call Host/Clean/Default)
+endef
+
+$(eval $(call HostBuild))
Index: tools/Makefile
===================================================================
--- tools/Makefile      (revision 24012)
+++ tools/Makefile      (working copy)
@@ -26,6 +26,7 @@
 tools-y += squashfs4 lzma
 endif
 tools-$(CONFIG_CCACHE) += ccache
+tools-$(CONFIG_CMAKE) += cmake
 
 ifdef CONFIG_GCC_USE_GRAPHITE
   ifeq ($(CONFIG_GCC_USE_SYSTEM_PPL_CLOOG),)
@@ -98,5 +99,5 @@
 $(curdir)/ := .config prereq
 $(curdir)//install = $(1)/compile
 
-$(eval $(call stampfile,$(curdir),tools,install,,CONFIG_CCACHE CONFIG_powerpc 
CONFIG_GCC_VERSION_4_3 CONFIG_GCC_USE_GRAPHITE CONFIG_TARGET_orion_generic))
+$(eval $(call stampfile,$(curdir),tools,install,,CONFIG_CCACHE CONFIG_CMAKE 
CONFIG_powerpc CONFIG_GCC_VERSION_4_3 CONFIG_GCC_USE_GRAPHITE 
CONFIG_TARGET_orion_generic))
 $(eval $(call subdir,$(curdir)))
Index: Config.in
===================================================================
--- Config.in   (revision 24012)
+++ Config.in   (working copy)
@@ -393,6 +393,12 @@
                help
                  Compiler cache; see http://ccache.samba.org/
 
+       config CMAKE
+               bool "Build CMake tool" if DEVEL
+               default n
+               help
+                 CMake tool; see http://www.cmake.org/
+
        config EXTERNAL_KERNEL_TREE
                string "Use external kernel tree" if DEVEL
                default ""

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to