mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-19 12:21:52 +02:00
Install CMake files for usage in external plugins
This commit is contained in:
@@ -470,6 +470,17 @@ INSTALL( TARGETS tomahawklib
|
|||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
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
|
# Install header files
|
||||||
file( GLOB rootHeaders "*.h" )
|
file( GLOB rootHeaders "*.h" )
|
||||||
file( GLOB accountsHeaders "accounts/*.h" )
|
file( GLOB accountsHeaders "accounts/*.h" )
|
||||||
|
13
src/libtomahawk/TomahawkConfig.cmake
Normal file
13
src/libtomahawk/TomahawkConfig.cmake
Normal 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}" )
|
30
src/libtomahawk/TomahawkUse.cmake
Normal file
30
src/libtomahawk/TomahawkUse.cmake
Normal 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" )
|
Reference in New Issue
Block a user