[Omake] Re: can't get vmount to work

Jesper Eskilson jesper at eskilson.se
Mon May 28 05:57:33 PDT 2007


2007/5/25, David Kågedal <davidk at lysator.liu.se>:
> Jesper Eskilson <jesper at eskilson.se> writes:
>
> > Hi all,
> >
> > I can't get my "variant build" to work. The directory structure looks
> > like this:
> >
> > /OMakeroot
> > /OMakefile
> > /WinUtil/OMakefile
> >         /src/OMakefile                # empty
> >             /src1.cpp
> >             /src2.cpp
> >
> >         /Legacy/OMakefile     # empty
> >                /src3.cpp
> >                /src4.cpp
> >
> >
> > The top-level OMakefile looks like this:
> >
> >> .PHONY: all install clean
> >> CXXFLAGS += /EHsc /MDd /DTRACING_ON /Od
> >> vmount(WinUtil, .omake-build/Debug/WinUtil)
> >> .SUBDIRS: .omake-build/Debug/WinUtil
> >
> > and WinUtil/OMakefile looks like this:
> >
> >> LIBFILES[] =
> >>   src/src1.cpp
> >>   src/src2.cpp
> >>   Legacy/src3.cpp
> >>   Legacy/src4.cpp
> >> LIB = WinUtil
>
> It's been a while since I actually did anything with omake, but...
>
> To get vmounted file references work, you need to make sure that file
> names are treated as such, and not as strings.
>
> Does it help to use $(file src/src.cpp) etc instead?

Well, yes. That gets the source files recognized properly. But I'm
still having some trouble in getting references to the source
directory to get resolved properly. I need to add an include path
relative to the source dir:

INCLUDES += $(dir src)

will when compiling stuff in src resolve to "." and ../Legacy. I need
them to resolve to the source directory. If the build directory is

   build-dir/Debug/Project/src

and the source directory is

  Project/src

I need them to resolve to

  ../../../../Project/src

I can fix this by setting

  SOURCE_DIR=$(dir .)

in the top-level OMakefile, and

  INCLUDES += $(dir $(SOURCE_DIR)/Project/src)

in Project/OMakefile, but it would be nice if there was a more elegant solution.

-- 
/Jesper


More information about the Omake mailing list