diff options
author | Tomás Touceda <chiiph@leap.se> | 2014-09-22 13:04:00 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2014-09-22 13:04:00 -0300 |
commit | c354574a57fcd4942beb8fe78f810194fa63ec7a (patch) | |
tree | 6bbf48419eb81290a8f26989e0d4226ac2d8c9c5 | |
parent | f3602cd5a58511a48ce572868d1369f2fb94e1ff (diff) | |
parent | 4615bd0e23288c2d5943c95babcad80305ad6f4b (diff) |
Merge remote-tracking branch 'refs/remotes/meskio/bug/6104_select_libqt' into develop
-rw-r--r-- | src/main.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp index 78aba3a..eb709e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,10 +3,13 @@ #include <string> #include <cmath> #include <cstdlib> +#include <unistd.h> #include <boost/python.hpp> +#define BOOST_NO_CXX11_SCOPED_ENUMS #include <boost/filesystem/operations.hpp> #include <boost/filesystem/path.hpp> +#undef BOOST_NO_CXX11_SCOPED_ENUMS #include <boost/algorithm/string/predicate.hpp> #include <frameobject.h> @@ -121,23 +124,25 @@ main(int argc, char** argv) auto pypath = full_path.string() + "/apps/:" + full_path.string() + "/lib/"; std::cout << pypath << std::endl; #if not defined _WIN32 && not defined _WIN64 - fs::path fromCore("./lib/libQtCore.so.4"); - fs::path toCore("./lib/libQtCore.NOTUSED"); - fs::path fromGui("./lib/libQtGui.so.4"); - fs::path toGui("./lib/libQtGui.NOTUSED"); + chdir("lib"); + fs::path fromCore("libQtCore.non-ubuntu"); + fs::path toCore("libQtCore.so.4"); + fs::path fromGui("libQtGui.non-ubuntu"); + fs::path toGui("libQtGui.so.4"); try { auto desk = std::string(getenv("DESKTOP_SESSION")); if(boost::starts_with(desk, "ubuntu")) { - fs::rename(fromCore, toCore); - fs::rename(fromGui, toGui); + fs::remove(toCore); + fs::remove(toGui); } else { - fs::rename(toCore, fromCore); - fs::rename(toGui, fromGui); + fs::create_symlink(fromCore, toCore); + fs::create_symlink(fromGui, toGui); } } catch(...) { } + chdir(".."); setenv("PYTHONPATH", pypath.c_str(), 1); #endif |