Patchwork [2/2] classes/cmake: add new cmake class to support cmake projects

login
register
mail settings
Submitter Jacob Kjaergaard
Date July 7, 2013, 6:38 p.m.
Message ID <5dd75bcb67df4edbad1348a7b7998d73efc4a619.1373221481.git.jacob@barsoekjaergaard.dk>
Download mbox | patch
Permalink /patch/257363/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

Jacob Kjaergaard - July 7, 2013, 6:38 p.m.
From: Jacob Kjaergaard <jacob@barsoekjaergaard.dk>

---
 classes/cmake.oeclass |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 classes/cmake.oeclass

\ No newline at end of file
Esben Haabendal - Aug. 7, 2013, 7:30 a.m.
jabk@prevas.dk writes:

> From: Jacob Kjaergaard <jacob@barsoekjaergaard.dk>
>
> ---
>  classes/cmake.oeclass |   19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>  create mode 100644 classes/cmake.oeclass
>
> diff --git a/classes/cmake.oeclass b/classes/cmake.oeclass
> new file mode 100644
> index 0000000..0d27539
> --- /dev/null
> +++ b/classes/cmake.oeclass
> @@ -0,0 +1,19 @@
> +CLASS_DEPENDS += "native:cmake"
> +
> +inherit make c c++

Is c++ really required to _use_ cmake?

> +
> +OE_CMAKE_CONF = "\
> +-DCMAKE_FIND_ROOT_PATH=${HOST_SYSROOT} \
> +-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
> +-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
> +-DCMAKE_C_COMPILER=${HOST_CC} \
> +-DCMAKE_SYSTEM_NAME=Linux \
> +-DCMAKE_INSTALL_PREFIX=$target_prefix\
> +		 "
> +
> +OE_CMAKE_CONF:>HOST_CXX = " -DCMAKE_CXX_COMPILER=${HOST_CXX}"
> +
> +do_configure() {
> +     cd ${S}
> +     cmake ${OE_CMAKE_CONF} ${EXTRA_OE_CMAKE_CONF}
> +}
> \ No newline at end of file
Esben Haabendal - Aug. 8, 2013, 8:35 p.m.
I changed slightly and pushed it to master.

/Esben

Patch

diff --git a/classes/cmake.oeclass b/classes/cmake.oeclass
new file mode 100644
index 0000000..0d27539
--- /dev/null
+++ b/classes/cmake.oeclass
@@ -0,0 +1,19 @@ 
+CLASS_DEPENDS += "native:cmake"
+
+inherit make c c++
+
+OE_CMAKE_CONF = "\
+-DCMAKE_FIND_ROOT_PATH=${HOST_SYSROOT} \
+-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
+-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
+-DCMAKE_C_COMPILER=${HOST_CC} \
+-DCMAKE_SYSTEM_NAME=Linux \
+-DCMAKE_INSTALL_PREFIX=$target_prefix\
+		 "
+
+OE_CMAKE_CONF:>HOST_CXX = " -DCMAKE_CXX_COMPILER=${HOST_CXX}"
+
+do_configure() {
+     cd ${S}
+     cmake ${OE_CMAKE_CONF} ${EXTRA_OE_CMAKE_CONF}
+}