summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-03-16 20:26:53 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-03-16 20:26:53 (GMT)
commit2feadc01a56269094e6c533ca23b4357b65ab2a9 (patch)
tree6ad254cfbdce462df5bcb7baab0000a1b1e0fafb /Swiften/Config/swiften-config.cpp
parentc019d185626f6e9220f139a6e0d5543d1fc97f09 (diff)
downloadswift-2feadc01a56269094e6c533ca23b4357b65ab2a9.zip
swift-2feadc01a56269094e6c533ca23b4357b65ab2a9.tar.bz2
Some more Swiften packaging improvements & fixes.
Diffstat (limited to 'Swiften/Config/swiften-config.cpp')
-rw-r--r--Swiften/Config/swiften-config.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/Swiften/Config/swiften-config.cpp b/Swiften/Config/swiften-config.cpp
index d381faa..b3875cb 100644
--- a/Swiften/Config/swiften-config.cpp
+++ b/Swiften/Config/swiften-config.cpp
@@ -6,16 +6,15 @@
#include <iostream>
+#include <boost/algorithm/string.hpp>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/variables_map.hpp>
#include <boost/program_options.hpp>
#include <boost/version.hpp>
#include <string>
-#include <Swiften/Base/foreach.h>
#include <Swiften/Base/Platform.h>
#include <Swiften/Base/Paths.h>
-#include <Swiften/Base/String.h>
#include "swiften-config.h"
@@ -72,28 +71,34 @@ int main(int argc, char* argv[]) {
// Detect whether we're running in-place or not
boost::filesystem::path executablePath = Paths::getExecutablePath();
- boost::filesystem::path topPath = executablePath / ".." / "..";
- bool inPlace = true;
+ boost::filesystem::path topSourcePath = executablePath / ".." / "..";
+ boost::filesystem::path topInstallPath = executablePath / "..";
+ bool inPlace = !boost::filesystem::exists(topInstallPath / "include" / "Swiften" / "Swiften.h");
// Replace "#" variables with the correct path
for(size_t i = 0; i < libs.size(); ++i) {
if (inPlace) {
std::string lib = libs[i];
- String::replaceAll(lib, '#', topPath.string());
+ boost::replace_all(lib, "#", topSourcePath.string());
libs[i] = lib;
}
else {
- // TODO
+ std::string lib = libs[i];
+ boost::replace_all(lib, "#", (topInstallPath / "lib").string());
+ boost::erase_all(lib, "/Swiften");
+ libs[i] = lib;
}
}
for(size_t i = 0; i < cflags.size(); ++i) {
if (inPlace) {
std::string cflag = cflags[i];
- String::replaceAll(cflag, '#', topPath.string());
+ boost::replace_all(cflag, "#", topSourcePath.string());
cflags[i] = cflag;
}
else {
- // TODO
+ std::string cflag = cflags[i];
+ boost::replace_all(cflag, "#", (topInstallPath / "include").string());
+ cflags[i] = cflag;
}
}