diff --git a/CMakeLists.txt b/CMakeLists.txt index 157fcf0ee..d483318bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,7 +304,7 @@ endif() macro_optional_find_package(Echonest 2.2.0) macro_log_feature(ECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest 2.2.0 is needed for dynamic playlists and the infosystem") -find_package(Boost REQUIRED COMPONENTS system) +find_package(Boost REQUIRED COMPONENTS filesystem system) macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++ source libraries" "http://www.boost.org" TRUE "" "") #FIXME: give useful explanation macro_optional_find_package(Lucene++ 3.0.0) diff --git a/src/tomahawk/CMakeLists.txt b/src/tomahawk/CMakeLists.txt index 11a828c4e..027af3371 100644 --- a/src/tomahawk/CMakeLists.txt +++ b/src/tomahawk/CMakeLists.txt @@ -198,6 +198,7 @@ TARGET_LINK_LIBRARIES( tomahawk_bin ${MAC_EXTRA_LIBS} ${ECHONEST_LIBRARIES} ${TAGLIB_LIBRARIES} + ${Boost_LIBRARIES} ) IF( APPLE ) diff --git a/src/tomahawk/main.cpp b/src/tomahawk/main.cpp index 14b770f09..dbcbee32d 100644 --- a/src/tomahawk/main.cpp +++ b/src/tomahawk/main.cpp @@ -43,6 +43,30 @@ #endif #include +#include + + +void +checkLocales() +{ +#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + std::locale l( "C" ); + try + { + // Check if env's locale is valid + l = std::locale( "" ); + } + catch ( const std::runtime_error& ) + { + // env's locale is invalid. Prevent boost from throwing an exception + setenv( "LC_ALL", "C", 1 ); + } + + // Needs be set by main thread + boost::filesystem::path::imbue( l ); +#endif +} + #ifdef Q_OS_WIN #include @@ -131,6 +155,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine int main( int argc, char *argv[] ) { + checkLocales(); + QCA::Initializer init; Q_UNUSED( init )