mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
Change TomahawkUse.cmake to make Qt5 Compilation possible
This commit is contained in:
@@ -45,6 +45,7 @@ option(WITH_BINARY_ATTICA "Enable support for downloading binary resolvers autom
|
|||||||
option(LEGACY_KDE_INTEGRATION "Install tomahawk.protocol file, deprecated since 4.6.0" OFF)
|
option(LEGACY_KDE_INTEGRATION "Install tomahawk.protocol file, deprecated since 4.6.0" OFF)
|
||||||
option(WITH_UPOWER "Build with support for UPower events" OFF)
|
option(WITH_UPOWER "Build with support for UPower events" OFF)
|
||||||
option(WITH_GNOMESHORTCUTHANDLER "Build with shortcut handler for GNOME" OFF)
|
option(WITH_GNOMESHORTCUTHANDLER "Build with shortcut handler for GNOME" OFF)
|
||||||
|
option(WITH_KDE4 "Build with support for KDE specific stuff" ON)
|
||||||
|
|
||||||
IF( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" )
|
IF( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" )
|
||||||
message(STATUS "Build of breakpad library disabled on this platform.")
|
message(STATUS "Build of breakpad library disabled on this platform.")
|
||||||
@@ -110,7 +111,6 @@ else()
|
|||||||
message( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} full GUI version ***" )
|
message( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} full GUI version ***" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if( NOT BUILD_WITH_QT4 )
|
if( NOT BUILD_WITH_QT4 )
|
||||||
find_package(Qt5Core QUIET)
|
find_package(Qt5Core QUIET)
|
||||||
if( Qt5Core_DIR )
|
if( Qt5Core_DIR )
|
||||||
@@ -145,6 +145,7 @@ if( NOT BUILD_WITH_QT4 )
|
|||||||
#FIXME: CrashReporter depends on deprecated QHttp
|
#FIXME: CrashReporter depends on deprecated QHttp
|
||||||
set(WITH_CRASHREPORTER OFF)
|
set(WITH_CRASHREPORTER OFF)
|
||||||
set(WITH_BREAKPAD OFF)
|
set(WITH_BREAKPAD OFF)
|
||||||
|
set(WITH_KDE4 OFF)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if( NOT Qt5Core_DIR )
|
if( NOT Qt5Core_DIR )
|
||||||
@@ -200,6 +201,12 @@ if( NOT Qt5Core_DIR )
|
|||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if( Qt5Core_DIR )
|
||||||
|
set( TOMAHAWK_QT5 TRUE )
|
||||||
|
else( Qt5Core_DIR )
|
||||||
|
set( TOMAHAWK_QT5 FALSE )
|
||||||
|
endif( Qt5Core_DIR )
|
||||||
|
|
||||||
if( BUILD_GUI AND UNIX AND NOT APPLE )
|
if( BUILD_GUI AND UNIX AND NOT APPLE )
|
||||||
find_package( X11 )
|
find_package( X11 )
|
||||||
endif()
|
endif()
|
||||||
@@ -209,7 +216,6 @@ IF( UNIX AND NOT APPLE AND QT_QTDBUS_FOUND )
|
|||||||
SET( WITH_GNOMESHORTCUTHANDLER ON )
|
SET( WITH_GNOMESHORTCUTHANDLER ON )
|
||||||
ENDIF( UNIX AND NOT APPLE AND QT_QTDBUS_FOUND )
|
ENDIF( UNIX AND NOT APPLE AND QT_QTDBUS_FOUND )
|
||||||
|
|
||||||
|
|
||||||
macro_optional_find_package(Phonon 4.5.0)
|
macro_optional_find_package(Phonon 4.5.0)
|
||||||
macro_log_feature(PHONON_FOUND "Phonon" "The Phonon multimedia library" "http://phonon.kde.org" TRUE "" "")
|
macro_log_feature(PHONON_FOUND "Phonon" "The Phonon multimedia library" "http://phonon.kde.org" TRUE "" "")
|
||||||
if( PHONON_FOUND )
|
if( PHONON_FOUND )
|
||||||
@@ -292,9 +298,11 @@ add_subdirectory(${THIRDPARTY_DIR}/libportfwd)
|
|||||||
|
|
||||||
#### submodules end
|
#### submodules end
|
||||||
|
|
||||||
macro_optional_find_package(KDE4)
|
|
||||||
macro_optional_find_package(KDE4Installed)
|
|
||||||
|
|
||||||
|
if (WITH_KDE4)
|
||||||
|
macro_optional_find_package(KDE4)
|
||||||
|
macro_optional_find_package(KDE4Installed)
|
||||||
|
endif(WITH_KDE4)
|
||||||
# this was used before we had FindKDE4Installed, just leaving it here to keep the flags
|
# this was used before we had FindKDE4Installed, just leaving it here to keep the flags
|
||||||
# for future kde integration
|
# for future kde integration
|
||||||
|
|
||||||
@@ -331,6 +339,11 @@ IF( NOT APPLE )
|
|||||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined" )
|
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined" )
|
||||||
ENDIF( NOT APPLE )
|
ENDIF( NOT APPLE )
|
||||||
|
|
||||||
|
# Early configure these files as we need them later on
|
||||||
|
configure_file(TomahawkUse.cmake.in "${PROJECT_BINARY_DIR}/TomahawkUse.cmake" @ONLY)
|
||||||
|
file(COPY TomahawkAddPlugin.cmake DESTINATION "${PROJECT_BINARY_DIR}")
|
||||||
|
file(COPY TomahawkAddLibrary.cmake DESTINATION "${PROJECT_BINARY_DIR}")
|
||||||
|
|
||||||
SET( TOMAHAWK_LIBRARIES tomahawklib )
|
SET( TOMAHAWK_LIBRARIES tomahawklib )
|
||||||
SET( TOMAHAWK_WIDGETS_LIBRARIES tomahawk-widgets )
|
SET( TOMAHAWK_WIDGETS_LIBRARIES tomahawk-widgets )
|
||||||
|
|
||||||
@@ -363,10 +376,6 @@ file(RELATIVE_PATH CONF_REL_INCLUDE_DIR "${CMAKE_INSTALL_FULL_CMAKEDIR}" "${CMAK
|
|||||||
configure_file(TomahawkConfig.cmake.in "${PROJECT_BINARY_DIR}/TomahawkConfig.cmake" @ONLY)
|
configure_file(TomahawkConfig.cmake.in "${PROJECT_BINARY_DIR}/TomahawkConfig.cmake" @ONLY)
|
||||||
configure_file(TomahawkConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/TomahawkConfigVersion.cmake" @ONLY)
|
configure_file(TomahawkConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/TomahawkConfigVersion.cmake" @ONLY)
|
||||||
|
|
||||||
file(COPY TomahawkUse.cmake DESTINATION "${PROJECT_BINARY_DIR}")
|
|
||||||
file(COPY TomahawkAddPlugin.cmake DESTINATION "${PROJECT_BINARY_DIR}")
|
|
||||||
file(COPY TomahawkAddLibrary.cmake DESTINATION "${PROJECT_BINARY_DIR}")
|
|
||||||
|
|
||||||
# Install the cmake files
|
# Install the cmake files
|
||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
|
@@ -1,35 +0,0 @@
|
|||||||
#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 OR NOT DEFINED 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()
|
|
||||||
|
|
||||||
|
|
||||||
if(NOT TOMAHAWK_CMAKE_DIR)
|
|
||||||
set(TOMAHAWK_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include( "${TOMAHAWK_CMAKE_DIR}/TomahawkAddLibrary.cmake" )
|
|
||||||
include( "${TOMAHAWK_CMAKE_DIR}/TomahawkAddPlugin.cmake" )
|
|
63
TomahawkUse.cmake.in
Normal file
63
TomahawkUse.cmake.in
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#FIXME: this duplicates top level cmakelists: how can we reduce code duplication?
|
||||||
|
|
||||||
|
set( TOMAHAWK_QT5 @TOMAHAWK_QT5@ )
|
||||||
|
|
||||||
|
if(TOMAHAWK_QT5)
|
||||||
|
find_package(Qt5Core)
|
||||||
|
find_package(Qt5Network)
|
||||||
|
find_package(Qt5Gui)
|
||||||
|
find_package(Qt5Sql)
|
||||||
|
|
||||||
|
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
|
||||||
|
if(BUILD_GUI OR NOT DEFINED BUILD_GUI)
|
||||||
|
find_package(Qt5Widgets)
|
||||||
|
find_package(Qt5Svg)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
macro(qt_wrap_ui)
|
||||||
|
qt5_wrap_ui(${ARGN})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(qt_add_resources)
|
||||||
|
qt5_add_resources(${ARGN})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
find_package(Qt5LinguistTools REQUIRED)
|
||||||
|
macro(qt_add_translation)
|
||||||
|
qt5_add_translation(${ARGN})
|
||||||
|
endmacro()
|
||||||
|
else(TOMAHAWK_QT5)
|
||||||
|
find_package(Qt4 COMPONENTS QtNetwork QtCore QtGui QtSql REQUIRED)
|
||||||
|
include( ${QT_USE_FILE} )
|
||||||
|
|
||||||
|
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
|
||||||
|
if(BUILD_GUI OR NOT DEFINED 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()
|
||||||
|
endif(TOMAHAWK_QT5)
|
||||||
|
|
||||||
|
|
||||||
|
if(NOT TOMAHAWK_CMAKE_DIR)
|
||||||
|
set(TOMAHAWK_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include( "${TOMAHAWK_CMAKE_DIR}/TomahawkAddLibrary.cmake" )
|
||||||
|
include( "${TOMAHAWK_CMAKE_DIR}/TomahawkAddPlugin.cmake" )
|
@@ -1,4 +1,4 @@
|
|||||||
include( ../TomahawkUse.cmake )
|
include( ${PROJECT_BINARY_DIR}/TomahawkUse.cmake )
|
||||||
|
|
||||||
setup_qt()
|
setup_qt()
|
||||||
|
|
||||||
@@ -19,4 +19,4 @@ add_subdirectory( infoplugins )
|
|||||||
|
|
||||||
# application
|
# application
|
||||||
add_subdirectory( tomahawk )
|
add_subdirectory( tomahawk )
|
||||||
add_subdirectory( crashreporter )
|
add_subdirectory( crashreporter )
|
||||||
|
Reference in New Issue
Block a user