[Omake] OMake compilation with sub-directories
Maksim Kneller
mknell01 at gmail.com
Mon Jul 6 20:57:51 PDT 2009
Aleksey,
Fantastic, everything works now. Thank you very much!
Aleksey Nogin wrote:
> On 06.07.2009 11:22, maksim.kneller at barclayscapital.com wrote:
>
>
>> [...] it seems whenever sources from
>> subdirectories are used - they are always compiled into static libraries
>> first.
>>
>
> Maksim,
>
> It is *not* the case that you have to compile into static libraries, but
> the default assumption is that each object file goes into the same
> directory as the source file.
>
> Below is how you'd need to rewrite the OMakefile for your project.
>
>
>> CXXFLAGS = -Wall
>>
>
> Offtopic - you may also want to use -Werror, so that it's easier to use
> OMake's -p/-k/-P options without having to scroll back to find all the
> warnings.
>
>
>> INCLUDES += headers src
>>
>
> INCLUDES is only for the header files. You need
>
> INCLUDES += $(dir headers)
> .SUBDIRS: src
>
> (Note1 - the order of the previous two lines is important. The way I
> wrote it, the src dir would get the updated INCLUDES; if you do not want
> that, reorder the two.)
>
> (Note2 - the above would expect an src/OMakefile file, even though an
> empty one would do. You could write something like
>
> .SUBDIRS: src
> return # A no-op body
>
> to "inline" the ./src/OMakefile into the ./OMakefile)
>
>
>> CXXProgram(myapp, main file1 )
>>
>
> Should be src/file1.
>
> Hope this helps.
>
> Aleksey
>
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.metaprl.org/pipermail/omake/attachments/20090706/f2e9fccf/attachment.htm
More information about the Omake
mailing list