You will need to make your own macro to do conditional compilation (or control it somehow with your build system). For example:
#ifdef MYPROJ_HAS_BOOST
# include <boost/filesystem.hpp>
#endif
Then compile with -DMYPROJ_HAS_BOOST
(or not).
You can't rely on BOOST_VERSION
or anything else from Boost, because you don't know if you have Boost. You could make a fake <boost/version.hpp>
header file on systems where you don't have Boost, but that's sort of weird and no better than making your own project-specific macro.
Some compilers will let you #include <boost/version.hpp
and only warn if it is not found; this may work but will give a dangerous-looking warning on systems without Boost, and may even fail outright.