I am using boost.build to compile a c++ code which references a library, CGNS, but am having some difficulty with using boost.build to do so. CGNS compiles to a library, with a folder for the platform, for example [path]/LINUX for the linux build. I would like to include the library [path]/LINUX/libcgns.a in the build. I would like this to be cross-platform, so that the LINUX directory is referenced for LINUX builds and the WIN directory is used for WIN builds (I believe there are platform conditionals for this).
I managed to include the library header files, but how do I go about the conditional include of the library? My simple test Jamroot.jam, where main.cpp is just an example from the CGNS docs.
exe CGNSTest
: src/main.cpp
: <include>../Dependencies/cgnslib ;
Also, I would like to build in the CGNS library into my binary (static reference?)
Using two references, http://www.highscore.de/cpp/boostbuild/, and http://www.boost.org/doc/tools/build/doc/userman.pdf, I created something that works, but it may not be the ideal.
lib cgns
: # sources
: # requirements
<name>cgns
<target-os>linux:<search>../Dependencies/cgnslib/LINUX
<target-os>windows:<search>../Dependencies/cgnslib/WIN32
: # default-build
: # usage-requirements
<include>./../Dependencies/cgnslib ;
alias static_libraries : cgns : <link>static ;
exe CGNSTest
: src/main.cpp static_libraries
: <target-os>windows:<linkflags>/NODEFAULTLIB:MSVCRTD ;