1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Merge remote branch 'origin/master' into playlistinterface_ptr

This commit is contained in:
Jeff Mitchell
2011-12-28 11:54:40 -05:00
18 changed files with 69 additions and 46 deletions

View File

@@ -55,6 +55,9 @@ SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
# make predefined install dirs available everywhere
INCLUDE(GNUInstallDirs)
# installer creation
INCLUDE( TomahawkCPack.cmake )

View File

@@ -2,9 +2,9 @@ FILE( GLOB _icons "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" )
FOREACH( _file ${_icons} )
STRING( REPLACE "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-" "" _res ${_file} )
STRING( REPLACE ".png" "" _res ${_res} )
INSTALL( FILES ${_file} RENAME tomahawk.png DESTINATION share/icons/hicolor/${_res}/apps )
INSTALL( FILES ${_file} RENAME tomahawk.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${_res}/apps )
ENDFOREACH( _file )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon.svg RENAME tomahawk.svg DESTINATION share/icons/hicolor/scalable/apps )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon.svg RENAME tomahawk.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.desktop DESTINATION share/applications )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications )

View File

@@ -178,10 +178,10 @@ INCLUDE_DIRECTORIES(
SET( OS_SPECIFIC_LINK_LIBRARIES "" )
IF( WIN32 )
INCLUDE( "CMakeLists.win32.txt" )
INCLUDE( "CMakeLists.win32.cmake" )
ENDIF( WIN32 )
IF( UNIX )
INCLUDE( "CMakeLists.unix.txt" )
INCLUDE( "CMakeLists.unix.cmake" )
ENDIF( UNIX )
IF( APPLE )
@@ -206,6 +206,7 @@ IF(QCA2_FOUND)
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
ENDIF(QCA2_FOUND)
INCLUDE(GNUInstallDirs)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
@@ -271,12 +272,12 @@ IF( APPLE )
ENDIF(HAVE_SPARKLE)
ENDIF( APPLE )
INSTALL( TARGETS tomahawk BUNDLE DESTINATION . RUNTIME DESTINATION bin )
INSTALL( TARGETS tomahawk BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
IF( UNIX AND NOT APPLE AND KDE4_INSTALLED AND LEGACY_KDE_INTEGRATION ) #install protocol file
FILE( READ ${CMAKE_SOURCE_DIR}/admin/unix/tomahawk.protocol protocol )
STRING( REPLACE "/path/to/binary" # match this
"${CMAKE_INSTALL_PREFIX}/bin/tomahawk" # this is linux (kde) so pretty safe I think
"${CMAKE_INSTALL_FULL_BINDIR}/tomahawk" # this is linux (kde) so pretty safe I think
edited_protocol # save in this variable
"${protocol}" # from the contents of this var
)
@@ -284,7 +285,7 @@ IF( UNIX AND NOT APPLE AND KDE4_INSTALLED AND LEGACY_KDE_INTEGRATION ) #install
IF( ${SERVICES_INSTALL_DIR} )
SET( PROTOCOL_INSTALL_DIR ${SERVICES_INSTALL_DIR} )
ELSE()
SET( PROTOCOL_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/kde4/services" )
SET( PROTOCOL_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/kde4/services" )
ENDIF()
INSTALL( FILES ${CMAKE_BINARY_DIR}/tomahawk.protocol DESTINATION ${PROTOCOL_INSTALL_DIR} )
ENDIF()

View File

@@ -7,9 +7,9 @@ ADD_DEFINITIONS( -fPIC )
SET( QXTWEB_LIBRARIES qxtweb-standalone )
IF( APPLE )
INCLUDE( "CMakeLists.osx.txt" )
INCLUDE( "CMakeLists.osx.cmake" )
ENDIF( APPLE )
IF( UNIX AND NOT APPLE )
INCLUDE( "CMakeLists.linux.txt" )
INCLUDE( "CMakeLists.linux.cmake" )
ENDIF( UNIX AND NOT APPLE )

View File

@@ -82,14 +82,14 @@ BreakPad::BreakPad( const QString& path, bool active )
QString reporter;
QString localReporter = QString( "%1/%2" ).arg( qApp->applicationDirPath() ).arg( CRASH_REPORTER_BINARY );
QString globalReporter = QString( "%1/%2" ).arg( CMAKE_INSTALL_PREFIX "/" CMAKE_INSTALL_LIBEXECDIR ).arg( CRASH_REPORTER_BINARY );
QString globalReporter = QString( "%1/%2" ).arg( CMAKE_INSTALL_FULL_LIBEXECDIR ).arg( CRASH_REPORTER_BINARY );
if ( QFileInfo( localReporter ).exists() )
reporter = localReporter;
else if ( QFileInfo( globalReporter ).exists() )
reporter = globalReporter;
else
tLog() << "Could not find \"" CRASH_REPORTER_BINARY "\" in \"" CMAKE_INSTALL_PREFIX "/" CMAKE_INSTALL_LIBEXECDIR "\" or application path";
tLog() << "Could not find \"" CRASH_REPORTER_BINARY "\" in \"" CMAKE_INSTALL_FULL_LIBEXECDIR "\" or application path";
char* creporter;
std::string sreporter = reporter.toStdString();

View File

@@ -22,4 +22,4 @@ ADD_EXECUTABLE( tomahawk_crash_reporter WIN32 ${crashreporter_SOURCES} ${crashre
TARGET_LINK_LIBRARIES( tomahawk_crash_reporter ${QT_LIBRARIES} tomahawklib )
INCLUDE(GNUInstallDirs)
install(TARGETS tomahawk_crash_reporter RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
install(TARGETS tomahawk_crash_reporter RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_LIBEXECDIR})

View File

@@ -9,7 +9,7 @@
#cmakedefine DEBUG_BUILD
#define CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
#define CMAKE_INSTALL_LIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}"
#define CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}"
#define CMAKE_SYSTEM "${CMAKE_SYSTEM}"
#cmakedefine LION

View File

@@ -673,7 +673,7 @@ TARGET_LINK_LIBRARIES( tomahawklib
)
INSTALL( TARGETS tomahawklib
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

View File

@@ -45,24 +45,13 @@ ScriptResolver::ScriptResolver( const QString& exe )
connect( &m_proc, SIGNAL( readyReadStandardOutput() ), SLOT( readStdout() ) );
connect( &m_proc, SIGNAL( finished( int, QProcess::ExitStatus ) ), SLOT( cmdExited( int, QProcess::ExitStatus ) ) );
QString runPath = filePath();
#ifdef WIN32
// have to enclose in quotes if path contains spaces on windows...
runPath = QString( "\"%1\"" ).arg( filePath() );
#endif
if ( !QFile::exists( filePath() ) )
m_error = Tomahawk::ExternalResolver::FileNotFound;
else
m_proc.start( runPath );
startProcess();
if ( !TomahawkUtils::nam() )
return;
// set the name to the binary, if we launch properly we'll get the name the resolver reports
m_name = QFileInfo( filePath() ).baseName();
sendConfig();
}
@@ -141,15 +130,7 @@ ScriptResolver::sendConfig()
void
ScriptResolver::reload()
{
if ( !QFile::exists( filePath() ) )
m_error = Tomahawk::ExternalResolver::FileNotFound;
else
{
m_error = Tomahawk::ExternalResolver::NoError;
m_proc.start( filePath() );
sendConfig();
}
startProcess();
}
@@ -309,7 +290,7 @@ ScriptResolver::cmdExited( int code, QProcess::ExitStatus status )
{
m_num_restarts++;
tLog() << "*** Restart num" << m_num_restarts;
m_proc.start( filePath() );
startProcess();
sendConfig();
}
else
@@ -381,6 +362,41 @@ ScriptResolver::setupConfWidget( const QVariantMap& m )
}
void ScriptResolver::startProcess()
{
if ( !QFile::exists( filePath() ) )
m_error = Tomahawk::ExternalResolver::FileNotFound;
else
{
m_error = Tomahawk::ExternalResolver::NoError;
}
QFileInfo fi( filePath() );
QString interpreter;
QString runPath = filePath();
#ifdef Q_OS_WIN
if(fi.completeSuffix() == "py")
{
interpreter = "python.exe";
}
else
{
// have to enclose in quotes if path contains spaces on windows...
runPath = QString( "\"%1\"" ).arg( filePath() );
}
#endif // Q_OS_WIN
if( interpreter.isEmpty() )
m_proc.start( runPath );
else
m_proc.start( interpreter, QStringList() << filePath() );
sendConfig();
}
void
ScriptResolver::saveConfig()
{

View File

@@ -75,6 +75,8 @@ private:
void doSetup( const QVariantMap& m );
void setupConfWidget( const QVariantMap& m );
void startProcess();
QProcess m_proc;
QString m_name;
unsigned int m_weight, m_preference, m_timeout, m_num_restarts;

View File

@@ -208,7 +208,7 @@ ResolversModel::addInstalledResolvers()
QDir appDir( qApp->applicationDirPath() );
QDir libDir( CMAKE_INSTALL_PREFIX "/lib" );
QDir libexecDir( CMAKE_INSTALL_LIBEXECDIR );
QDir libexecDir( CMAKE_INSTALL_FULL_LIBEXECDIR );
QDir lib64Dir( appDir );
lib64Dir.cdUp();

View File

@@ -64,7 +64,7 @@ IF( APPLE )
# SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" )
ENDIF( APPLE )
install( TARGETS tomahawk_sipjabber DESTINATION lib${LIB_SUFFIX} )
install( TARGETS tomahawk_sipjabber DESTINATION ${CMAKE_INSTALL_LIBDIR} )
if(BUILD_GUI)
add_subdirectory(googlewrapper)

View File

@@ -29,4 +29,4 @@ target_link_libraries( tomahawk_sipgoogle
tomahawklib
)
install( TARGETS tomahawk_sipgoogle DESTINATION lib${LIB_SUFFIX} )
install( TARGETS tomahawk_sipgoogle DESTINATION ${CMAKE_INSTALL_LIBDIR} )

View File

@@ -51,4 +51,4 @@ IF( APPLE )
# SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" )
ENDIF( APPLE )
install( TARGETS tomahawk_siptwitter DESTINATION lib${LIB_SUFFIX} )
install( TARGETS tomahawk_siptwitter DESTINATION ${CMAKE_INSTALL_LIBDIR} )

View File

@@ -42,4 +42,4 @@ IF( APPLE )
# SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" )
ENDIF( APPLE )
install( TARGETS tomahawk_sipzeroconf DESTINATION lib${LIB_SUFFIX} )
install( TARGETS tomahawk_sipzeroconf DESTINATION ${CMAKE_INSTALL_LIBDIR} )

View File

@@ -48,10 +48,11 @@ ENDIF()
INSTALL( TARGETS tomahawk_portfwd
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
BUNDLE DESTINATION library
)
#INSTALL(FILES include/portfwd/portfwddllmacro.h include/portfwd/portfwd.h DESTINATION include/portfwd)
#ADD_EXECUTABLE(portfwd-demo