2019-03-17 19:36:55 +01:00
# qaac doesn't have a Visual Studio project for Windows, so this not only allows things to build for Visual Studio, but also covers other compilers and platforms
configure_file ( ${ QAAC_PATH } /mp4v2/libplatform/config.h.in ${ CMAKE_BINARY_DIR } /mp4v2/include/libplatform/config.h COPYONLY )
file ( GLOB INCLUDE_HEADERS "${QAAC_PATH}/mp4v2/include/mp4v2/*.h" )
file ( GLOB LIBPLATFORM_HEADERS "${QAAC_PATH}/mp4v2/libplatform/*.h" )
file ( GLOB LIBPLATFORM_IO_HEADERS "${QAAC_PATH}/mp4v2/libplatform/io/*.h" )
file ( GLOB LIBPLATFORM_IO_SOURCES "${QAAC_PATH}/mp4v2/libplatform/io/*.cpp" )
file ( GLOB LIBPLATFORM_NUMBER_HEADERS "${QAAC_PATH}/mp4v2/libplatform/number/*.h" )
file ( GLOB LIBPLATFORM_PROCESS_HEADERS "${QAAC_PATH}/mp4v2/libplatform/process/*.h" )
file ( GLOB LIBPLATFORM_PROG_HEADERS "${QAAC_PATH}/mp4v2/libplatform/prog/*.h" )
list ( FILTER LIBPLATFORM_PROG_HEADERS EXCLUDE REGEX ".*commandline.*" )
file ( GLOB LIBPLATFORM_PROG_SOURCES "${QAAC_PATH}/mp4v2/libplatform/prog/*.cpp" )
list ( FILTER LIBPLATFORM_PROG_SOURCES EXCLUDE REGEX ".*commandline.*" )
file ( GLOB LIBPLATFORM_SYS_HEADERS "${QAAC_PATH}/mp4v2/libplatform/sys/*.h" )
file ( GLOB LIBPLATFORM_SYS_SOURCES "${QAAC_PATH}/mp4v2/libplatform/sys/*.cpp" )
file ( GLOB LIBPLATFORM_TIME_HEADERS "${QAAC_PATH}/mp4v2/libplatform/time/*.h" )
file ( GLOB LIBPLATFORM_TIME_SOURCES "${QAAC_PATH}/mp4v2/libplatform/time/*.cpp" )
file ( GLOB SRC_HEADERS "${QAAC_PATH}/mp4v2/src/*.h" )
file ( GLOB SRC_SOURCES "${QAAC_PATH}/mp4v2/src/*.cpp" )
file ( GLOB SRC_BMFF_HEADERS "${QAAC_PATH}/mp4v2/src/bmff/*.h" )
file ( GLOB SRC_BMFF_SOURCES "${QAAC_PATH}/mp4v2/src/bmff/*.cpp" )
file ( GLOB SRC_ITMF_HEADERS "${QAAC_PATH}/mp4v2/src/itmf/*.h" )
file ( GLOB SRC_ITMF_SOURCES "${QAAC_PATH}/mp4v2/src/itmf/*.cpp" )
file ( GLOB SRC_QTFF_HEADERS "${QAAC_PATH}/mp4v2/src/qtff/*.h" )
file ( GLOB SRC_QTFF_SOURCES "${QAAC_PATH}/mp4v2/src/qtff/*.cpp" )
if ( WIN32 )
list ( FILTER LIBPLATFORM_HEADERS EXCLUDE REGEX ".*posix.*" )
set ( LIBPLATFORM_SOURCES
$ { Q A A C _ P A T H } / m p 4 v 2 / l i b p l a t f o r m / p l a t f o r m _ w i n 3 2 . c p p )
list ( FILTER LIBPLATFORM_IO_SOURCES EXCLUDE REGEX ".*posix.*" )
set ( LIBPLATFORM_NUMBER_SOURCES
$ { Q A A C _ P A T H } / m p 4 v 2 / l i b p l a t f o r m / n u m b e r / r a n d o m _ w i n 3 2 . c p p )
set ( LIBPLATFORM_PROCESS_SOURCES
$ { Q A A C _ P A T H } / m p 4 v 2 / l i b p l a t f o r m / p r o c e s s / p r o c e s s _ w i n 3 2 . c p p )
list ( FILTER LIBPLATFORM_TIME_SOURCES EXCLUDE REGEX ".*posix.*" )
else ( )
list ( FILTER LIBPLATFORM_HEADERS EXCLUDE REGEX ".*win32.*" )
list ( FILTER LIBPLATFORM_IO_SOURCES EXCLUDE REGEX ".*win32.*" )
set ( LIBPLATFORM_NUMBER_SOURCES
$ { Q A A C _ P A T H } / m p 4 v 2 / l i b p l a t f o r m / n u m b e r / r a n d o m _ p o s i x . c p p )
set ( LIBPLATFORM_PROCESS_SOURCES
$ { Q A A C _ P A T H } / m p 4 v 2 / l i b p l a t f o r m / p r o c e s s / p r o c e s s _ p o s i x . c p p )
list ( FILTER LIBPLATFORM_TIME_SOURCES EXCLUDE REGEX ".*win32.*" )
endif ( )
# Setup source groups, mainly for Visual Studio
source_group ( "Header Files\\libplatform" FILES ${ LIBPLATFORM_HEADERS } )
source_group ( "Header Files\\libplatform\\io" FILES ${ LIBPLATFORM_IO_HEADERS } )
source_group ( "Header Files\\libplatform\\number" FILES ${ LIBPLATFORM_NUMBER_HEADERS } )
source_group ( "Header Files\\libplatform\\process" FILES ${ LIBPLATFORM_PROCESS_HEADERS } )
source_group ( "Header Files\\libplatform\\prog" FILES ${ LIBPLATFORM_PROG_HEADERS } )
source_group ( "Header Files\\libplatform\\sys" FILES ${ LIBPLATFORM_SYS_HEADERS } )
source_group ( "Header Files\\libplatform\\time" FILES ${ LIBPLATFORM_TIME_HEADERS } )
source_group ( "Header Files\\src" FILES ${ SRC_HEADERS } )
source_group ( "Header Files\\src\\bmff" FILES ${ SRC_BMFF_HEADERS } )
source_group ( "Header Files\\src\\itmf" FILES ${ SRC_ITMF_HEADERS } )
source_group ( "Header Files\\src\\qtff" FILES ${ SRC_QTFF_HEADERS } )
source_group ( "Source Files\\libplatform" FILES ${ LIBPLATFORM_SOURCES } )
source_group ( "Source Files\\libplatform\\io" FILES ${ LIBPLATFORM_IO_SOURCES } )
source_group ( "Source Files\\libplatform\\number" FILES ${ LIBPLATFORM_NUMBER_SOURCES } )
source_group ( "Source Files\\libplatform\\process" FILES ${ LIBPLATFORM_PROCESS_SOURCES } )
source_group ( "Source Files\\libplatform\\prog" FILES ${ LIBPLATFORM_PROG_SOURCES } )
source_group ( "Source Files\\libplatform\\sys" FILES ${ LIBPLATFORM_SYS_SOURCES } )
source_group ( "Source Files\\libplatform\\time" FILES ${ LIBPLATFORM_TIME_SOURCES } )
source_group ( "Source Files\\src" FILES ${ SRC_SOURCES } )
source_group ( "Source Files\\src\\bmff" FILES ${ SRC_BMFF_SOURCES } )
source_group ( "Source Files\\src\\itmf" FILES ${ SRC_ITMF_SOURCES } )
source_group ( "Source Files\\src\\qtff" FILES ${ SRC_QTFF_SOURCES } )
add_library ( mp4v2 STATIC
$ { I N C L U D E _ H E A D E R S }
$ { L I B P L A T F O R M _ H E A D E R S }
$ { L I B P L A T F O R M _ S O U R C E S }
$ { L I B P L A T F O R M _ I O _ H E A D E R S }
$ { L I B P L A T F O R M _ I O _ S O U R C E S }
$ { L I B P L A T F O R M _ N U M B E R _ H E A D E R S }
$ { L I B P L A T F O R M _ N U M B E R _ S O U R C E S }
$ { L I B P L A T F O R M _ P R O C E S S _ H E A D E R S }
$ { L I B P L A T F O R M _ P R O C E S S _ S O U R C E S }
$ { L I B P L A T F O R M _ P R O G _ H E A D E R S }
$ { L I B P L A T F O R M _ P R O G _ S O U R C E S }
$ { L I B P L A T F O R M _ S Y S _ H E A D E R S }
$ { L I B P L A T F O R M _ S Y S _ S O U R C E S }
$ { L I B P L A T F O R M _ T I M E _ H E A D E R S }
$ { L I B P L A T F O R M _ T I M E _ S O U R C E S }
$ { S R C _ H E A D E R S }
$ { S R C _ S O U R C E S }
$ { S R C _ B M F F _ H E A D E R S }
$ { S R C _ B M F F _ S O U R C E S }
$ { S R C _ I T M F _ H E A D E R S }
$ { S R C _ I T M F _ S O U R C E S }
$ { S R C _ Q T F F _ H E A D E R S }
$ { S R C _ Q T F F _ S O U R C E S } )
# Add the preprocessor definitions
target_compile_definitions ( mp4v2 PRIVATE
U N I C O D E
_ U N I C O D E )
# Set up the proper include directories
target_include_directories ( mp4v2 PRIVATE
$ { Q A A C _ P A T H } / m p 4 v 2
$ { Q A A C _ P A T H } / m p 4 v 2 / i n c l u d e
$ { C M A K E _ B I N A R Y _ D I R } / m p 4 v 2 / i n c l u d e )
# Make sure that whatever compiler we use can handle these features
target_compile_features ( mp4v2 PRIVATE
c x x _ l o n g _ l o n g _ t y p e
c x x _ v a r i a d i c _ m a c r o s )
2019-03-18 05:17:08 +01:00
# Set up position-independent code
set_target_properties ( mp4v2 PROPERTIES
P O S I T I O N _ I N D E P E N D E N T _ C O D E T R U E )