From 6f76342d14c7b7ec7b9629fcfd40199bca1e5e0f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 10 Jul 2012 12:24:08 +0300 Subject: [PATCH] Make install_location a path --- source/csourcefile.cpp | 2 +- source/datafile.cpp | 2 +- source/installedfile.cpp | 2 +- source/sharedlibrary.cpp | 5 +---- source/target.h | 4 ++-- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/source/csourcefile.cpp b/source/csourcefile.cpp index 8240278..3c3aad9 100644 --- a/source/csourcefile.cpp +++ b/source/csourcefile.cpp @@ -19,7 +19,7 @@ CSourceFile::CSourceFile(Builder &b, const Component &c, const FS::Path &p): { string ext = FS::extpart(FS::basename(path)); if(ext==".h" || ext==".H" || ext==".hpp") - install_location = "include/"+component->get_name(); + install_location = FS::Path("include")/component->get_name(); } void CSourceFile::find_depends() diff --git a/source/datafile.cpp b/source/datafile.cpp index 9a47703..2e9a7e5 100644 --- a/source/datafile.cpp +++ b/source/datafile.cpp @@ -10,7 +10,7 @@ DataFile::DataFile(Builder &b, const Component &c, File &s): { add_depend(&source); - install_location = "share/"+package->get_name(); + install_location = Msp::FS::Path("share")/package->get_name(); } Msp::FS::Path DataFile::generate_target_path(const Component &comp) diff --git a/source/installedfile.cpp b/source/installedfile.cpp index 0928386..a71bcba 100644 --- a/source/installedfile.cpp +++ b/source/installedfile.cpp @@ -25,7 +25,7 @@ FS::Path InstalledFile::generate_target_path(const FS::Path &prefix, const FileT if(!tgt.is_installable() && loc.empty()) throw invalid_argument(tgt.get_name()+" is not installable"); - string mid; + FS::Path mid; if(!loc.empty()) mid = loc; else diff --git a/source/sharedlibrary.cpp b/source/sharedlibrary.cpp index 24e0e20..9b2fdbb 100644 --- a/source/sharedlibrary.cpp +++ b/source/sharedlibrary.cpp @@ -22,10 +22,7 @@ SharedLibrary::SharedLibrary(Builder &b, const Component &c, const listget_type()==Component::MODULE) - { - install_location += '/'; - install_location += package->get_name(); - } + install_location /= package->get_name(); const string &version = component->get_package().get_version(); if(!version.empty()) diff --git a/source/target.h b/source/target.h index a69ff51..885ef4b 100644 --- a/source/target.h +++ b/source/target.h @@ -45,7 +45,7 @@ protected: const Tool *tool; State state; std::string rebuild_reason; - std::string install_location; + Msp::FS::Path install_location; Dependencies depends; @@ -88,7 +88,7 @@ public: void force_rebuild(); bool is_installable() const { return !install_location.empty(); } - const std::string &get_install_location() const { return install_location; } + const Msp::FS::Path &get_install_location() const { return install_location; } void add_depend(Target *); const Dependencies &get_depends() const { return depends; } -- 2.45.2