How to add autotools-based project as biicode block?

137 views Asked by At

I need to use log4cpp in my project and I'd like to add this library as biicode block.

I read the documentation and tried to prepare the library for biicode.

I get the source of log4cpp from sourceforge's git here. log4cpp already has CMakeLists.txt, but when I tried to compile it with cmake on ubuntu linux, there was error: missing file log4cpp/config.h.

Apparently, log4cpp is autotools-based project and needs to run ./autogen.sh and then ./configure to prepare project for compilation on Ubuntu linux. When I called this commands, log4cpp/config.h file is appeared and I was able to compile project with cmake.

Then I added this code to CMakeLists.txt:

if (BIICODE)
    include(biicode.cmake)
    return()
endif()

and in biicode.cmake I added this code:

# remove tests targets
LIST(REMOVE_ITEM BII_BLOCK_EXES tests_testCategory tests_testConfig tests_testDLL tests_testDailyRollingFileAppender tests_testErrorCollision tests_testFilter tests_testFixedContextCategory tests_testNDC tests_testNDCMain tests_testNTEventLog tests_testPattern tests_testPriority tests_testPropConfig tests_testProperties tests_testPropertyConfig tests_testRollingFileAppender tests_test_convenience tests_testbench tests_testmain)

# remove unnecessary files from lib
LIST(REMOVE_ITEM BII_LIB_SRC
    tests/Clock.cpp
    tests/Clock.hh
    tests/NDCTest.hh
)

ADD_BII_TARGETS()

Now I was able to build block with bii build. But when I published this block to biicode and tried to use it in other sample project, when I run bii find, biicode download log4cpp, but not all sources (for example, RollingFileAppender.cpp is not available after downloading).

My sample project that use log4cpp:

#include "log4cpp/Category.hh"

int main()
{
    log4cpp::Category::getInstance("application");
    return 0;
}

And I was need to add this section to biicode.conf file of sample project:

[includes]
    log4cpp/*: halex2005/log4cpp/include

So, my questions is:

  • How I can prepare autotools-based project to be the biicode block in right way?
  • How to run ./auto-gen.sh and ./configure on bii configure command?
  • How to force biicode to download full list of sources for biicode block?

Thanks in advance!

0

There are 0 answers