Bakefile Tutorial (2/4)

The full example is available from our Codeplex repository at Bakefile/Basics/Library1/Library1.bkl.

File: Bakefile/Basics/Library1/Library1.bkl
toolsets = vs2003 vs2012 vs2013 gnu;

vs2003.solutionfile = VC71/Library1.sln;
vs2012.solutionfile = VC11/Library1.sln;
vs2013.solutionfile = VC12/Library1.sln;
gnu.makefile = GNUMake/GNUMakefile;

library Library1
{
    headers
    {
        library1.h
    }

    sources
    {
        library1.cpp
    }
}
#ifndef _TUTORIALS_BAKEFILE_LIBRARY1_H_
#define _TUTORIALS_BAKEFILE_LIBRARY1_H_

void PrintHelloWorld();

#endif
#include "Library1.h"
#include <iostream>

void PrintHelloWorld()
{
    std::cout << "Hello World!" << std::endl;
}

The full example is available from our Codeplex repository at Bakefile/Basics/Library2/Library2.bkl.

toolsets = vs2003 vs2012 vs2013 gnu;

vs2003.solutionfile = VC71/Library2.sln;
vs2012.solutionfile = VC11/Library2.sln;
vs2013.solutionfile = VC12/Library2.sln;
gnu.makefile = GNUMake/GNUMakefile;

program LibraryClient2
{
    sources
    {
        main.cpp
    }

    deps = Library2;
}

library Library2
{
    headers
    {
        library2.h
    }

    sources
    {
        library2.cpp
    }
}
#include "library2.h"

int main(int argc, char* argv[])
{
    PrintHelloWorld();
    return 0;
}
#ifndef _TUTORIALS_BAKEFILE_LIBRARY2_H_
#define _TUTORIALS_BAKEFILE_LIBRARY2_H_

void PrintHelloWorld();

#endif
#include "Library2.h"
#include <iostream>

void PrintHelloWorld()
{
    std::cout << "Hello World!" << std::endl;
}

blog comments powered by Disqus

Copyright(c) 2006-2017 Xavier Leclercq | Privacy policy

Home
Contact Us
Search