|
|
|
###########################################
|
|
|
|
# #
|
|
|
|
# (C) 2010 Serghei Amelian #
|
|
|
|
# serghei (DOT) amelian (AT) gmail.com #
|
|
|
|
# #
|
|
|
|
# Improvements and feedback are welcome #
|
|
|
|
# #
|
|
|
|
# This file is released under GPL >= 2 #
|
|
|
|
# #
|
|
|
|
###########################################
|
|
|
|
|
|
|
|
cmake_minimum_required( VERSION 2.8.12 )
|
|
|
|
|
|
|
|
|
|
|
|
##### general package setup
|
|
|
|
|
|
|
|
project( arts )
|
|
|
|
|
|
|
|
set( ARTS_MAJOR_VERSION 1 )
|
|
|
|
set( ARTS_MINOR_VERSION 5 )
|
|
|
|
set( ARTS_MICRO_VERSION 10 )
|
|
|
|
set( ARTS_VERSION "${ARTS_MAJOR_VERSION}.${ARTS_MINOR_VERSION}.${ARTS_MICRO_VERSION}" )
|
|
|
|
|
|
|
|
|
|
|
|
##### include essential cmake modules
|
|
|
|
|
|
|
|
include( FindPkgConfig )
|
|
|
|
include( CheckFunctionExists )
|
|
|
|
include( CheckSymbolExists )
|
|
|
|
include( CheckIncludeFile )
|
|
|
|
include( CheckIncludeFiles )
|
|
|
|
include( CheckLibraryExists )
|
|
|
|
include( CheckPrototypeDefinition )
|
|
|
|
include( CheckCSourceCompiles )
|
|
|
|
|
|
|
|
##### include our cmake modules
|
|
|
|
|
|
|
|
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
|
|
|
|
include( TDEMacros )
|
|
|
|
|
|
|
|
|
|
|
|
##### setup install paths
|
|
|
|
|
|
|
|
tde_setup_install_path( EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" )
|
|
|
|
tde_setup_install_path( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" )
|
|
|
|
tde_setup_install_path( LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
|
|
|
|
tde_setup_install_path( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/${CMAKE_PROJECT_NAME}" )
|
|
|
|
tde_setup_install_path( PKGCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig" )
|
|
|
|
|
|
|
|
|
|
|
|
##### optional stuff
|
|
|
|
|
|
|
|
option( WITH_ALL_OPTIONS "Enable all optional support" ON )
|
|
|
|
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
|
|
|
|
option( WITH_ALSA "Enable ALSA support" ${WITH_ALL_OPTIONS} )
|
|
|
|
option( WITH_AUDIOFILE "Enable audiofile (wav) support" ${WITH_ALL_OPTIONS} )
|
|
|
|
option( WITH_VORBIS "Enable Ogg/Vorbis support" ${WITH_ALL_OPTIONS} )
|
|
|
|
option( WITH_MAD "Enable MAD mp3 decoder support" ${WITH_ALL_OPTIONS} )
|
|
|
|
option( WITH_ESOUND "Enable ESOUND support" ${WITH_ALL_OPTIONS} )
|
|
|
|
option( WITH_JACK "Enable JACK support" ${WITH_ALL_OPTIONS} )
|
|
|
|
option( WITH_SNDIO "Enable SNDIO support" OFF )
|
|
|
|
option( WITH_NAS "Enable Network Audio System support" ${WITH_ALL_OPTIONS} )
|
|
|
|
option( WITH_OSS "Enable Open Sound System support" OFF )
|
|
|
|
option( WITH_TOSS "Enable Threaded Open Sound System support" OFF )
|
|
|
|
|
|
|
|
|
|
|
|
##### user requested modules
|
|
|
|
|
|
|
|
option( BUILD_ALL "Build all" ON )
|
|
|
|
option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
|
|
|
|
option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
|
|
|
|
|
|
|
|
|
|
|
|
##### configure checks
|
|
|
|
|
|
|
|
include( ConfigureChecks.cmake )
|
|
|
|
|
|
|
|
|
|
|
|
###### global compiler settings
|
|
|
|
|
|
|
|
add_definitions( -DHAVE_CONFIG_H )
|
|
|
|
|
|
|
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
|
|
|
|
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
|
|
|
|
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
|
|
|
|
|
|
|
|
|
|
|
|
##### directories
|
|
|
|
|
|
|
|
add_subdirectory( libltdl )
|
|
|
|
add_subdirectory( mcop )
|
|
|
|
add_subdirectory( mcopidl )
|
|
|
|
add_subdirectory( flow )
|
|
|
|
#add_subdirectory( mcop_mt )
|
|
|
|
#add_subdirectory( soundserver )
|
|
|
|
#add_subdirectory( artsc )
|
|
|
|
#add_subdirectory( gmcop )
|
|
|
|
#add_subdirectory( qtmcop )
|
|
|
|
|
|
|
|
tde_conditional_add_subdirectory( BUILD_DOC doc )
|
|
|
|
#tde_conditional_add_subdirectory( BUILD_TRANSLATIONS translations )
|
|
|
|
|
|
|
|
|
|
|
|
##### write configure files
|
|
|
|
|
|
|
|
configure_file( config.h.cmake config.h @ONLY )
|
|
|
|
|
|
|
|
|
|
|
|
##### write pkgconfig file ######################
|
|
|
|
|
|
|
|
set( PC_LIB_REQUIRE "" )
|
|
|
|
if( WITH_ALSA )
|
|
|
|
list( APPEND PC_LIB_REQUIRE "alsa" )
|
|
|
|
endif( WITH_ALSA )
|
|
|
|
if( WITH_AUDIOFILE )
|
|
|
|
list( APPEND PC_LIB_REQUIRE "audiofile" )
|
|
|
|
endif( WITH_AUDIOFILE )
|
|
|
|
if( WITH_VORBIS )
|
|
|
|
list( APPEND PC_LIB_REQUIRE "vorbis" )
|
|
|
|
list( APPEND PC_LIB_REQUIRE "vorbisfile" )
|
|
|
|
endif( WITH_VORBIS )
|
|
|
|
if( WITH_MAD )
|
|
|
|
list( APPEND PC_LIB_REQUIRE "mad" )
|
|
|
|
endif( WITH_MAD )
|
|
|
|
if( WITH_ESOUND )
|
|
|
|
list( APPEND PC_LIB_REQUIRE "esound" )
|
|
|
|
endif( WITH_ESOUND )
|
|
|
|
if( WITH_JACK )
|
|
|
|
list( APPEND PC_LIB_REQUIRE "jack" )
|
|
|
|
endif( WITH_JACK )
|
|
|
|
|
|
|
|
list( LENGTH PC_LIB_REQUIRE PC_LIB_REQUIRES_FOUND )
|
|
|
|
if( PC_LIB_REQUIRES_FOUND GREATER 0 )
|
|
|
|
string( REPLACE ";" " " PC_LIB_REQUIRES "Requires: ${PC_LIB_REQUIRE}" )
|
|
|
|
else( )
|
|
|
|
set( PC_LIB_REQUIRES "" )
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} )
|
|
|
|
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} )
|
|
|
|
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} )
|
|
|
|
configure_file( arts.pc.cmake arts.pc @ONLY )
|
|
|
|
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/arts.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} )
|