mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-11 09:03:36 +02:00
Updates the cmake build system
It's still has some work, but it successfully builds on all 3 main platforms. Some of the outstanding items include: Install target testing (mostly important for Linux) CMakeList clean up and comments Debug and Release build verification Audit of compile/link options Need a Mac signed and notarized build (and probably more)
This commit is contained in:
@@ -1,39 +1,53 @@
|
||||
#directory cmake-proxies/libmad
|
||||
set( TARGET libmad )
|
||||
set( TARGET_SOURCE ${LIB_SRC_DIRECTORY}${TARGET} )
|
||||
project( ${TARGET} )
|
||||
|
||||
set( SOURCES
|
||||
${LIB_SRC_DIRECTORY}libmad/bit.c
|
||||
${LIB_SRC_DIRECTORY}libmad/decoder.c
|
||||
${LIB_SRC_DIRECTORY}libmad/fixed.c
|
||||
${LIB_SRC_DIRECTORY}libmad/frame.c
|
||||
${LIB_SRC_DIRECTORY}libmad/huffman.c
|
||||
${LIB_SRC_DIRECTORY}libmad/layer12.c
|
||||
${LIB_SRC_DIRECTORY}libmad/layer3.c
|
||||
#${LIB_SRC_DIRECTORY}libmad/minimad.c
|
||||
${LIB_SRC_DIRECTORY}libmad/stream.c
|
||||
${LIB_SRC_DIRECTORY}libmad/synth.c
|
||||
${LIB_SRC_DIRECTORY}libmad/timer.c
|
||||
${LIB_SRC_DIRECTORY}libmad/version.c
|
||||
)
|
||||
# This defines the #define on both Windows and Linux.
|
||||
add_definitions(
|
||||
-D__WX__
|
||||
-DWIN32
|
||||
-D_WINDOWS
|
||||
-D__WINDOWS__
|
||||
-D__WXMSW__
|
||||
-D__WIN95__
|
||||
-D__WIN32__
|
||||
-D_LIB
|
||||
-DHAVE_CONFIG_H
|
||||
-DFPM_INTEL
|
||||
)
|
||||
add_library( ${TARGET} STATIC ${SOURCES})
|
||||
add_library( ${TARGET} STATIC )
|
||||
|
||||
target_include_directories( ${TARGET} PRIVATE
|
||||
${TARGET_SOURCE}/msvc++
|
||||
list( APPEND SOURCES
|
||||
PRIVATE
|
||||
${TARGET_ROOT}/bit.c
|
||||
${TARGET_ROOT}/decoder.c
|
||||
${TARGET_ROOT}/fixed.c
|
||||
${TARGET_ROOT}/frame.c
|
||||
${TARGET_ROOT}/huffman.c
|
||||
${TARGET_ROOT}/layer12.c
|
||||
${TARGET_ROOT}/layer3.c
|
||||
${TARGET_ROOT}/stream.c
|
||||
${TARGET_ROOT}/synth.c
|
||||
${TARGET_ROOT}/timer.c
|
||||
${TARGET_ROOT}/version.c
|
||||
)
|
||||
|
||||
target_link_libraries( ${TARGET} )
|
||||
list( APPEND INCLUDES
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/private
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/public
|
||||
${TARGET_ROOT}
|
||||
)
|
||||
|
||||
list( APPEND DEFINES
|
||||
PRIVATE
|
||||
HAVE_CONFIG_H
|
||||
OPT_ACCURACY
|
||||
$<$<IN_LIST:${CMAKE_HOST_SYSTEM_PROCESSOR},X86;AMD64;i386;i686;x86_64>:FPM_INTEL>
|
||||
$<$<NOT:$<IN_LIST:${CMAKE_HOST_SYSTEM_PROCESSOR},X86;AMD64;i386;i686;x86_64>>:FPM_DEFAULT>
|
||||
)
|
||||
|
||||
list( APPEND OPTIONS
|
||||
PRIVATE
|
||||
$<$<IN_LIST:${CMAKE_C_COMPILER_ID},GNU;Clang;AppleClang>:-Wall>
|
||||
)
|
||||
|
||||
configure_file( config.h.in private/config.h )
|
||||
|
||||
set( FPM FPM_DEFAULT )
|
||||
|
||||
configure_file( mad.h.in public/mad.h )
|
||||
|
||||
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
||||
target_sources( ${TARGET} PRIVATE ${SOURCES} )
|
||||
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
|
||||
target_compile_features( ${TARGET} PRIVATE ${FEATURES} )
|
||||
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
|
||||
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
|
||||
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )
|
||||
|
||||
|
215
cmake-proxies/libmad/config.h.in
Normal file
215
cmake-proxies/libmad/config.h.in
Normal file
@@ -0,0 +1,215 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
/*
|
||||
* libmad - MPEG audio decoder library
|
||||
* Copyright (C) 2000-2001 Robert Leslie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* $Id: acconfig.h,v 1.2 2001-10-21 22:26:32 dmazzoni Exp $
|
||||
*/
|
||||
|
||||
# ifndef LIBMAD_CONFIG_H 1
|
||||
# define LIBMAD_CONFIG_H 1
|
||||
|
||||
/*****************************************************************************
|
||||
* Definitions selected automatically by `configure' *
|
||||
*****************************************************************************/
|
||||
|
||||
/* Define to optimize for speed over accuracy. */
|
||||
#cmakedefine OPT_SPEED 1
|
||||
|
||||
/* Define to optimize for accuracy over speed. */
|
||||
#cmakedefine OPT_ACCURACY 1
|
||||
|
||||
/* Define to enable a fast subband synthesis approximation optimization. */
|
||||
#cmakedefine OPT_SSO 1
|
||||
|
||||
/* Define to influence a strict interpretation of the ISO/IEC standards,
|
||||
even if this is in opposition with best accepted practices. */
|
||||
#cmakedefine OPT_STRICT 1
|
||||
|
||||
/* Define if your MIPS CPU supports a 2-operand MADD instruction. */
|
||||
#cmakedefine HAVE_MADD_ASM 1
|
||||
|
||||
/* Define if your MIPS CPU supports a 2-operand MADD16 instruction. */
|
||||
#cmakedefine HAVE_MADD16_ASM 1
|
||||
|
||||
/* Define to enable diagnostic debugging support. */
|
||||
#cmakedefine DEBUG 1
|
||||
|
||||
/* Define to disable debugging assertions. */
|
||||
#cmakedefine NDEBUG 1
|
||||
|
||||
/* Define to enable experimental code. */
|
||||
#cmakedefine EXPERIMENTAL 1
|
||||
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#cmakedefine AC_APPLE_UNIVERSAL_BUILD 1
|
||||
|
||||
/* Define to enable diagnostic debugging support. */
|
||||
#cmakedefine DEBUG 1
|
||||
|
||||
/* Define to enable experimental code. */
|
||||
#cmakedefine EXPERIMENTAL 1
|
||||
|
||||
/* Define to 1 if you have the <assert.h> header file. */
|
||||
#cmakedefine HAVE_ASSERT_H 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#cmakedefine HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the <errno.h> header file. */
|
||||
#cmakedefine HAVE_ERRNO_H 1
|
||||
|
||||
/* Define to 1 if you have the `fcntl' function. */
|
||||
#cmakedefine HAVE_FCNTL 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#cmakedefine HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
#cmakedefine HAVE_FORK 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#cmakedefine HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#cmakedefine HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if your MIPS CPU supports a 2-operand MADD16 instruction. */
|
||||
#cmakedefine HAVE_MADD16_ASM 1
|
||||
|
||||
/* Define if your MIPS CPU supports a 2-operand MADD instruction. */
|
||||
#cmakedefine HAVE_MADD_ASM 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#cmakedefine HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `pipe' function. */
|
||||
#cmakedefine HAVE_PIPE 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#cmakedefine HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#cmakedefine HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#cmakedefine HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#cmakedefine HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#cmakedefine HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#cmakedefine HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the `waitpid' function. */
|
||||
#cmakedefine HAVE_WAITPID 1
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#cmakedefine LT_OBJDIR "@LT_OBJDIR@"
|
||||
|
||||
/* Define to disable debugging assertions. */
|
||||
#cmakedefine NDEBUG 1
|
||||
|
||||
/* Define to optimize for accuracy over speed. */
|
||||
#cmakedefine OPT_ACCURACY 1
|
||||
|
||||
/* Define to optimize for speed over accuracy. */
|
||||
#cmakedefine OPT_SPEED 1
|
||||
|
||||
/* Define to enable a fast subband synthesis approximation optimization. */
|
||||
#cmakedefine OPT_SSO 1
|
||||
|
||||
/* Define to influence a strict interpretation of the ISO/IEC standards, even
|
||||
if this is in opposition with best accepted practices. */
|
||||
#cmakedefine OPT_STRICT 1
|
||||
|
||||
/* Name of package */
|
||||
#cmakedefine PACKAGE "@PACKAGES"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#cmakedefine PACKAGE_URL "@PACKAGE_URL@"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT @SIZEOF_INT@
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG @SIZEOF_LONG@
|
||||
|
||||
/* The size of `long long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#cmakedefine STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#cmakedefine VERSION "@VERSION@"
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#cmakedefine const @const@
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
#cmakedefine inline @const@
|
||||
#endif
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#cmakedefine pid_t @pid_t@
|
||||
|
||||
/*****************************************************************************
|
||||
* End of automatically configured definitions *
|
||||
*****************************************************************************/
|
||||
|
||||
# endif
|
15
cmake-proxies/libmad/mad.h.in
Executable file
15
cmake-proxies/libmad/mad.h.in
Executable file
@@ -0,0 +1,15 @@
|
||||
#ifndef _MAD_H_
|
||||
#define _MAD_H_
|
||||
|
||||
#define @FPM@
|
||||
|
||||
#include "version.h"
|
||||
#include "fixed.h"
|
||||
#include "bit.h"
|
||||
#include "timer.h"
|
||||
#include "stream.h"
|
||||
#include "frame.h"
|
||||
#include "synth.h"
|
||||
#include "decoder.h"
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user