Build all apps into same folder, to allow dev versions to run without

install
This commit is contained in:
Craig Drummond
2018-05-16 17:01:49 +01:00
committed by Craig Drummond
parent b8526f4b2b
commit 1db2b4a02a
2 changed files with 10 additions and 0 deletions

View File

@@ -63,6 +63,11 @@ option(ENABLE_MUSICBRAINZ "Enable MusicBrianz libraries (either this or CDDB req
option(ENABLE_MTP "Enable MTP library (required to support MTP devices)" ON)
option(ENABLE_AVAHI "Enable automatic mpd server discovery" ${UNIX})
# Build all apps into top-level folder, so that can run dev versions without install
if (NOT WIN32 AND NOT APPLE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
if(ENABLE_AVAHI)
find_package(Avahi)
macro_log_feature(AVAHI_FOUND "Avahi Support" "Automatic MPD-Server Detection" "https://www.avahi.org/" FALSE "" "")

View File

@@ -742,6 +742,11 @@ QString Utils::helper(const QString &app)
#elif defined Q_OS_MAC
return fixPath(QCoreApplication::applicationDirPath())+app;
#else
// Check for helpers in same folder as main exe, so that can test dev versions without install.
QString local = fixPath(QCoreApplication::applicationDirPath())+app;
if (QFile::exists(local)) {
return local;
}
return QString(INSTALL_PREFIX "/" LINUX_LIB_DIR "/")+QCoreApplication::applicationName()+constDirSep+app;
#endif
}