Add an option to use the system qxt library

This commit is contained in:
David Sansome 2010-07-24 12:35:21 +00:00
parent e3f54b745b
commit 4b96395e7f
2 changed files with 20 additions and 6 deletions

View File

@ -112,7 +112,6 @@ if (WIN32)
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -o <OBJECT> <SOURCE> -I../../dist/windows")
endif(WIN32)
add_definitions(-DQXT_STATIC -DBUILD_QXT_GUI -DBUILD_QXT_CORE)
add_definitions(-DQT_NO_CAST_TO_ASCII)
# Translations stuff
@ -181,11 +180,26 @@ if(NOT QTIOCOMPRESSOR_INCLUDE_DIRS OR NOT QTIOCOMPRESSOR_LIBRARIES)
set(QTIOCOMPRESSOR_LIBRARIES qtiocompressor)
endif(NOT QTIOCOMPRESSOR_INCLUDE_DIRS OR NOT QTIOCOMPRESSOR_LIBRARIES)
# When/if upstream accepts our or reimplement our patches then these options can be
# used to link to system installed qxt instead.
option(USE_SYSTEM_QXT "Don't set this option unless your system Qxt library has been compiled with the Clementine patches in 3rdparty" OFF)
if (USE_SYSTEM_QXT)
find_path(QXTCORE_INCLUDE_DIRS qxtglobal.h PATH_SUFFIXES QxtCore)
find_path(QXTGUI_INCLUDE_DIRS qxtglobalshortcut.h PATH_SUFFIXES QxtGui)
set(QXT_INCLUDE_DIRS ${QXTCORE_INCLUDE_DIRS} ${QXTGUI_INCLUDE_DIRS})
# We only need its header. We don't need to link to QxtCore.
find_library(QXT_LIBRARIES QxtGui)
else (USE_SYSTEM_QXT)
if (NOT APPLE)
add_subdirectory(3rdparty/qxt)
add_definitions(-DQXT_STATIC -DBUILD_QXT_GUI -DBUILD_QXT_CORE)
set(QXT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/qxt)
set(QXT_LIBRARIES qxt)
endif (NOT APPLE)
endif (USE_SYSTEM_QXT)
# Subdirectories
add_subdirectory(src)
if (NOT APPLE)
add_subdirectory(3rdparty/qxt)
endif (NOT APPLE)
add_subdirectory(3rdparty/qtwin)
add_subdirectory(3rdparty/universalchardet)
add_subdirectory(tests)

View File

@ -7,7 +7,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${SPARKLE})
include_directories(../3rdparty/gmock/gtest/include)
include_directories(../3rdparty/qtwin)
include_directories(../3rdparty/qxt)
include_directories(${GLIB_INCLUDE_DIRS})
include_directories(${LIBXML_INCLUDE_DIRS})
@ -15,6 +14,7 @@ include_directories(${GOBJECT_INCLUDE_DIRS})
include_directories(${LIBPROJECTM_INCLUDE_DIRS})
include_directories(${QTSINGLEAPPLICATION_INCLUDE_DIRS})
include_directories(${QTIOCOMPRESSOR_INCLUDE_DIRS})
include_directories(${QXT_INCLUDE_DIRS})
cmake_policy(SET CMP0011 NEW)
include(../cmake/AddEngine.cmake)
@ -572,7 +572,7 @@ if (APPLE)
)
include_directories(${SPARKLE}/Headers)
else (APPLE)
target_link_libraries(clementine_lib qxt)
target_link_libraries(clementine_lib ${QXT_LIBRARIES})
endif (APPLE)
# Link against the qsqlite plugin on windows and mac