2

I'm writing a program using boost program_options, I followed this instruction: http://www.boost.org/doc/libs/1_47_0/more/getting_started/unix-variants.html#build-a-simple-program-using-boost and everythings is fine. The point now is that I want to distribute the source, so my problem is how to find where the boost libraries are installed on other linux machines (supposing they are). For example on my pc they are in /usr/lib64 but on the other machine they're installed in non-standard places.

I don't want to use tool like autotools, I'm using a simple plain Makefile.

Is there some tool provided with the boost installation to find where the libraries are? Is there some enviroment variables?

1
  • 2
    You can't do it with a simple plain Makefile. You need something like autotools. Sep 3, 2011 at 17:07

1 Answer 1

3

You either need to use a tool like autotools (I thoroughly recommend CMake, it's awesome), or have it available in a place that your compiler can find it. You can't configure everyone's system for them though, so usually the latter is insufficient.

3
  • how cmake, and autools find where the libraries are? Is there a way to reimplement this? Sep 3, 2011 at 17:33
  • @wiso CMake has a bunch of predefined modules that can usually work out where they are installed on a system. So in your CMake file you tell it to find_package(Boost... and it puts the location of the files in some magic variables like Boost_LIBRARIES so you can add them to a target. I'm sure there are examples on this site for how to set it up.
    – Tom Kerr
    Sep 3, 2011 at 17:40
  • @Tom: my question was not "how to use cmake to...?", but "how to do waht cmake do". I can't use cmake, it's not installed on the final machines, and I can't install it. There is not an executable like: find-boost-lib installed with the boost libraries? For example the ROOT libraries provide root-config executable to find where they are installed. Sep 3, 2011 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.