2018-02-01 11:11:04 +00:00
################################################################################
# Copyright 2009-2016 Jörg Müller
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
cmake_minimum_required ( VERSION 3.0 )
include ( CMakeDependentOption )
if ( POLICY CMP0054 )
cmake_policy ( SET CMP0054 NEW )
endif ( )
project ( audaspace )
set ( AUDASPACE_VERSION 1.3 )
set ( AUDASPACE_LONG_VERSION ${ AUDASPACE_VERSION } .0 )
if ( DEFINED AUDASPACE_CMAKE_CFG )
include ( ${ AUDASPACE_CMAKE_CFG } )
endif ( )
if ( NOT DEFINED AUDASPACE_STANDALONE )
set ( AUDASPACE_STANDALONE TRUE )
endif ( )
# sources
set ( SRC
s r c / d e v i c e s / D e f a u l t S y n c h r o n i z e r . c p p
s r c / d e v i c e s / D e v i c e M a n a g e r . c p p
s r c / d e v i c e s / N U L L D e v i c e . c p p
s r c / d e v i c e s / R e a d D e v i c e . c p p
s r c / d e v i c e s / S o f t w a r e D e v i c e . c p p
s r c / E x c e p t i o n . c p p
s r c / f i l e / F i l e . c p p
s r c / f i l e / F i l e M a n a g e r . c p p
s r c / f i l e / F i l e W r i t e r . c p p
s r c / f x / A c c u m u l a t o r . c p p
s r c / f x / A D S R . c p p
s r c / f x / A D S R R e a d e r . c p p
s r c / f x / B a s e I I R F i l t e r R e a d e r . c p p
s r c / f x / B u t t e r w o r t h C a l c u l a t o r . c p p
s r c / f x / B u t t e r w o r t h . c p p
s r c / f x / C a l l b a c k I I R F i l t e r R e a d e r . c p p
s r c / f x / D e l a y . c p p
s r c / f x / D e l a y R e a d e r . c p p
s r c / f x / D y n a m i c I I R F i l t e r . c p p
s r c / f x / D y n a m i c I I R F i l t e r R e a d e r . c p p
s r c / f x / D y n a m i c M u s i c . c p p
s r c / f x / E f f e c t . c p p
s r c / f x / E f f e c t R e a d e r . c p p
s r c / f x / E n v e l o p e . c p p
s r c / f x / F a d e r . c p p
s r c / f x / F a d e r R e a d e r . c p p
s r c / f x / H i g h p a s s C a l c u l a t o r . c p p
s r c / f x / H i g h p a s s . c p p
s r c / f x / I I R F i l t e r . c p p
s r c / f x / I I R F i l t e r R e a d e r . c p p
s r c / f x / L i m i t e r . c p p
s r c / f x / L i m i t e r R e a d e r . c p p
s r c / f x / L o o p . c p p
s r c / f x / L o o p R e a d e r . c p p
s r c / f x / L o w p a s s C a l c u l a t o r . c p p
s r c / f x / L o w p a s s . c p p
s r c / f x / M u t a b l e R e a d e r . c p p
s r c / f x / M u t a b l e S o u n d . c p p
s r c / f x / P i t c h . c p p
s r c / f x / P i t c h R e a d e r . c p p
s r c / f x / P l a y b a c k M a n a g e r . c p p
s r c / f x / P l a y b a c k C a t e g o r y . c p p
s r c / f x / R e v e r s e . c p p
s r c / f x / R e v e r s e R e a d e r . c p p
s r c / f x / S o u n d L i s t . c p p
s r c / f x / S o u r c e . c p p
s r c / f x / S u m . c p p
s r c / f x / T h r e s h o l d . c p p
s r c / f x / V o l u m e . c p p
s r c / f x / V o l u m e R e a d e r . c p p
s r c / f x / V o l u m e S o u n d . c p p
2018-06-18 06:08:08 +00:00
s r c / f x / V o l u m e S t o r a g e . c p p
2018-02-01 11:11:04 +00:00
s r c / g e n e r a t o r / S a w t o o t h . c p p
s r c / g e n e r a t o r / S a w t o o t h R e a d e r . c p p
s r c / g e n e r a t o r / S i l e n c e . c p p
s r c / g e n e r a t o r / S i l e n c e R e a d e r . c p p
s r c / g e n e r a t o r / S i n e . c p p
s r c / g e n e r a t o r / S i n e R e a d e r . c p p
s r c / g e n e r a t o r / S q u a r e . c p p
s r c / g e n e r a t o r / S q u a r e R e a d e r . c p p
s r c / g e n e r a t o r / T r i a n g l e . c p p
s r c / g e n e r a t o r / T r i a n g l e R e a d e r . c p p
s r c / r e s p e c / C h a n n e l M a p p e r . c p p
s r c / r e s p e c / C h a n n e l M a p p e r R e a d e r . c p p
s r c / r e s p e c / C o n v e r t e r . c p p
s r c / r e s p e c / C o n v e r t e r F u n c t i o n s . c p p
s r c / r e s p e c / C o n v e r t e r R e a d e r . c p p
s r c / r e s p e c / J O S R e s a m p l e . c p p
s r c / r e s p e c / J O S R e s a m p l e R e a d e r C o e f f . c p p
s r c / r e s p e c / J O S R e s a m p l e R e a d e r . c p p
s r c / r e s p e c / L i n e a r R e s a m p l e . c p p
s r c / r e s p e c / L i n e a r R e s a m p l e R e a d e r . c p p
s r c / r e s p e c / M i x e r . c p p
s r c / r e s p e c / R e s a m p l e R e a d e r . c p p
s r c / r e s p e c / S p e c s C h a n g e r . c p p
s r c / s e q u e n c e / A n i m a t e a b l e P r o p e r t y . c p p
s r c / s e q u e n c e / D o u b l e . c p p
s r c / s e q u e n c e / D o u b l e R e a d e r . c p p
s r c / s e q u e n c e / P i n g P o n g . c p p
s r c / s e q u e n c e / S e q u e n c e . c p p
s r c / s e q u e n c e / S e q u e n c e D a t a . c p p
s r c / s e q u e n c e / S e q u e n c e E n t r y . c p p
s r c / s e q u e n c e / S e q u e n c e H a n d l e . c p p
s r c / s e q u e n c e / S e q u e n c e R e a d e r . c p p
s r c / s e q u e n c e / S u p e r p o s e . c p p
s r c / s e q u e n c e / S u p e r p o s e R e a d e r . c p p
s r c / u t i l / B a r r i e r . c p p
s r c / u t i l / B u f f e r . c p p
s r c / u t i l / B u f f e r R e a d e r . c p p
s r c / u t i l / S t r e a m B u f f e r . c p p
s r c / u t i l / T h r e a d P o o l . c p p
)
set ( PRIVATE_HDR
s r c / s e q u e n c e / S e q u e n c e H a n d l e . h
)
set ( PUBLIC_HDR
i n c l u d e / d e v i c e s / D e f a u l t S y n c h r o n i z e r . h
i n c l u d e / d e v i c e s / D e v i c e M a n a g e r . h
i n c l u d e / d e v i c e s / I 3 D D e v i c e . h
i n c l u d e / d e v i c e s / I 3 D H a n d l e . h
i n c l u d e / d e v i c e s / I D e v i c e F a c t o r y . h
i n c l u d e / d e v i c e s / I D e v i c e . h
i n c l u d e / d e v i c e s / I H a n d l e . h
i n c l u d e / d e v i c e s / I S y n c h r o n i z e r . h
i n c l u d e / d e v i c e s / N U L L D e v i c e . h
i n c l u d e / d e v i c e s / R e a d D e v i c e . h
i n c l u d e / d e v i c e s / S o f t w a r e D e v i c e . h
i n c l u d e / E x c e p t i o n . h
i n c l u d e / f i l e / F i l e . h
i n c l u d e / f i l e / F i l e M a n a g e r . h
i n c l u d e / f i l e / F i l e W r i t e r . h
i n c l u d e / f i l e / I F i l e I n p u t . h
i n c l u d e / f i l e / I F i l e O u t p u t . h
i n c l u d e / f i l e / I W r i t e r . h
i n c l u d e / f x / A c c u m u l a t o r . h
i n c l u d e / f x / A D S R . h
i n c l u d e / f x / A D S R R e a d e r . h
i n c l u d e / f x / B a s e I I R F i l t e r R e a d e r . h
i n c l u d e / f x / B u t t e r w o r t h C a l c u l a t o r . h
i n c l u d e / f x / B u t t e r w o r t h . h
i n c l u d e / f x / C a l l b a c k I I R F i l t e r R e a d e r . h
i n c l u d e / f x / D e l a y . h
i n c l u d e / f x / D e l a y R e a d e r . h
i n c l u d e / f x / D y n a m i c I I R F i l t e r . h
i n c l u d e / f x / D y n a m i c I I R F i l t e r R e a d e r . h
i n c l u d e / f x / D y n a m i c M u s i c . h
i n c l u d e / f x / E f f e c t . h
i n c l u d e / f x / E f f e c t R e a d e r . h
i n c l u d e / f x / E n v e l o p e . h
i n c l u d e / f x / F a d e r . h
i n c l u d e / f x / F a d e r R e a d e r . h
i n c l u d e / f x / H i g h p a s s C a l c u l a t o r . h
i n c l u d e / f x / H i g h p a s s . h
i n c l u d e / f x / I D y n a m i c I I R F i l t e r C a l c u l a t o r . h
i n c l u d e / f x / I I R F i l t e r . h
i n c l u d e / f x / I I R F i l t e r R e a d e r . h
i n c l u d e / f x / L i m i t e r . h
i n c l u d e / f x / L i m i t e r R e a d e r . h
i n c l u d e / f x / L o o p . h
i n c l u d e / f x / L o o p R e a d e r . h
i n c l u d e / f x / L o w p a s s C a l c u l a t o r . h
i n c l u d e / f x / L o w p a s s . h
i n c l u d e / f x / M u t a b l e R e a d e r . h
i n c l u d e / f x / M u t a b l e S o u n d . h
i n c l u d e / f x / P i t c h . h
i n c l u d e / f x / P i t c h R e a d e r . h
i n c l u d e / f x / P l a y b a c k M a n a g e r . h
i n c l u d e / f x / P l a y b a c k C a t e g o r y . h
i n c l u d e / f x / R e v e r s e . h
i n c l u d e / f x / R e v e r s e R e a d e r . h
i n c l u d e / f x / S o u n d L i s t . h
i n c l u d e / f x / S o u r c e . h
i n c l u d e / f x / S u m . h
i n c l u d e / f x / T h r e s h o l d . h
i n c l u d e / f x / V o l u m e . h
i n c l u d e / f x / V o l u m e R e a d e r . h
i n c l u d e / f x / V o l u m e S o u n d . h
i n c l u d e / f x / V o l u m e S t o r a g e . h
i n c l u d e / g e n e r a t o r / S a w t o o t h . h
i n c l u d e / g e n e r a t o r / S a w t o o t h R e a d e r . h
i n c l u d e / g e n e r a t o r / S i l e n c e . h
i n c l u d e / g e n e r a t o r / S i l e n c e R e a d e r . h
i n c l u d e / g e n e r a t o r / S i n e . h
i n c l u d e / g e n e r a t o r / S i n e R e a d e r . h
i n c l u d e / g e n e r a t o r / S q u a r e . h
i n c l u d e / g e n e r a t o r / S q u a r e R e a d e r . h
i n c l u d e / g e n e r a t o r / T r i a n g l e . h
i n c l u d e / g e n e r a t o r / T r i a n g l e R e a d e r . h
i n c l u d e / I R e a d e r . h
i n c l u d e / I S o u n d . h
i n c l u d e / p l u g i n / P l u g i n M a n a g e r . h
i n c l u d e / r e s p e c / C h a n n e l M a p p e r . h
i n c l u d e / r e s p e c / C h a n n e l M a p p e r R e a d e r . h
i n c l u d e / r e s p e c / C o n v e r t e r F u n c t i o n s . h
i n c l u d e / r e s p e c / C o n v e r t e r . h
i n c l u d e / r e s p e c / C o n v e r t e r R e a d e r . h
i n c l u d e / r e s p e c / J O S R e s a m p l e . h
i n c l u d e / r e s p e c / J O S R e s a m p l e R e a d e r . h
i n c l u d e / r e s p e c / L i n e a r R e s a m p l e . h
i n c l u d e / r e s p e c / L i n e a r R e s a m p l e R e a d e r . h
i n c l u d e / r e s p e c / M i x e r . h
i n c l u d e / r e s p e c / R e s a m p l e R e a d e r . h
i n c l u d e / r e s p e c / S p e c i f i c a t i o n . h
i n c l u d e / r e s p e c / S p e c s C h a n g e r . h
i n c l u d e / s e q u e n c e / A n i m a t e a b l e P r o p e r t y . h
i n c l u d e / s e q u e n c e / D o u b l e . h
i n c l u d e / s e q u e n c e / D o u b l e R e a d e r . h
i n c l u d e / s e q u e n c e / P i n g P o n g . h
i n c l u d e / s e q u e n c e / S e q u e n c e D a t a . h
i n c l u d e / s e q u e n c e / S e q u e n c e E n t r y . h
i n c l u d e / s e q u e n c e / S e q u e n c e . h
i n c l u d e / s e q u e n c e / S e q u e n c e R e a d e r . h
i n c l u d e / s e q u e n c e / S u p e r p o s e . h
i n c l u d e / s e q u e n c e / S u p e r p o s e R e a d e r . h
i n c l u d e / u t i l / B a r r i e r . h
i n c l u d e / u t i l / B u f f e r . h
i n c l u d e / u t i l / B u f f e r R e a d e r . h
i n c l u d e / u t i l / I L o c k a b l e . h
i n c l u d e / u t i l / M a t h 3 D . h
i n c l u d e / u t i l / S t r e a m B u f f e r . h
i n c l u d e / u t i l / T h r e a d P o o l . h
)
set ( HDR ${ PRIVATE_HDR } ${ PUBLIC_HDR } )
set ( INCLUDE ${ CMAKE_CURRENT_BINARY_DIR } include )
if ( WIN32 )
set ( LIBRARIES )
if ( AUDASPACE_STANDALONE )
set ( DLLS )
set ( LIBRARY_PATH "../lib" CACHE PATH "Path which contains the libraries." )
file ( GLOB LIBRARY_DIRS ${ LIBRARY_PATH } /* )
list ( APPEND CMAKE_PREFIX_PATH ${ LIBRARY_DIRS } )
endif ( )
else ( )
set ( LIBRARIES ${ CMAKE_DL_LIBS } -lpthread )
endif ( )
set ( STATIC_PLUGINS "" )
# dependencies
if ( AUDASPACE_STANDALONE )
set ( PACKAGE_OPTION QUIET )
list ( APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/" )
option ( BUILD_DEMOS "Build and install demos" TRUE )
option ( SHARED_LIBRARY "Build Shared Library" TRUE )
option ( WITH_C "Build C Module" TRUE )
option ( WITH_DOCS "Build C++ HTML Documentation with Doxygen" TRUE )
option ( WITH_FFMPEG "Build With FFMPEG" TRUE )
option ( WITH_FFTW "Build With FFTW" TRUE )
option ( WITH_JACK "Build With Plugin" TRUE )
option ( WITH_LIBSNDFILE "Build With LibSndFile" TRUE )
option ( WITH_OPENAL "Build With OpenAL" TRUE )
option ( WITH_PYTHON "Build With Python Library" TRUE )
option ( WITH_SDL "Build With SDL" TRUE )
option ( WITH_STRICT_DEPENDENCIES "Error and abort instead of warning if a library is not found." FALSE )
if ( WITH_STRICT_DEPENDENCIES )
set ( PACKAGE_OPTION REQUIRED )
endif ( )
endif ( )
if ( WIN32 )
set ( DEFAULT_PLUGIN_PATH "." CACHE STRING "Default plugin installation and loading path." )
set ( DOCUMENTATION_INSTALL_PATH "doc" CACHE PATH "Path where the documentation is installed." )
else ( )
set ( DEFAULT_PLUGIN_PATH "${CMAKE_INSTALL_PREFIX}/share/audaspace/plugins" CACHE STRING "Default plugin installation and loading path." )
set ( DOCUMENTATION_INSTALL_PATH "share/doc/audaspace" CACHE PATH "Path where the documentation is installed." )
endif ( )
if ( AUDASPACE_STANDALONE )
cmake_dependent_option ( SEPARATE_C "Build C Binding as separate library" TRUE "WITH_C" FALSE )
cmake_dependent_option ( PLUGIN_FFMPEG "Build FFMPEG Plugin" TRUE "WITH_FFMPEG;SHARED_LIBRARY" FALSE )
cmake_dependent_option ( PLUGIN_JACK "Build JACK Plugin" TRUE "WITH_JACK;SHARED_LIBRARY" FALSE )
cmake_dependent_option ( PLUGIN_LIBSNDFILE "Build LibSndFile Plugin" TRUE "WITH_LIBSNDFILE;SHARED_LIBRARY" FALSE )
cmake_dependent_option ( PLUGIN_OPENAL "Build OpenAL Plugin" TRUE "WITH_OPENAL;SHARED_LIBRARY" FALSE )
cmake_dependent_option ( PLUGIN_SDL "Build SDL Plugin" TRUE "WITH_SDL;SHARED_LIBRARY" FALSE )
cmake_dependent_option ( WITH_PYTHON_MODULE "Build Python Module" TRUE "WITH_PYTHON" FALSE )
cmake_dependent_option ( USE_SDL2 "Use SDL2 instead of 1 if available" TRUE "WITH_SDL" FALSE )
cmake_dependent_option ( DYNLOAD_JACK "Dynamically load JACK" FALSE "WITH_JACK" FALSE )
cmake_dependent_option ( WITH_BINDING_DOCS "Build C/Python HTML Documentation with Sphinx" TRUE "WITH_PYTHON_MODULE" FALSE )
endif ( )
# compiler options
if ( AUDASPACE_STANDALONE )
if ( CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
add_definitions ( -std=c++11 )
list ( APPEND CMAKE_C_COMPILER_FLAGS "-fvisibility=hidden" )
list ( APPEND CMAKE_CXX_COMPILER_FLAGS "-fvisibility=hidden" )
endif ( )
if ( MSVC )
list ( APPEND CMAKE_C_FLAGS_DEBUG "/Zi /Od" )
list ( APPEND CMAKE_CXX_FLAGS_DEBUG "/Zi /Od" )
list ( APPEND CMAKE_SHARED_LINKER_FLAGS_DEBUG "/DEBUG" )
list ( APPEND CMAKE_STATIC_LINKER_FLAGS_DEBUG "/DEBUG" )
list ( APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" )
if ( SHARED_LIBRARY )
include ( GenerateExportHeader )
endif ( )
endif ( )
if ( APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET )
set ( CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE )
endif ( )
endif ( )
if ( MSVC )
add_definitions (
/ D _ U S E _ M A T H _ D E F I N E S
/ E H s c
/ D N O M I N M A X
/ D _ S T D I N T _ H
)
endif ( )
# platform specific options
if ( MSYS OR MINGW )
add_definitions ( -D_USE_MATH_DEFINES )
endif ( )
# C
if ( WITH_C )
set ( C_SRC
b i n d i n g s / C / A U D _ T h r e a d P o o l . c p p
b i n d i n g s / C / A U D _ S o u r c e . c p p
b i n d i n g s / C / A U D _ D e v i c e . c p p
b i n d i n g s / C / A U D _ D y n a m i c M u s i c . c p p
b i n d i n g s / C / A U D _ H a n d l e . c p p
b i n d i n g s / C / A U D _ P l a y b a c k M a n a g e r . c p p
b i n d i n g s / C / A U D _ S e q u e n c e . c p p
b i n d i n g s / C / A U D _ S o u n d . c p p
b i n d i n g s / C / A U D _ S p e c i a l . c p p
)
set ( C_HDR
b i n d i n g s / C / A U D _ T h r e a d P o o l . h
b i n d i n g s / C / A U D _ S o u r c e . h
b i n d i n g s / C / A U D _ D e v i c e . h
b i n d i n g s / C / A U D _ D y n a m i c M u s i c . h
b i n d i n g s / C / A U D _ H a n d l e . h
b i n d i n g s / C / A U D _ P l a y b a c k M a n a g e r . h
b i n d i n g s / C / A U D _ S e q u e n c e . h
b i n d i n g s / C / A U D _ S o u n d . h
b i n d i n g s / C / A U D _ S p e c i a l . h
b i n d i n g s / C / A U D _ T y p e s . h
)
if ( WITH_FFTW )
list ( APPEND C_SRC
b i n d i n g s / C / A U D _ H R T F . c p p
b i n d i n g s / C / A U D _ I m p u l s e R e s p o n s e . c p p
)
list ( APPEND C_HDR
b i n d i n g s / C / A U D _ H R T F . h
b i n d i n g s / C / A U D _ I m p u l s e R e s p o n s e . h
)
endif ( )
if ( NOT SEPARATE_C )
list ( APPEND SRC ${ C_SRC } )
list ( APPEND HDR ${ C_HDR } )
else ( )
set ( AUDASPACE_C_LIBRARY -laudaspace-c )
endif ( )
endif ( )
# FFMPEG
if ( WITH_FFMPEG )
if ( AUDASPACE_STANDALONE )
find_package ( FFMPEG ${ PACKAGE_OPTION } )
endif ( )
if ( FFMPEG_FOUND )
set ( FFMPEG_SRC
p l u g i n s / f f m p e g / F F M P E G . c p p
p l u g i n s / f f m p e g / F F M P E G R e a d e r . c p p
p l u g i n s / f f m p e g / F F M P E G W r i t e r . c p p
)
set ( FFMPEG_HDR
p l u g i n s / f f m p e g / F F M P E G . h
p l u g i n s / f f m p e g / F F M P E G R e a d e r . h
p l u g i n s / f f m p e g / F F M P E G W r i t e r . h
)
if ( NOT PLUGIN_FFMPEG )
list ( APPEND INCLUDE ${ FFMPEG_INCLUDE_DIRS } )
list ( APPEND LIBRARIES ${ FFMPEG_LIBRARIES } )
list ( APPEND SRC ${ FFMPEG_SRC } )
list ( APPEND HDR ${ FFMPEG_HDR } )
list ( APPEND STATIC_PLUGINS FFMPEG )
endif ( )
if ( WIN32 AND AUDASPACE_STANDALONE )
file ( GLOB FFMPEG_DLLS ${ LIBRARY_PATH } /ffmpeg/bin/*.dll )
list ( APPEND DLLS ${ FFMPEG_DLLS } )
endif ( )
else ( )
set ( WITH_FFMPEG FALSE CACHE BOOL "Build With FFMPEG" FORCE )
message ( WARNING "FFMPEG not found, plugin will not be built." )
endif ( )
endif ( )
# FFTW
if ( WITH_FFTW )
if ( AUDASPACE_STANDALONE )
find_package ( FFTW ${ PACKAGE_OPTION } )
endif ( )
if ( FFTW_FOUND )
set ( FFTW_SRC
s r c / f x / B i n a u r a l S o u n d . c p p
s r c / f x / B i n a u r a l R e a d e r . c p p
s r c / f x / C o n v o l v e r . c p p
s r c / f x / C o n v o l v e r R e a d e r . c p p
s r c / f x / C o n v o l v e r S o u n d . c p p
s r c / f x / F F T C o n v o l v e r . c p p
s r c / f x / H R T F . c p p
s r c / f x / I m p u l s e R e s p o n s e . c p p
s r c / u t i l / F F T P l a n . c p p
)
set ( FFTW_HDR
i n c l u d e / f x / B i n a u r a l S o u n d . h
i n c l u d e / f x / B i n a u r a l R e a d e r . h
i n c l u d e / f x / C o n v o l v e r . h
i n c l u d e / f x / C o n v o l v e r R e a d e r . h
i n c l u d e / f x / C o n v o l v e r S o u n d . h
i n c l u d e / f x / F F T C o n v o l v e r . h
i n c l u d e / f x / H R T F . h
i n c l u d e / f x / H R T F L o a d e r . h
i n c l u d e / f x / I m p u l s e R e s p o n s e . h
i n c l u d e / u t i l / F F T P l a n . h
)
add_definitions ( -DWITH_CONVOLUTION )
list ( APPEND INCLUDE ${ FFTW_INCLUDE_DIR } )
list ( APPEND LIBRARIES ${ FFTW_LIBRARY } )
list ( APPEND SRC ${ FFTW_SRC } )
list ( APPEND HDR ${ FFTW_HDR } )
if ( WIN32 AND AUDASPACE_STANDALONE )
file ( GLOB FFTW_DLLS ${ LIBRARY_PATH } /fftw/bin/*.dll )
list ( APPEND DLLS ${ FFTW_DLLS } )
endif ( )
else ( )
set ( WITH_FFTW FALSE CACHE BOOL "Build With FFTW" FORCE )
message ( WARNING "FFTW not found, convolution functionality will not be built." )
endif ( )
endif ( )
# JACK
if ( WITH_JACK )
if ( AUDASPACE_STANDALONE )
find_package ( Jack ${ PACKAGE_OPTION } )
endif ( )
if ( JACK_FOUND )
set ( JACK_SRC
p l u g i n s / j a c k / J a c k D e v i c e . c p p
p l u g i n s / j a c k / J a c k S y n c h r o n i z e r . c p p
p l u g i n s / j a c k / J a c k L i b r a r y . c p p
)
set ( JACK_HDR
p l u g i n s / j a c k / J a c k D e v i c e . h
p l u g i n s / j a c k / J a c k S y n c h r o n i z e r . h
p l u g i n s / j a c k / J a c k L i b r a r y . h
p l u g i n s / j a c k / J a c k S y m b o l s . h
)
if ( DYNLOAD_JACK )
add_definitions ( -DDYNLOAD_JACK )
endif ( )
if ( NOT PLUGIN_JACK )
list ( APPEND INCLUDE ${ JACK_INCLUDE_DIRS } )
if ( NOT DYNLOAD_JACK )
list ( APPEND LIBRARIES ${ JACK_LIBRARIES } )
endif ( )
list ( APPEND SRC ${ JACK_SRC } )
list ( APPEND HDR ${ JACK_HDR } )
list ( APPEND STATIC_PLUGINS JackDevice )
endif ( )
if ( WIN32 AND AUDASPACE_STANDALONE )
file ( GLOB JACK_DLLS ${ LIBRARY_PATH } /jack/bin/*.dll )
list ( APPEND DLLS ${ JACK_DLLS } )
endif ( )
else ( )
set ( WITH_JACK FALSE CACHE BOOL "Build With JACK" FORCE )
message ( WARNING "JACK not found, plugin will not be built." )
endif ( )
endif ( )
# LibSndFile
if ( WITH_LIBSNDFILE )
if ( AUDASPACE_STANDALONE )
find_package ( LibSndFile ${ PACKAGE_OPTION } )
endif ( )
if ( LIBSNDFILE_FOUND )
set ( LIBSNDFILE_SRC
p l u g i n s / l i b s n d f i l e / S n d F i l e . c p p
p l u g i n s / l i b s n d f i l e / S n d F i l e R e a d e r . c p p
p l u g i n s / l i b s n d f i l e / S n d F i l e W r i t e r . c p p
)
set ( LIBSNDFILE_HDR
p l u g i n s / l i b s n d f i l e / S n d F i l e . h
p l u g i n s / l i b s n d f i l e / S n d F i l e R e a d e r . h
p l u g i n s / l i b s n d f i l e / S n d F i l e W r i t e r . h
)
if ( NOT PLUGIN_LIBSNDFILE )
list ( APPEND INCLUDE ${ LIBSNDFILE_INCLUDE_DIRS } )
list ( APPEND LIBRARIES ${ LIBSNDFILE_LIBRARIES } )
list ( APPEND SRC ${ LIBSNDFILE_SRC } )
list ( APPEND HDR ${ LIBSNDFILE_HDR } )
list ( APPEND STATIC_PLUGINS SndFile )
endif ( )
if ( WIN32 AND AUDASPACE_STANDALONE )
file ( GLOB LIBSNDFILE_DLLS ${ LIBRARY_PATH } /libsndfile/bin/*.dll )
list ( APPEND DLLS ${ LIBSNDFILE_DLLS } )
endif ( )
else ( )
set ( WITH_LIBSNDFILE FALSE CACHE BOOL "Build With LibSndFile" FORCE )
message ( WARNING "LibSndFile not found, plugin will not be built." )
endif ( )
endif ( )
# OpenAL
if ( WITH_OPENAL )
if ( AUDASPACE_STANDALONE )
find_package ( OpenAL ${ PACKAGE_OPTION } )
endif ( )
if ( OPENAL_FOUND )
set ( OPENAL_SRC
p l u g i n s / o p e n a l / O p e n A L D e v i c e . c p p
p l u g i n s / o p e n a l / O p e n A L R e a d e r . c p p
)
set ( OPENAL_HDR
p l u g i n s / o p e n a l / O p e n A L D e v i c e . h
p l u g i n s / o p e n a l / O p e n A L R e a d e r . h
)
if ( NOT PLUGIN_OPENAL )
list ( APPEND INCLUDE ${ OPENAL_INCLUDE_DIR } )
list ( APPEND LIBRARIES ${ OPENAL_LIBRARY } )
list ( APPEND SRC ${ OPENAL_SRC } )
list ( APPEND HDR ${ OPENAL_HDR } )
list ( APPEND STATIC_PLUGINS OpenALDevice )
endif ( )
if ( WIN32 AND AUDASPACE_STANDALONE )
file ( GLOB OPENAL_DLLS ${ LIBRARY_PATH } /OpenAL/bin/*.dll )
list ( APPEND DLLS ${ OPENAL_DLLS } )
endif ( )
else ( )
set ( WITH_OPENAL FALSE CACHE BOOL "Build With OpenAL" FORCE )
message ( WARNING "OpenAL not found, plugin will not be built." )
endif ( )
endif ( )
# Python
if ( WITH_PYTHON )
if ( AUDASPACE_STANDALONE )
find_package ( PythonLibs 3.2 ${ PACKAGE_OPTION } )
find_package ( NumPy ${ PACKAGE_OPTION } )
endif ( )
if ( PYTHONLIBS_FOUND AND NUMPY_FOUND )
list ( APPEND INCLUDE ${ PYTHON_INCLUDE_DIRS } ${ NUMPY_INCLUDE_DIRS } )
if ( WITH_PYTHON_MODULE )
find_package ( PythonInterp 3.2 ${ PACKAGE_OPTION } )
if ( NOT PYTHONINTERP_FOUND )
set ( WITH_PYTHON_MODULE FALSE )
message ( WARNING "Python interpreter not found, module will not be built." )
endif ( )
endif ( )
set ( AUDASPACE_PY_LIBRARY -laudaspace-py )
if ( WIN32 AND AUDASPACE_STANDALONE )
file ( GLOB PYTHON_DLLS ${ LIBRARY_PATH } /Python/bin/*.dll )
list ( APPEND DLLS ${ PYTHON_DLLS } )
endif ( )
else ( )
set ( WITH_PYTHON FALSE CACHE BOOL "Build With Python Library" FORCE )
message ( WARNING "Python libraries not found, language binding will not be built." )
endif ( )
endif ( )
# SDL
if ( WITH_SDL )
if ( AUDASPACE_STANDALONE )
if ( USE_SDL2 )
find_package ( SDL2 )
if ( SDL2_FOUND )
set ( SDL_INCLUDE_DIR ${ SDL2_INCLUDE_DIR } )
set ( SDL_LIBRARY ${ SDL2_LIBRARY } )
set ( SDL_FOUND TRUE )
else ( )
find_package ( SDL ${ PACKAGE_OPTION } )
endif ( )
else ( )
find_package ( SDL ${ PACKAGE_OPTION } )
endif ( )
endif ( )
if ( SDL_FOUND )
set ( SDL_SRC
p l u g i n s / s d l / S D L D e v i c e . c p p
)
set ( SDL_HDR
p l u g i n s / s d l / S D L D e v i c e . h
)
if ( NOT PLUGIN_SDL )
list ( APPEND INCLUDE ${ SDL_INCLUDE_DIR } )
list ( APPEND LIBRARIES ${ SDL_LIBRARY } )
list ( APPEND SRC ${ SDL_SRC } )
list ( APPEND HDR ${ SDL_HDR } )
list ( APPEND STATIC_PLUGINS SDLDevice )
endif ( )
if ( WIN32 AND AUDASPACE_STANDALONE )
file ( GLOB SDL_DLLS ${ LIBRARY_PATH } /sdl/bin/*.dll )
list ( APPEND DLLS ${ SDL_DLLS } )
endif ( )
else ( )
set ( WITH_SDL FALSE CACHE BOOL "Build With SDL" FORCE )
message ( WARNING "SDL not found, plugin will not be built." )
endif ( )
endif ( )
# library configuration
if ( SHARED_LIBRARY )
set ( AUD_LIBRARY_TYPE AUD_SHARED_LIBRARY )
set ( LIBRARY_TYPE SHARED )
add_definitions ( -DAUD_BUILD_SHARED_LIBRARY )
else ( )
set ( AUD_LIBRARY_TYPE AUD_STATIC_LIBRARY )
set ( LIBRARY_TYPE STATIC )
endif ( )
# file configuration
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /config/Audaspace.h.in ${ CMAKE_CURRENT_BINARY_DIR } /Audaspace.h ESCAPE_QUOTES @ONLY )
list ( APPEND HDR ${ CMAKE_CURRENT_BINARY_DIR } /Audaspace.h )
set ( STATIC_PLUGIN_CLASSES "" )
set ( STATIC_PLUGIN_REGISTERS "" )
foreach ( PLUGIN ${ STATIC_PLUGINS } )
list ( APPEND STATIC_PLUGIN_CLASSES "STATIC_PLUGIN_CLASS(" ${ PLUGIN } ")\n" )
list ( APPEND STATIC_PLUGIN_REGISTERS "\tSTATIC_PLUGIN_REGISTER(" ${ PLUGIN } ")\n" )
endforeach ( )
string ( CONCAT STATIC_PLUGIN_CLASSES ${ STATIC_PLUGIN_CLASSES } )
string ( CONCAT STATIC_PLUGIN_REGISTERS ${ STATIC_PLUGIN_REGISTERS } )
if ( WIN32 )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /src/plugin/PluginManagerWindows.cpp.in ${ CMAKE_CURRENT_BINARY_DIR } /PluginManager.cpp ESCAPE_QUOTES @ONLY )
if ( WITH_FFTW )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /src/fx/HRTFLoaderWindows.cpp ${ CMAKE_CURRENT_BINARY_DIR } /HRTFLoader.cpp COPYONLY )
endif ( )
else ( )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /src/plugin/PluginManagerUnix.cpp.in ${ CMAKE_CURRENT_BINARY_DIR } /PluginManager.cpp ESCAPE_QUOTES @ONLY )
if ( WITH_FFTW )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /src/fx/HRTFLoaderUnix.cpp ${ CMAKE_CURRENT_BINARY_DIR } /HRTFLoader.cpp COPYONLY )
endif ( )
endif ( )
list ( APPEND SRC ${ CMAKE_CURRENT_BINARY_DIR } /PluginManager.cpp )
if ( WITH_FFTW )
list ( APPEND SRC ${ CMAKE_CURRENT_BINARY_DIR } /HRTFLoader.cpp )
endif ( )
# directories
include_directories ( ${ INCLUDE } )
link_directories ( )
# install configuration
if ( WIN32 )
set ( BIN_DESTINATION "." )
else ( )
set ( BIN_DESTINATION "bin" )
endif ( )
set ( LIB_DESTINATION "lib${LIB_SUFFIX}" )
# library
add_library ( audaspace ${ LIBRARY_TYPE } ${ SRC } ${ HDR } )
2018-06-18 06:08:08 +00:00
target_link_libraries ( audaspace ${ LIBRARIES } )
set_target_properties ( audaspace PROPERTIES SOVERSION ${ AUDASPACE_VERSION } )
2018-02-01 11:11:04 +00:00
if ( AUDASPACE_STANDALONE )
install ( TARGETS audaspace
R U N T I M E D E S T I N A T I O N $ { B I N _ D E S T I N A T I O N }
L I B R A R Y D E S T I N A T I O N $ { L I B _ D E S T I N A T I O N }
A R C H I V E D E S T I N A T I O N $ { L I B _ D E S T I N A T I O N }
)
install ( DIRECTORY ${ CMAKE_SOURCE_DIR } /include/ DESTINATION include/audaspace )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /Audaspace.h DESTINATION include/audaspace )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /packages/pkgconfig/audaspace.pc.in ${ CMAKE_CURRENT_BINARY_DIR } /audaspace.pc @ONLY )
if ( NOT WIN32 AND NOT APPLE )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /audaspace.pc DESTINATION "lib${LIB_SUFFIX}/pkgconfig" )
endif ( )
endif ( )
# plugins
if ( WITH_FFMPEG AND PLUGIN_FFMPEG )
add_definitions ( -DFFMPEG_PLUGIN )
include_directories ( ${ INCLUDE } ${ FFMPEG_INCLUDE_DIRS } )
add_library ( audffmpeg SHARED ${ FFMPEG_SRC } ${ FFMPEG_HDR } ${ HDR } )
target_link_libraries ( audffmpeg audaspace ${ FFMPEG_LIBRARIES } )
set_target_properties ( audffmpeg PROPERTIES SOVERSION ${ AUDASPACE_VERSION } )
install ( TARGETS audffmpeg DESTINATION ${ DEFAULT_PLUGIN_PATH } )
endif ( )
if ( WITH_JACK AND PLUGIN_JACK )
add_definitions ( -DJACK_PLUGIN )
include_directories ( ${ INCLUDE } ${ JACK_INCLUDE_DIRS } )
add_library ( audjack SHARED ${ JACK_SRC } ${ JACK_HDR } ${ HDR } )
if ( DYNLOAD_JACK )
target_link_libraries ( audjack audaspace )
else ( )
target_link_libraries ( audjack audaspace ${ JACK_LIBRARIES } )
endif ( )
set_target_properties ( audjack PROPERTIES SOVERSION ${ AUDASPACE_VERSION } )
install ( TARGETS audjack DESTINATION ${ DEFAULT_PLUGIN_PATH } )
endif ( )
if ( WITH_LIBSNDFILE AND PLUGIN_LIBSNDFILE )
add_definitions ( -DLIBSNDFILE_PLUGIN )
include_directories ( ${ INCLUDE } ${ LIBSNDFILE_INCLUDE_DIRS } )
add_library ( audlibsndfile SHARED ${ LIBSNDFILE_SRC } ${ LIBSNDFILE_HDR } ${ HDR } )
set_target_properties ( audlibsndfile PROPERTIES SOVERSION ${ AUDASPACE_VERSION } )
target_link_libraries ( audlibsndfile audaspace ${ LIBSNDFILE_LIBRARIES } )
install ( TARGETS audlibsndfile DESTINATION ${ DEFAULT_PLUGIN_PATH } )
endif ( )
if ( WITH_OPENAL AND PLUGIN_OPENAL )
add_definitions ( -DOPENAL_PLUGIN )
include_directories ( ${ INCLUDE } ${ OPENAL_INCLUDE_DIR } )
add_library ( audopenal SHARED ${ OPENAL_SRC } ${ OPENAL_HDR } ${ HDR } )
set_target_properties ( audopenal PROPERTIES SOVERSION ${ AUDASPACE_VERSION } )
target_link_libraries ( audopenal audaspace ${ OPENAL_LIBRARY } )
install ( TARGETS audopenal DESTINATION ${ DEFAULT_PLUGIN_PATH } )
endif ( )
if ( WITH_SDL AND PLUGIN_SDL )
add_definitions ( -DSDL_PLUGIN )
include_directories ( ${ INCLUDE } ${ SDL_INCLUDE_DIR } )
add_library ( audsdl SHARED ${ SDL_SRC } ${ SDL_HDR } ${ HDR } )
set_target_properties ( audsdl PROPERTIES SOVERSION ${ AUDASPACE_VERSION } )
target_link_libraries ( audsdl audaspace ${ SDL_LIBRARY } )
install ( TARGETS audsdl DESTINATION ${ DEFAULT_PLUGIN_PATH } )
endif ( )
# dlls
if ( WIN32 )
if ( DLLS )
install ( FILES ${ DLLS } DESTINATION ${ BIN_DESTINATION } )
endif ( )
endif ( )
# demos
if ( BUILD_DEMOS )
include_directories ( ${ INCLUDE } )
set ( DEMOS audaplay audaconvert audaremap signalgen randsounds dynamicmusic playbackmanager )
add_executable ( audaplay demos/audaplay.cpp )
target_link_libraries ( audaplay audaspace )
add_executable ( audaconvert demos/audaconvert.cpp )
target_link_libraries ( audaconvert audaspace )
add_executable ( audaremap demos/audaremap.cpp )
target_link_libraries ( audaremap audaspace )
add_executable ( signalgen demos/signalgen.cpp )
target_link_libraries ( signalgen audaspace )
add_executable ( randsounds demos/randsounds.cpp )
target_link_libraries ( randsounds audaspace )
add_executable ( dynamicmusic demos/dynamicmusic.cpp )
target_link_libraries ( dynamicmusic audaspace )
add_executable ( playbackmanager demos/playbackmanager.cpp )
target_link_libraries ( playbackmanager audaspace )
if ( WITH_FFTW )
list ( APPEND DEMOS convolution binaural )
add_executable ( convolution demos/convolution.cpp )
target_link_libraries ( convolution audaspace )
add_executable ( binaural demos/binaural.cpp )
target_link_libraries ( binaural audaspace )
endif ( )
if ( WITH_OPENAL )
list ( APPEND DEMOS openaldevices )
add_executable ( openaldevices demos/openaldevices.cpp )
if ( PLUGIN_OPENAL )
target_link_libraries ( openaldevices audaspace audopenal )
else ( )
target_link_libraries ( openaldevices audaspace )
endif ( )
endif ( )
install ( TARGETS ${ DEMOS }
R U N T I M E D E S T I N A T I O N $ { B I N _ D E S T I N A T I O N }
L I B R A R Y D E S T I N A T I O N $ { L I B _ D E S T I N A T I O N }
A R C H I V E D E S T I N A T I O N $ { L I B _ D E S T I N A T I O N }
)
endif ( )
# bindings
if ( WITH_C )
if ( SEPARATE_C )
add_library ( audaspace-c ${ LIBRARY_TYPE } ${ C_SRC } ${ C_HDR } )
target_link_libraries ( audaspace-c audaspace )
set_target_properties ( audaspace-c PROPERTIES SOVERSION ${ AUDASPACE_VERSION } )
install ( TARGETS audaspace-c
R U N T I M E D E S T I N A T I O N $ { B I N _ D E S T I N A T I O N }
L I B R A R Y D E S T I N A T I O N $ { L I B _ D E S T I N A T I O N }
A R C H I V E D E S T I N A T I O N $ { L I B _ D E S T I N A T I O N }
)
endif ( )
if ( AUDASPACE_STANDALONE )
install ( FILES ${ C_HDR } DESTINATION include/audaspace )
endif ( )
endif ( )
if ( WITH_PYTHON )
set ( PYTHON_SRC
b i n d i n g s / p y t h o n / P y A P I . c p p
b i n d i n g s / p y t h o n / P y D e v i c e . c p p
b i n d i n g s / p y t h o n / P y D y n a m i c M u s i c . c p p
b i n d i n g s / p y t h o n / P y H a n d l e . c p p
b i n d i n g s / p y t h o n / P y P l a y b a c k M a n a g e r . c p p
b i n d i n g s / p y t h o n / P y S e q u e n c e . c p p
b i n d i n g s / p y t h o n / P y S e q u e n c e E n t r y . c p p
b i n d i n g s / p y t h o n / P y S o u n d . c p p
b i n d i n g s / p y t h o n / P y S o u r c e . c p p
b i n d i n g s / p y t h o n / P y T h r e a d P o o l . c p p
)
set ( PYTHON_HDR
b i n d i n g s / p y t h o n / P y A P I . h
b i n d i n g s / p y t h o n / P y D e v i c e . h
b i n d i n g s / p y t h o n / P y D y n a m i c M u s i c . h
b i n d i n g s / p y t h o n / P y H a n d l e . h
b i n d i n g s / p y t h o n / P y P l a y b a c k M a n a g e r . h
b i n d i n g s / p y t h o n / P y S e q u e n c e . h
b i n d i n g s / p y t h o n / P y S e q u e n c e E n t r y . h
b i n d i n g s / p y t h o n / P y S o u n d . h
b i n d i n g s / p y t h o n / P y S o u r c e . h
b i n d i n g s / p y t h o n / P y T h r e a d P o o l . h
)
if ( WITH_FFTW )
list ( APPEND PYTHON_SRC
b i n d i n g s / p y t h o n / P y H R T F . c p p
b i n d i n g s / p y t h o n / P y I m p u l s e R e s p o n s e . c p p
)
list ( APPEND PYTHON_HDR
b i n d i n g s / p y t h o n / P y H R T F . h
b i n d i n g s / p y t h o n / P y I m p u l s e R e s p o n s e . h
)
endif ( )
add_library ( audaspace-py ${ LIBRARY_TYPE } ${ PYTHON_SRC } ${ PYTHON_HDR } )
target_link_libraries ( audaspace-py audaspace ${ PYTHON_LIBRARIES } )
set_target_properties ( audaspace-py PROPERTIES SOVERSION ${ AUDASPACE_VERSION } )
if ( AUDASPACE_STANDALONE )
install ( TARGETS audaspace-py
R U N T I M E D E S T I N A T I O N $ { B I N _ D E S T I N A T I O N }
L I B R A R Y D E S T I N A T I O N $ { L I B _ D E S T I N A T I O N }
A R C H I V E D E S T I N A T I O N $ { L I B _ D E S T I N A T I O N }
)
install ( FILES ${ PYTHON_HDR } DESTINATION include/audaspace/python )
endif ( )
if ( WITH_PYTHON_MODULE )
set ( PYTHON_SOURCE_DIRECTORY ${ CMAKE_CURRENT_SOURCE_DIR } /bindings/python )
configure_file ( ${ PYTHON_SOURCE_DIRECTORY } /setup.py.in ${ CMAKE_CURRENT_BINARY_DIR } /setup.py ESCAPE_QUOTES @ONLY )
if ( APPLE )
add_custom_command ( OUTPUT build COMMAND MACOSX_DEPLOYMENT_TARGET= ${ CMAKE_OSX_DEPLOYMENT_TARGET } ${ PYTHON_EXECUTABLE } setup.py build DEPENDS ${ PYTHON_SRC } ${ PYTHON_HDR } )
elseif ( WIN32 )
set ( ENV{VS100COMNTOOLS} $ENV{ VS120COMNTOOLS } )
add_custom_command ( OUTPUT build COMMAND ${ PYTHON_EXECUTABLE } setup.py build DEPENDS ${ PYTHON_SRC } ${ PYTHON_HDR } )
else ( )
add_custom_command ( OUTPUT build COMMAND ${ PYTHON_EXECUTABLE } setup.py build DEPENDS ${ PYTHON_SRC } ${ PYTHON_HDR } )
endif ( )
add_custom_target ( pythonmodule ALL DEPENDS build SOURCES ${ PYTHON_SOURCE_DIRECTORY } /setup.py.in ${ PYTHON_SRC } ${ PYTHON_HDR } )
add_dependencies ( pythonmodule audaspace )
install ( CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} setup.py install --root=\$ENV{DESTDIR} --prefix=${CMAKE_INSTALL_PREFIX})" )
endif ( )
endif ( )
# docs
if ( WITH_DOCS )
find_package ( Doxygen ${ PACKAGE_OPTION } )
if ( DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /doc/Doxyfile.in ${ CMAKE_CURRENT_BINARY_DIR } /Doxyfile @ONLY )
add_custom_target ( audaspace_doc ALL ${ DOXYGEN_EXECUTABLE } Doxyfile COMMENT "Building C++ HTML documentation with Doxygen." )
else ( )
set ( WITH_DOCS FALSE CACHE BOOL "Build C++ HTML Documentation with Doxygen" FORCE )
message ( WARNING "Doxygen (and/or dot) not found, documentation will not be built." )
endif ( )
endif ( )
if ( WITH_BINDING_DOCS )
find_package ( Sphinx ${ PACKAGE_OPTION } )
if ( SPHINX_FOUND )
configure_file ( ${ CMAKE_CURRENT_SOURCE_DIR } /bindings/doc/conf.py.in ${ CMAKE_CURRENT_BINARY_DIR } /conf.py @ONLY )
add_custom_target ( bindings_doc ALL COMMAND ${ PYTHON_EXECUTABLE } setup.py --build-docs ${ SPHINX_EXECUTABLE } -q -b html -c "${CMAKE_CURRENT_BINARY_DIR}" -d "${CMAKE_CURRENT_BINARY_DIR}/_doctrees" "${CMAKE_CURRENT_SOURCE_DIR}/bindings/doc" "${CMAKE_CURRENT_BINARY_DIR}/doc/bindings" DEPENDS pythonmodule COMMENT "Building C/Python HTML documentation with Sphinx." )
else ( )
set ( WITH_BINDING_DOCS FALSE CACHE BOOL "Build C/Python HTML Documentation with Sphinx" FORCE )
message ( WARNING "Sphinx not found, binding documentation will not be built." )
endif ( )
endif ( )
if ( WITH_DOCS OR WITH_BINDING_DOCS )
install ( DIRECTORY ${ CMAKE_CURRENT_BINARY_DIR } /doc/ DESTINATION ${ DOCUMENTATION_INSTALL_PATH } )
endif ( )