1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-30 21:27:53 +01:00

Install CMake files for usage in external plugins

This commit is contained in:
Dominik Schmidt 2013-01-15 15:02:01 +01:00
parent 8a43c70e54
commit f128055e0b
3 changed files with 54 additions and 0 deletions

View File

@ -470,6 +470,17 @@ INSTALL( TARGETS tomahawklib
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# Install cmake config
install( FILES
TomahawkConfig.cmake
TomahawkUse.cmake
${CMAKE_SOURCE_DIR}/CMakeModules/TomahawkAddPlugin.cmake
DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/Tomahawk
)
# Install header files
file( GLOB rootHeaders "*.h" )
file( GLOB accountsHeaders "accounts/*.h" )

View File

@ -0,0 +1,13 @@
get_filename_component(Tomahawk_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set( TOMAHAWK_USE_FILE "${Tomahawk_CMAKE_DIR}/TomahawkUse.cmake")
set( TOMAHAWK_INCLUDE_DIRS "${Tomahawk_CMAKE_DIR}/../../../include/libtomahawk" )
# this is not how you do it but proper exporting of targets causes weird issues with cross-compiling for me
#TODO: we can easily write the install dir on configuration of this file
find_library(TOMAHAWK_LIBRARY "tomahawklib"
PATHS
"${Tomahawk_CMAKE_DIR}/../../../lib/"
"${Tomahawk_CMAKE_DIR}/../../../lib64/"
)
set( TOMAHAWK_LIBRARIES "${TOMAHAWK_LIBRARY}" )

View File

@ -0,0 +1,30 @@
#FIXME: this only handles qt4 and duplicates top level cmakelists: how can we reduce code duplication?
find_package(Qt4 COMPONENTS QtNetwork QtCore QtGui QtSql REQUIRED)
include( ${QT_USE_FILE} )
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
if(BUILD_GUI)
list(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" "QtUiTools" "QtSvg")
endif()
find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS})
include( ${QT_USE_FILE} )
macro(qt5_use_modules)
endmacro()
macro(qt_wrap_ui)
qt4_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt4_add_resources(${ARGN})
endmacro()
macro(qt_add_translation)
qt4_add_translation(${ARGN})
endmacro()
include( "${Tomahawk_CMAKE_DIR}/TomahawkAddPlugin.cmake" )