2010-02-28 18:28:56 +01:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
|
|
|
|
include(FindPkgConfig)
|
|
|
|
|
2010-03-02 21:46:46 +01:00
|
|
|
if (CMAKE_FIND_ROOT_PATH)
|
|
|
|
# Help find the Qt headers if we're cross compiling (since we can't run qmake.exe)
|
|
|
|
# CMAKE_FIND_ROOT_PATH should get set by your cmake toolchain file
|
|
|
|
set(QT_HEADERS_DIR ${CMAKE_FIND_ROOT_PATH}/include)
|
|
|
|
set(QT_LIBRARY_DIR ${CMAKE_FIND_ROOT_PATH}/lib)
|
|
|
|
set(QT_PHONON_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include/phonon)
|
|
|
|
endif (CMAKE_FIND_ROOT_PATH)
|
|
|
|
|
2010-02-28 18:28:56 +01:00
|
|
|
find_package(Qt4 REQUIRED)
|
|
|
|
set(QT_USE_QTOPENGL 1)
|
|
|
|
set(QT_USE_QTSQL 1)
|
|
|
|
set(QT_USE_QTNETWORK 1)
|
|
|
|
set(QT_USE_QTXML 1)
|
2010-03-03 01:33:31 +01:00
|
|
|
set(QT_USE_QTTEST 1)
|
2010-03-22 15:27:54 +01:00
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
set(QT_USE_QTDBUS 1)
|
|
|
|
endif(UNIX AND NOT APPLE)
|
2010-02-28 18:28:56 +01:00
|
|
|
if(WIN32)
|
|
|
|
set(QT_USE_PHONON 1)
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
find_package(Boost REQUIRED)
|
|
|
|
|
2010-03-02 21:46:46 +01:00
|
|
|
if(WIN32)
|
|
|
|
find_library(TAGLIB_LIBRARIES tag)
|
|
|
|
else(WIN32)
|
|
|
|
pkg_check_modules(TAGLIB taglib)
|
|
|
|
pkg_check_modules(XINE libxine)
|
|
|
|
pkg_check_modules(LIBNOTIFY libnotify)
|
|
|
|
endif(WIN32)
|
2010-02-28 18:28:56 +01:00
|
|
|
|
|
|
|
if (NOT Boost_FOUND)
|
|
|
|
message(FATAL_ERROR "Boost not found")
|
|
|
|
endif (NOT Boost_FOUND)
|
|
|
|
|
|
|
|
if (LIBNOTIFY_FOUND)
|
|
|
|
add_definitions(-DHAVE_LIBNOTIFY)
|
|
|
|
link_directories(${LIBNOTIFY_LIBRARY_DIRS})
|
|
|
|
include_directories(${LIBNOTIFY_INCLUDE_DIRS})
|
|
|
|
endif (LIBNOTIFY_FOUND)
|
|
|
|
|
|
|
|
find_library(LASTFM_LIBRARY_DIRS lastfm)
|
|
|
|
find_path(LASTFM_INCLUDE_DIRS lastfm/ws.h)
|
|
|
|
|
2010-03-01 13:13:11 +01:00
|
|
|
if (APPLE)
|
|
|
|
find_library(GROWL Growl)
|
|
|
|
endif (APPLE)
|
|
|
|
|
2010-02-28 18:28:56 +01:00
|
|
|
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
|
|
|
add_definitions(-DNDEBUG)
|
|
|
|
add_definitions(-DQT_NO_DEBUG_OUTPUT)
|
|
|
|
endif(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
|
|
|
|
|
|
|
# Set up definitions and paths
|
|
|
|
add_definitions(${QT_DEFINITIONS})
|
|
|
|
link_directories(${TAGLIB_LIBRARY_DIRS})
|
|
|
|
link_directories(${XINE_LIBRARY_DIRS})
|
|
|
|
link_directories(${LASTFM_LIBRARY_DIRS})
|
|
|
|
|
|
|
|
include(${QT_USE_FILE})
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
include_directories(${TAGLIB_INCLUDE_DIRS})
|
|
|
|
include_directories(${XINE_INCLUDE_DIRS})
|
|
|
|
include_directories(${LASTFM_INCLUDE_DIRS})
|
2010-03-23 14:54:17 +01:00
|
|
|
include_directories("3rdparty/qsqlite")
|
2010-02-28 18:28:56 +01:00
|
|
|
|
2010-03-02 21:46:46 +01:00
|
|
|
# Remove GLU and GL from the link line - they're not really required
|
|
|
|
# and don't exist on my mingw toolchain
|
|
|
|
list(REMOVE_ITEM QT_LIBRARIES "-lGLU -lGL")
|
|
|
|
|
2010-03-02 23:02:43 +01:00
|
|
|
if (WIN32)
|
|
|
|
# RC compiler
|
|
|
|
string(REPLACE "gcc" "windres" CMAKE_RC_COMPILER_INIT ${CMAKE_C_COMPILER})
|
2010-03-04 17:50:27 +01:00
|
|
|
enable_language(RC)
|
2010-03-02 23:02:43 +01:00
|
|
|
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -o <OBJECT> <SOURCE>")
|
|
|
|
endif(WIN32)
|
|
|
|
|
2010-02-28 18:28:56 +01:00
|
|
|
# Subdirectories
|
|
|
|
add_subdirectory(3rdparty/qtsingleapplication)
|
|
|
|
add_subdirectory(3rdparty/qxt)
|
|
|
|
add_subdirectory(src)
|
2010-03-01 02:47:50 +01:00
|
|
|
|
|
|
|
add_subdirectory(tests)
|
2010-03-04 17:41:14 +01:00
|
|
|
|
2010-03-22 19:35:31 +01:00
|
|
|
if (WIN32)
|
|
|
|
add_definitions(-DQT_STATICPLUGIN)
|
|
|
|
add_subdirectory(3rdparty/qsqlite)
|
|
|
|
endif(WIN32)
|
|
|
|
|
2010-03-04 17:41:14 +01:00
|
|
|
# Uninstall support
|
2010-03-04 17:50:27 +01:00
|
|
|
configure_file(
|
2010-03-04 17:41:14 +01:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
IMMEDIATE @ONLY)
|
|
|
|
|
2010-03-04 17:50:27 +01:00
|
|
|
add_custom_target(uninstall
|
2010-03-04 17:41:14 +01:00
|
|
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|