boost::filesystem::path
directory_containing_executable ()
{
-#if BOOST_VERSION >= 106100
return boost::dll::program_location().parent_path();
-#else
- uint32_t size = 1024;
- char buffer[size];
- if (_NSGetExecutablePath (buffer, &size)) {
- throw runtime_error ("_NSGetExecutablePath failed");
- }
-
- boost::filesystem::path path (buffer);
- path = boost::filesystem::canonical (path);
- return path.parent_path ();
-#endif
}
#
-# Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+# Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
#
# This file is part of DCP-o-matic.
#
if conf.env.TARGET_LINUX:
conf.env.LIB_X11 = ['X11']
+ # We support older boosts on Linux so we can use the distribution-provided package
+ # on Centos 7, but it's good if we can use 1.61 for boost::dll::program_location()
+ boost_version = ('1.45', '104500') if conf.env.TARGET_LINUX else ('1.61', '106800')
+
# Boost
if conf.options.static_boost:
conf.env.STLIB_BOOST_THREAD = ['boost_thread']
else:
conf.check_cxx(fragment="""
#include <boost/version.hpp>\n
- #if BOOST_VERSION < 104500\n
+ #if BOOST_VERSION < %s\n
#error boost too old\n
#endif\n
int main(void) { return 0; }\n
- """,
+ """ % boost_version[1],
mandatory=True,
- msg='Checking for boost library >= 1.45',
+ msg='Checking for boost library >= %s' % boost_version[0],
okmsg='yes',
- errmsg='too old\nPlease install boost version 1.45 or higher.')
+ errmsg='too old\nPlease install boost version %s or higher.' % boost_version[0])
conf.check_cxx(fragment="""
#include <boost/thread.hpp>\n