Proposal: adding default_cmake_config and default_cmake_build functions to build.lunar
Dennis Veatch
dennisveatch at bellsouth.net
Mon May 23 13:45:10 CEST 2011
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
Again for a quick viewing;
+# 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 &&
+ echo "$SOURCE_DIRECTORY"
+ else
+ verbose_msg "running \"configuring for an in source build\""
+ echo "$SOURCE_DIRECTORY"
+ fi
+}
+
+
and
+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 $(cmake_build_target)
+} > $C_FIFO 2>&1
+
+
and
+default_cmake_build() {
+ debug_msg "default_cmake_build ($@)"
+ verbose_msg "running \"default_cmake_build\""
+ default_cmake_config &&
+ default_make
+} > $C_FIFO 2>&1
+
--
Dennis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.lunar-cmake-configure-build.03.patch
Type: text/x-patch
Size: 1845 bytes
Desc: not available
URL: <http://foo-projects.org/pipermail/lunar-dev/attachments/20110523/2e39abcb/attachment.bin>
More information about the Lunar-dev
mailing list