Proposal: adding default_cmake_config and default_cmake_build functions to build.lunar
Dennis Veatch
dennisveatch at bellsouth.net
Fri May 27 22:31:06 CEST 2011
On Monday, May 23, 2011 7:45:10 AM you wrote:
> On Sunday, May 22, 2011 3:46:19 PM Auke Kok wrote:
> > On 05/22/2011 07:15 AM, Dennis Veatch wrote:
> > > On Saturday, May 21, 2011 2:46:04 PM Auke Kok wrote:
> > >> throw in a free 0x20 will ya?
> > >
> > > Where?
> >
> > before the &&, but you fixed it in the patch.
> >
> > >> _______________________________________________
> > >
> > > Stab #2 is attached and here for your viewing pleasure (not responsible
> > > for hosed appearance here);
> >
> > this looks a bit better, the one thing I'd like to get rid of is the
> > `obscure` call to a function without arguments ->
> >
> > > +
> > > + _cmake_build_type
> > > + cmake -DCMAKE_INSTALL_PREFIX=$MODULE_PREFIX \
> > > + -DCMAKE_BUILD_TYPE=RELEASE \
> > > + $OPTS \
> > > + $BUILD_TYPE
> > > +}> $C_FIFO 2>&1
> >
> > not only is it unclear what it does here, it also sets a global variable
> > that is rather unspecifically named.
>
> Ok. I'll ride that thought train.
>
> > try writing a function that just puts the build location on stdout
> >
> > cmake_build_target()
> > {
> >
> > ....
> > echo "."
> >
> > }
>
> Good point. Opted to echo $SOURCE_DIRECTORY since it will always point to
> the tld and an out of source build will always need to look there (at
> least for cmake dependent modules).
>
> > and then reference it inline
> >
> > cmake ...... $(cmake_build_target)
> >
> > Auke
>
Here is another go at it; should be much closer to the zen of Unix.
diff --git a/var/lib/lunar/functions/build.lunar
b/var/lib/lunar/functions/build.lunar
index 4efda36..c743d90 100644
--- a/var/lib/lunar/functions/build.lunar
+++ b/var/lib/lunar/functions/build.lunar
@@ -163,6 +163,19 @@ _configure()
}
+# cmake can be run two ways: in source and out of source. The determinante
method is
+# to look for a cmake macro, if it exists then do out of source.
+cmake_build_target() {
+ debug_msg "cmake_build_target ($@)"
+ if [ -e cmake/modules/MacroEnsureOutOfSourceBuild.cmake ]; then
+ verbose_msg "running \"Out of source build is required; configuring\""
+ OOSB_DIR="$SOURCE_DIRECTORY/$MODULE-oosb" &&
+ mkdir $OOSB_DIR &&
+ cd $OOSB_DIR
+ fi
+}
+
+
default_config() {
debug_msg "default_config ($@)"
verbose_msg "running \"default_config\""
@@ -206,6 +219,19 @@ default_cvs_config() {
} > $C_FIFO 2>&1
+default_cmake_config() {
+ debug_msg "default_cmake_config ($@)"
+ verbose_msg "running \"default_cmake_config\""
+ verbose_msg "MODULE_PREFIX=\"$MODULE_PREFIX\""
+
+ cmake_build_target
+
+ cmake -DCMAKE_INSTALL_PREFIX=$MODULE_PREFIX \
+ -DCMAKE_BUILD_TYPE=RELEASE \
+ $OPTS $SOURCE_DIRECTORY
+} > $C_FIFO 2>&1
+
+
default_make() {
debug_msg "default_make ($@)"
verbose_msg "running \"default_make\""
@@ -223,6 +249,13 @@ default_game_build() {
} > $C_FIFO 2>&1
+default_cmake_build() {
+ debug_msg "default_cmake_build ($@)"
+ verbose_msg "running \"default_cmake_build\""
+ default_cmake_config &&
+ default_make
+} > $C_FIFO 2>&1
+
default_build() {
debug_msg "default_build ($@)"
verbose_msg "running \"default_build\""
--
Dennis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.lunar-cmake-configure-build.04.patch
Type: text/x-patch
Size: 1678 bytes
Desc: not available
URL: <http://foo-projects.org/pipermail/lunar-dev/attachments/20110527/98c8d0f1/attachment.bin>
More information about the Lunar-dev
mailing list