3

I am trying to use biicode to manager dependencies for my project so that I can automate things like boost or sqlite and use travis-ci

From what I understand bii is expecting your source files to be at the root folder of your block like mentionned in their tutorials:

|-- my_project
|    +-- bii
|    +-- bin
|    +-- blocks
|    |    +-- myuser
|    |    |     +-- my_block
|    |    |     |     |-- main.cpp
|    |    |     |     |-- biicode.conf

But in my case, the source file is like this

|-- my_project
|    +-- bii
|    +-- bin
|    +-- blocks
|    |    +-- myuser
|    |    |     +-- my_block
|    |    |     |     |-- src
|    |    |     |     |    +--folderA
|    |    |     |     |    |    +--core
|    |    |     |     |    |        |-- various .cpp
|    |    |     |     |    |    +--impl
|    |    |     |     |    |        |-- various .cpp
|    |    |     |     |    |-- various .cpp
|    |    |     |     |-- biicode.conf

and running configuration keep missing these folders

bii cpp:configure

I have read the doc about biicode.conf but it doesn't mention an alternative path for source files.

So my question is, do I really need to put everything as a flat directory where every source file is in the same folder to use biicode ?

EDIT: I forgot to mention that I am trying to build a library (to be used in another bii project), not an executable

kittikun
  • 1,829
  • 1
  • 25
  • 33
  • No, you don't need to have all in the same folder. You can put inside of your `blocks/my_user/my_block` folder the files structure you want without problems. `biicode.conf`is the only file which it must be in the root directory and it's not needed to indicate the source file directories. Did you have any problem? – fenix688 Feb 20 '15 at 08:49
  • 1
    Please be sure that your code contains at least one file with a main() function, be it a test, and example. No matter if building a library, but somewhere should exist a main() that finally uses the code. It can be in other block (my_block2) and refererence the headers in my_block. The command "$bii deps --files" could be of help. As a file-base deps manager, files that are not depended on by something that can be executed, are not included in the build, I know it can be a bit unexpected at first glance, but incredibly useful when you use it. – drodri Feb 20 '15 at 10:52

1 Answers1

1

You can sort your block like you want inside your blocks/my_user/my_block. For example, take a look to this block:

fenix/flatbuffers block

Here there is a structure without any pattern.

biicode.conf, among other things, helps you to tell biicode where your header files (but not source ones) are, thanks to [paths]section, because the source ones biicode detects them automatically, else you could customize your dependencies with [dependencies]section.

Making an example with this layout:

|-- my_project
|    +-- bii
|    +-- bin
|    +-- blocks
|    |    +-- myuser
|    |    |     +-- my_block
|    |    |     |     |-- src
|    |    |     |     |    +--folderA
|    |    |     |     |    |    +--core
|    |    |     |     |    |        |-- core.h
|    |    |     |     |    |        |-- core.cpp
|    |    |     |     |    |    +--impl
|    |    |     |     |    |        |-- impl_ext.h
|    |    |     |     |    |        |-- impl.h
|    |    |     |     |    |    +--src
|    |    |     |     |    |        |-- impl.cpp
|    |    |     |     |    |        |-- impl_ext.cpp
|    |    |     |     |    |-- CMakeLists.txt
|    |    |     |     |-- biicode.conf
|    |    |     |     |-- CMakeLists.txt

Then, your .cpp files might have relative includes like:

#include "core/core.h"
#include "impl/impl.h"
#include "impl/impl_ext.h"

Supposing your CMakeLists.txt files are right, you'd only have to tell biicode where it must search this "relative" headers, so write into the biicode.conf:

[paths]
   folderA/core
   folderA/impl

I hope it resolves your doubts! ;)

fenix688
  • 2,435
  • 2
  • 17
  • 23
  • Oh yes, I forgot to mention it, but I am building a library not an executable! Does it greatly changes things ? Anyway, I will try to create a custom CMakeList.txt for each folder, thank you :) – kittikun Feb 20 '15 at 11:34
  • Don't worry, I supposed you was building a library ;) – fenix688 Feb 20 '15 at 13:29