mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-16 16:20:50 +02:00
Force use of our wxWidgets and fix RPATH handling
This commit is contained in:
parent
33210ec8c7
commit
c1407cdca9
121
CMakeLists.txt
121
CMakeLists.txt
@ -23,6 +23,11 @@ endif()
|
|||||||
set( topdir "${CMAKE_SOURCE_DIR}" )
|
set( topdir "${CMAKE_SOURCE_DIR}" )
|
||||||
set( libsrc "${topdir}/lib-src" )
|
set( libsrc "${topdir}/lib-src" )
|
||||||
|
|
||||||
|
# Default build type is Debug
|
||||||
|
if( NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
|
||||||
|
set( CMAKE_BUILD_TYPE "Debug" )
|
||||||
|
endif()
|
||||||
|
|
||||||
# Ignore COMPILE_DEFINITIONS_<Config> properties
|
# Ignore COMPILE_DEFINITIONS_<Config> properties
|
||||||
cmake_policy( SET CMP0043 NEW )
|
cmake_policy( SET CMP0043 NEW )
|
||||||
|
|
||||||
@ -96,11 +101,25 @@ include( CMakePushCheckState )
|
|||||||
include( GNUInstallDirs )
|
include( GNUInstallDirs )
|
||||||
include( TestBigEndian )
|
include( TestBigEndian )
|
||||||
|
|
||||||
|
# Determine 32-bit or 64-bit target
|
||||||
|
if( CMAKE_C_COMPILER_ID MATCHES "MSVC" AND CMAKE_VS_PLATFORM_NAME MATCHES "Win64|x64" )
|
||||||
|
set( IS_64BIT ON )
|
||||||
|
elseif( NOT CMAKE_SIZEOF_VOID_P STREQUAL "4" )
|
||||||
|
set( IS_64BIT ON )
|
||||||
|
endif()
|
||||||
|
|
||||||
message( STATUS "Build Info:" )
|
message( STATUS "Build Info:" )
|
||||||
message( STATUS " Host System: ${CMAKE_HOST_SYSTEM}" )
|
message( STATUS " Host System: ${CMAKE_HOST_SYSTEM}" )
|
||||||
message( STATUS " Host System Name: ${CMAKE_HOST_SYSTEM_NAME}" )
|
message( STATUS " Host System Name: ${CMAKE_HOST_SYSTEM_NAME}" )
|
||||||
message( STATUS " Host System Processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}" )
|
message( STATUS " Host System Processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}" )
|
||||||
message( STATUS " Host System Version: ${CMAKE_HOST_SYSTEM_VERSION}" )
|
message( STATUS " Host System Version: ${CMAKE_HOST_SYSTEM_VERSION}" )
|
||||||
|
|
||||||
|
if( IS_64BIT )
|
||||||
|
message( STATUS " Host System Architecture: 64-bit" )
|
||||||
|
else()
|
||||||
|
message( STATUS " Host System Architecture: 32-bit" )
|
||||||
|
endif()
|
||||||
|
|
||||||
message( STATUS )
|
message( STATUS )
|
||||||
message( STATUS " Compiler: ${CMAKE_CXX_COMPILER}" )
|
message( STATUS " Compiler: ${CMAKE_CXX_COMPILER}" )
|
||||||
message( STATUS " Compiler Version: ${CMAKE_CXX_COMPILER_VERSION}" )
|
message( STATUS " Compiler Version: ${CMAKE_CXX_COMPILER_VERSION}" )
|
||||||
@ -176,22 +195,41 @@ if( CMAKE_GENERATOR MATCHES "Visual Studio" )
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Where the final product is stored
|
# Where the final product is stored
|
||||||
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/audacity )
|
|
||||||
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/audacity )
|
|
||||||
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
|
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
|
||||||
|
|
||||||
# Set up RPATH handling
|
# Define the non-install and executable paths
|
||||||
set( CMAKE_SKIP_BUILD_RPATH FALSE )
|
if( CMAKE_CONFIGURATION_TYPES )
|
||||||
set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE )
|
set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" )
|
||||||
set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}/audacity" )
|
else()
|
||||||
set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )
|
set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}" )
|
||||||
set( CMAKE_MACOSX_RPATH FALSE )
|
endif()
|
||||||
|
|
||||||
# the RPATH to be used when installing, but only if it's not a system directory
|
set( _DEST "${_DESTDIR}" )
|
||||||
#list( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" isSysDir )
|
set( _PREFIX "${CMAKE_INSTALL_PREFIX}" )
|
||||||
#if( "${isSysDir}" STREQUAL "-1" )
|
set( _LIBDIR "${CMAKE_INSTALL_LIBDIR}" )
|
||||||
# set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" )
|
set( _DATADIR "${CMAKE_INSTALL_DATADIR}" )
|
||||||
#endif()
|
set( _PKGLIB "${_LIBDIR}/audacity" )
|
||||||
|
set( _PKGDATA "${_DATADIR}/audacity/" )
|
||||||
|
set( _MANDIR "${CMAKE_INSTALL_MANDIR}" )
|
||||||
|
set( _MODDIR "${_DEST}/modules" )
|
||||||
|
set( _EXEDIR "${_DEST}" )
|
||||||
|
|
||||||
|
# Setup RPATH handling
|
||||||
|
set( CMAKE_BUILD_RPATH "${_DEST}/${_PKGLIB}" )
|
||||||
|
set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE )
|
||||||
|
set( CMAKE_INSTALL_RPATH "${_PREFIX}/${_PKGLIB}" )
|
||||||
|
set( CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE )
|
||||||
|
|
||||||
|
# Adjust them for the Mac
|
||||||
|
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||||
|
set( _APPDIR "Audacity.app/Contents" )
|
||||||
|
set( _DEST "${_DESTDIR}/${_APPDIR}" )
|
||||||
|
set( _EXEDIR "${_DEST}/MacOS" )
|
||||||
|
set( _MODDIR "${_DEST}/modules" )
|
||||||
|
set( _PKGLIB "${_DEST}/Frameworks" )
|
||||||
|
|
||||||
|
set( CMAKE_MACOSX_RPATH OFF )
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add the math library (if found) to the list of required libraries
|
# Add the math library (if found) to the list of required libraries
|
||||||
check_library_exists( m pow "" HAVE_LIBM )
|
check_library_exists( m pow "" HAVE_LIBM )
|
||||||
@ -213,19 +251,6 @@ set( CMAKE_LINK_INTERFACE_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
|
|||||||
# Various common checks whose results are used by the different targets
|
# Various common checks whose results are used by the different targets
|
||||||
test_big_endian( WORDS_BIGENDIAN )
|
test_big_endian( WORDS_BIGENDIAN )
|
||||||
|
|
||||||
# Determine 32-bit or 64-bit target
|
|
||||||
if( CMAKE_C_COMPILER_ID MATCHES "MSVC" AND CMAKE_VS_PLATFORM_NAME MATCHES "Win64|x64" )
|
|
||||||
set( IS_64BIT ON )
|
|
||||||
elseif( NOT CMAKE_SIZEOF_VOID_P STREQUAL "4" )
|
|
||||||
set( IS_64BIT ON )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( IS_64BIT )
|
|
||||||
message( STATUS "Building for 64-bit target" )
|
|
||||||
else()
|
|
||||||
message( STATUS "Building for 32-bit target" )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Check for compiler flags
|
# Check for compiler flags
|
||||||
if( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU" )
|
if( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU" )
|
||||||
check_cxx_compiler_flag( "-mmmx" HAVE_MMX )
|
check_cxx_compiler_flag( "-mmmx" HAVE_MMX )
|
||||||
@ -333,56 +358,12 @@ check_type_size( "size_t" SIZEOF_SIZE LANGUAGE C )
|
|||||||
check_type_size( "wchar_t" SIZEOF_WCHAR LANGUAGE C )
|
check_type_size( "wchar_t" SIZEOF_WCHAR LANGUAGE C )
|
||||||
check_type_size( "void*" SIZEOF_POINTER LANGUAGE C )
|
check_type_size( "void*" SIZEOF_POINTER LANGUAGE C )
|
||||||
|
|
||||||
# Determine 32-bit or 64-bit target
|
|
||||||
if( CMAKE_C_COMPILER_ID MATCHES "MSVC" AND CMAKE_VS_PLATFORM_NAME MATCHES "Win64|x64" )
|
|
||||||
set( IS_64BIT ON )
|
|
||||||
elseif( NOT CMAKE_SIZEOF_VOID_P STREQUAL "4" )
|
|
||||||
set( IS_64BIT ON )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( IS_64BIT )
|
|
||||||
message( STATUS "Building for 64-bit target" )
|
|
||||||
else()
|
|
||||||
message( STATUS "Building for 32-bit target" )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# We'll be using it if it's available
|
# We'll be using it if it's available
|
||||||
find_package( PkgConfig QUIET )
|
find_package( PkgConfig QUIET )
|
||||||
|
|
||||||
# Mostly just to make the CMP0072 policy happy
|
# Mostly just to make the CMP0072 policy happy
|
||||||
find_package( OpenGL QUIET )
|
find_package( OpenGL QUIET )
|
||||||
|
|
||||||
# Define the non-install and executable destinations
|
|
||||||
#
|
|
||||||
# If this is a multi-config build system (VS, Xcode), CMAKE_CFG_INTDIR
|
|
||||||
# will (eventually) resolve to the build type, i.e., Debug, Release, etc.
|
|
||||||
# and CMAKE_BUILD_TYPE will be empty.
|
|
||||||
#
|
|
||||||
# For single-config build systems, CMAKE_CFG_INTDIR will be "." and
|
|
||||||
# CMAKE_BUILD_TYPE will be something like Debug.
|
|
||||||
#
|
|
||||||
# So, in either case we end up with what we want:
|
|
||||||
# .../bin/Debug//
|
|
||||||
# or:
|
|
||||||
# .../bin//Debug
|
|
||||||
set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${CMAKE_BUILD_TYPE}" )
|
|
||||||
set( _DEST "${_DESTDIR}" )
|
|
||||||
set( _EXEDIR "${_DEST}" )
|
|
||||||
string( REGEX REPLACE "/+$" "" _EXEDIR "${_EXEDIR}" )
|
|
||||||
|
|
||||||
# Adjust them for the Mac
|
|
||||||
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
|
||||||
set( _DEST "${_DEST}/Audacity.app/Contents" )
|
|
||||||
set( _EXEDIR "${_DEST}/MacOS" )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set( _PREFIX "${CMAKE_INSTALL_PREFIX}" )
|
|
||||||
set( _LIBDIR "${CMAKE_INSTALL_LIBDIR}/audacity" )
|
|
||||||
set( _RPATH "\$ORIGIN/../${_LIBDIR}" )
|
|
||||||
set( _DATADIR "${CMAKE_INSTALL_DATADIR}" )
|
|
||||||
set( _PKGDATA "${_DATADIR}/audacity/" )
|
|
||||||
set( _MANDIR "${CMAKE_INSTALL_MANDIR}" )
|
|
||||||
|
|
||||||
# Precreate the lib and lib64 directories so we can make then the same
|
# Precreate the lib and lib64 directories so we can make then the same
|
||||||
if( NOT EXISTS "${CMAKE_BINARY_DIR}/lib" )
|
if( NOT EXISTS "${CMAKE_BINARY_DIR}/lib" )
|
||||||
file( MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
|
file( MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
|
||||||
|
110
cmake-proxies/cmake-modules/CopyLibs.cmake
Normal file
110
cmake-proxies/cmake-modules/CopyLibs.cmake
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
# Copy library during build and, on the Mac, modify the dependent
|
||||||
|
# library paths.
|
||||||
|
#
|
||||||
|
# Defines required:
|
||||||
|
#
|
||||||
|
# SRC source library name
|
||||||
|
# DST destination directory
|
||||||
|
#
|
||||||
|
message( "==================================================================" )
|
||||||
|
message( "Copying wxWidgets libraries:" )
|
||||||
|
message( "${SRC} ${DST}" )
|
||||||
|
message( "==================================================================" )
|
||||||
|
|
||||||
|
# list command no longer ignores empty elements.
|
||||||
|
cmake_policy( SET CMP0007 NEW )
|
||||||
|
|
||||||
|
function( execute )
|
||||||
|
list( POP_FRONT ARGV outlist )
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND
|
||||||
|
${ARGV}
|
||||||
|
OUTPUT_VARIABLE
|
||||||
|
cmd_out
|
||||||
|
# COMMAND_ECHO STDOUT
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
|
||||||
|
#message("OUTPUT\n${cmd_out}")
|
||||||
|
|
||||||
|
# Convert output to list and strip
|
||||||
|
string( REPLACE "\n" ";" cmd_out "${cmd_out}" )
|
||||||
|
list( TRANSFORM cmd_out STRIP )
|
||||||
|
|
||||||
|
set( ${outlist} ${cmd_out} PARENT_SCOPE )
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function( gather_libs src )
|
||||||
|
if( CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" )
|
||||||
|
execute( output cmd /k dumpbin /dependents ${src} )
|
||||||
|
|
||||||
|
foreach( line ${output} )
|
||||||
|
if( line MATCHES "^ *wx.*\\.dll" )
|
||||||
|
set( lib ${WXWIN}/${line} )
|
||||||
|
|
||||||
|
list( APPEND libs ${lib} )
|
||||||
|
|
||||||
|
gather_libs( ${lib} )
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
elseif( CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin" )
|
||||||
|
execute( output otool -L ${src} )
|
||||||
|
|
||||||
|
get_filename_component( libname "${src}" NAME )
|
||||||
|
|
||||||
|
if( libname MATCHES ".*dylib" )
|
||||||
|
string( PREPEND libname "${DST}/" )
|
||||||
|
else()
|
||||||
|
set( libname "${src}" )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
foreach( line ${output} )
|
||||||
|
if( line MATCHES "^.*libwx.*\\.dylib " )
|
||||||
|
string( REGEX REPLACE "dylib .*" "dylib" line "${line}" )
|
||||||
|
if( NOT line STREQUAL "${src}" )
|
||||||
|
set( lib ${line} )
|
||||||
|
|
||||||
|
list( APPEND libs ${lib} )
|
||||||
|
|
||||||
|
get_filename_component( refname "${lib}" NAME )
|
||||||
|
list( APPEND postcmds "sh -c 'install_name_tool -change ${lib} @executable_path/../Frameworks/${refname} ${libname}'" )
|
||||||
|
|
||||||
|
gather_libs( ${lib} )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
elseif( CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" )
|
||||||
|
execute( output ldd ${src} )
|
||||||
|
|
||||||
|
foreach( line ${output} )
|
||||||
|
if( line MATCHES ".*libwx.*" )
|
||||||
|
string( REGEX REPLACE ".* => (.*) \\(.*$" "\\1" line "${line}" )
|
||||||
|
|
||||||
|
set( lib ${line} )
|
||||||
|
|
||||||
|
list( APPEND libs ${lib} )
|
||||||
|
|
||||||
|
gather_libs( ${lib} )
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set( libs ${libs} PARENT_SCOPE )
|
||||||
|
set( postcmds ${postcmds} PARENT_SCOPE )
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
gather_libs( "${SRC}" )
|
||||||
|
|
||||||
|
list( REMOVE_DUPLICATES libs )
|
||||||
|
|
||||||
|
file( INSTALL ${libs} DESTINATION ${DST} FOLLOW_SYMLINK_CHAIN )
|
||||||
|
|
||||||
|
foreach( cmd ${postcmds} )
|
||||||
|
execute_process(
|
||||||
|
COMMAND
|
||||||
|
sh -c "${cmd}"
|
||||||
|
COMMAND_ECHO STDOUT
|
||||||
|
)
|
||||||
|
endforeach()
|
||||||
|
|
@ -162,7 +162,7 @@ macro( bld name packages define sources )
|
|||||||
|
|
||||||
set_target_properties( ${name}
|
set_target_properties( ${name}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
LIBRARY_OUTPUT_DIRECTORY "${_DESTDIR}/${_LIBDIR}"
|
LIBRARY_OUTPUT_DIRECTORY "${_DEST}/${_PKGLIB}"
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -207,6 +207,36 @@ if( "${wxTOOLKIT}" MATCHES "GTK." )
|
|||||||
pkg_check_modules( GLIB REQUIRED IMPORTED_TARGET GLOBAL ${glib} )
|
pkg_check_modules( GLIB REQUIRED IMPORTED_TARGET GLOBAL ${glib} )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_file( WXVERSION_H
|
||||||
|
NAMES
|
||||||
|
wx/version.h
|
||||||
|
PATHS
|
||||||
|
${INCLUDES}
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
if( NOT WXVERSION_H )
|
||||||
|
message( FATAL_ERROR "wxWidgets version.h header not found" )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(
|
||||||
|
STRINGS
|
||||||
|
"${WXVERSION_H}" output
|
||||||
|
REGEX
|
||||||
|
"^#define +wxVERSION_STRING +"
|
||||||
|
)
|
||||||
|
|
||||||
|
string( REGEX MATCHALL "\".+(Audacity).+\"" ours "${output}")
|
||||||
|
if( NOT ours )
|
||||||
|
message( FATAL_ERROR
|
||||||
|
"\n########################################################################\n"
|
||||||
|
"Audacity version 3.0.0 or higher requires use of a customized version of "
|
||||||
|
"wxWidgets. For details:\n"
|
||||||
|
" https://wiki.audacityteam.org/wiki/Building_for_Distros\n"
|
||||||
|
"########################################################################\n"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
|
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
|
||||||
target_compile_definitions( ${TARGET} INTERFACE ${DEFINES} )
|
target_compile_definitions( ${TARGET} INTERFACE ${DEFINES} )
|
||||||
target_compile_options( ${TARGET} INTERFACE ${COPTS} )
|
target_compile_options( ${TARGET} INTERFACE ${COPTS} )
|
||||||
|
@ -34,12 +34,14 @@ add_custom_command(
|
|||||||
|
|
||||||
add_custom_target( ${TARGET} DEPENDS "${out}" )
|
add_custom_target( ${TARGET} DEPENDS "${out}" )
|
||||||
|
|
||||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||||
install( DIRECTORY "${dst}" OPTIONAL
|
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||||
DESTINATION "${_DATADIR}/audacity/help" )
|
install( DIRECTORY "${dst}" OPTIONAL
|
||||||
install( FILES "${_SRCDIR}/audacity.1"
|
DESTINATION "${_DATADIR}/audacity/help" )
|
||||||
DESTINATION "${_MANDIR}/man1" )
|
install( FILES "${_SRCDIR}/audacity.1"
|
||||||
install( FILES "${_SRCDIR}/audacity.appdata.xml"
|
DESTINATION "${_MANDIR}/man1" )
|
||||||
DESTINATION "${_DATADIR}/appdata" )
|
install( FILES "${_SRCDIR}/audacity.appdata.xml"
|
||||||
|
DESTINATION "${_DATADIR}/appdata" )
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -15,13 +15,15 @@ list( APPEND PIXMAPS
|
|||||||
${_SRCDIR}/icons/48x48/audacity.xpm
|
${_SRCDIR}/icons/48x48/audacity.xpm
|
||||||
)
|
)
|
||||||
|
|
||||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||||
install( FILES "${_SRCDIR}/audacity.svg"
|
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||||
DESTINATION "${_DATADIR}/icons/hicolor/scalable/apps" )
|
install( FILES "${_SRCDIR}/audacity.svg"
|
||||||
install( DIRECTORY "${_SRCDIR}/icons/"
|
DESTINATION "${_DATADIR}/icons/hicolor/scalable/apps" )
|
||||||
DESTINATION "${_DATADIR}/icons/hicolor"
|
install( DIRECTORY "${_SRCDIR}/icons/"
|
||||||
FILES_MATCHING PATTERN "*.png" )
|
DESTINATION "${_DATADIR}/icons/hicolor"
|
||||||
install( FILES ${PIXMAPS}
|
FILES_MATCHING PATTERN "*.png" )
|
||||||
DESTINATION "${_DATADIR}/pixmaps" )
|
install( FILES ${PIXMAPS}
|
||||||
|
DESTINATION "${_DATADIR}/pixmaps" )
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -80,8 +80,10 @@ endforeach()
|
|||||||
|
|
||||||
add_custom_target( "${TARGET}" ALL DEPENDS ${OUTPUTS} SOURCES "${SOURCES}" )
|
add_custom_target( "${TARGET}" ALL DEPENDS ${OUTPUTS} SOURCES "${SOURCES}" )
|
||||||
|
|
||||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||||
install( DIRECTORY ${locale}/
|
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||||
TYPE LOCALE )
|
install( DIRECTORY ${locale}/
|
||||||
|
TYPE LOCALE )
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
# Include the modules that we'll build
|
# Include the modules that we'll build
|
||||||
|
|
||||||
|
if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
||||||
add_subdirectory( mod-null )
|
add_subdirectory( mod-null )
|
||||||
add_subdirectory( mod-nyq-bench )
|
add_subdirectory( mod-nyq-bench )
|
||||||
add_subdirectory( mod-script-pipe )
|
endif()
|
||||||
|
|
||||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
add_subdirectory( mod-script-pipe )
|
||||||
install( DIRECTORY "${_DEST}/modules"
|
|
||||||
DESTINATION "${_PKGDATA}" )
|
|
||||||
|
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||||
|
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||||
|
install( DIRECTORY "${_DEST}/modules"
|
||||||
|
DESTINATION "${_PKGDATA}" )
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -42,11 +42,11 @@ list( APPEND LIBRARIES
|
|||||||
$<$<PLATFORM_ID:Windows>:wxWidgets>
|
$<$<PLATFORM_ID:Windows>:wxWidgets>
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_DEST}/modules" )
|
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_MODDIR}" )
|
||||||
set_target_properties( ${TARGET}
|
set_target_properties( ${TARGET}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
FOLDER "lib-src"
|
FOLDER "modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
||||||
|
@ -47,11 +47,11 @@ list( APPEND LIBRARIES
|
|||||||
$<$<PLATFORM_ID:Windows>:wxWidgets>
|
$<$<PLATFORM_ID:Windows>:wxWidgets>
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_DEST}/modules" )
|
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_MODDIR}" )
|
||||||
set_target_properties( ${TARGET}
|
set_target_properties( ${TARGET}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
FOLDER "lib-src"
|
FOLDER "modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
||||||
|
@ -44,11 +44,11 @@ list( APPEND LIBRARIES
|
|||||||
$<$<PLATFORM_ID:Windows,CYGWIN>:wxWidgets>
|
$<$<PLATFORM_ID:Windows,CYGWIN>:wxWidgets>
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_DEST}/modules" )
|
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_MODDIR}" )
|
||||||
set_target_properties( ${TARGET}
|
set_target_properties( ${TARGET}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
FOLDER "lib-src"
|
FOLDER "modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
||||||
|
@ -82,8 +82,10 @@ endforeach()
|
|||||||
|
|
||||||
add_custom_target( ${TARGET} ALL DEPENDS ${OUTPUTS} SOURCES ${SOURCES} )
|
add_custom_target( ${TARGET} ALL DEPENDS ${OUTPUTS} SOURCES ${SOURCES} )
|
||||||
|
|
||||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||||
install( DIRECTORY "${_DEST}/${TARGET}"
|
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||||
DESTINATION "${_PKGDATA}" )
|
install( DIRECTORY "${_DEST}/${TARGET}"
|
||||||
|
DESTINATION "${_PKGDATA}" )
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -59,8 +59,10 @@ endforeach()
|
|||||||
|
|
||||||
add_custom_target( ${TARGET} ALL DEPENDS ${OUTPUTS} SOURCES ${SOURCES} )
|
add_custom_target( ${TARGET} ALL DEPENDS ${OUTPUTS} SOURCES ${SOURCES} )
|
||||||
|
|
||||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||||
install( DIRECTORY "${_DEST}/${TARGET}"
|
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||||
DESTINATION "${_PKGDATA}" )
|
install( DIRECTORY "${_DEST}/${TARGET}"
|
||||||
|
DESTINATION "${_PKGDATA}" )
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -1011,12 +1011,12 @@ list( APPEND OPTIONS
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:/permissive->
|
$<$<CXX_COMPILER_ID:MSVC>:/permissive->
|
||||||
$<$<CXX_COMPILER_ID:AppleClang,Clang>:-Wno-underaligned-exception-object>
|
$<$<CXX_COMPILER_ID:AppleClang,Clang>:-Wno-underaligned-exception-object>
|
||||||
# $<$<CXX_COMPILER_ID:GNU>:-Wl,-rpath -Wl,${_RPATH}>
|
|
||||||
)
|
)
|
||||||
|
|
||||||
list( APPEND LDFLAGS
|
list( APPEND LDFLAGS
|
||||||
PRIVATE
|
PRIVATE
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:/MANIFEST:NO>
|
$<$<CXX_COMPILER_ID:MSVC>:/MANIFEST:NO>
|
||||||
|
$<$<CXX_COMPILER_ID:GNU>:-Wl,--disable-new-dtags>
|
||||||
)
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -1055,8 +1055,8 @@ list( APPEND LIBRARIES
|
|||||||
|
|
||||||
set( BUILDING_AUDACITY YES )
|
set( BUILDING_AUDACITY YES )
|
||||||
set( INSTALL_PREFIX "${_PREFIX}" )
|
set( INSTALL_PREFIX "${_PREFIX}" )
|
||||||
set( PKGLIBDIR "${_LIBDIR}" )
|
set( PKGLIBDIR "${_PKGLIBDIR}" )
|
||||||
set( LIBDIR "${_LIBDIR}" )
|
set( LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}" )
|
||||||
set( HAVE_GTK ${GTK_FOUND} )
|
set( HAVE_GTK ${GTK_FOUND} )
|
||||||
|
|
||||||
# Do not define these for Windows or Mac until further testing
|
# Do not define these for Windows or Mac until further testing
|
||||||
@ -1100,33 +1100,15 @@ if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
|||||||
file( TO_NATIVE_PATH "${wxWidgets_LIB_DIR}" libdir )
|
file( TO_NATIVE_PATH "${wxWidgets_LIB_DIR}" libdir )
|
||||||
file( TO_NATIVE_PATH "${_EXEDIR}" exedir )
|
file( TO_NATIVE_PATH "${_EXEDIR}" exedir )
|
||||||
|
|
||||||
# And create the script to copy the WX libs to the exeutable directory
|
# Copy the required wxWidgets libs into the bundle
|
||||||
file( WRITE "${_INTDIR}/copy_libs.bat"
|
|
||||||
"@ECHO OFF
|
|
||||||
IF NOT %1 EQU xyzzy (
|
|
||||||
IF EXIST \"${dlls}\" DEL \"${dlls}\"
|
|
||||||
CALL %0 xyzzy \"%1\" %2
|
|
||||||
FOR /F \"delims=\" %%c IN ('SORT \"${dlls}\"') DO (
|
|
||||||
IF NOT EXIST \"%1\"\\%%c (
|
|
||||||
xcopy \"${libdir}\"\\%%c \"%1\"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
DEL ${dlls}
|
|
||||||
)
|
|
||||||
IF %1 EQU xyzzy (
|
|
||||||
FOR /F %%i IN ('DUMPBIN /DEPENDENTS \"%2\"\\%3 ^| findstr /B \"/C: wx\"') DO (
|
|
||||||
ECHO %%i >>\"${dlls}\"
|
|
||||||
CALL %0 xyzzy \"${libdir}\" %%i
|
|
||||||
)
|
|
||||||
)"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add it to the build
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET
|
TARGET
|
||||||
${TARGET}
|
${TARGET}
|
||||||
COMMAND
|
COMMAND
|
||||||
${_INTDIR}/copy_libs.bat ${exedir} ${AUDACITY_NAME}.exe
|
${CMAKE_COMMAND} -D SRC="${_EXEDIR}/Audacity.exe"
|
||||||
|
-D DST="${_EXEDIR}"
|
||||||
|
-D WXWIN="${libdir}"
|
||||||
|
-P ${CMAKE_MODULE_PATH}/CopyLibs.cmake
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1206,16 +1188,16 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
|||||||
set( HAVE_VISIBILITY 1 )
|
set( HAVE_VISIBILITY 1 )
|
||||||
configure_file( audacity_config.h.in private/configmac.h )
|
configure_file( audacity_config.h.in private/configmac.h )
|
||||||
|
|
||||||
# Copy the wxWidgets libraries into the bundle
|
# Copy the required wxWidgets libs into the bundle
|
||||||
if( "${CMAKE_GENERATOR}" MATCHES "Xcode" )
|
add_custom_command(
|
||||||
add_custom_command(
|
TARGET
|
||||||
TARGET
|
${TARGET}
|
||||||
${TARGET}
|
COMMAND
|
||||||
COMMAND
|
${CMAKE_COMMAND} -D SRC="${_EXEDIR}/Audacity"
|
||||||
sh -c "TARGET_BUILD_DIR=${_DEST} EXECUTABLE_PATH=MacOS/${AUDACITY_NAME} FRAMEWORKS_FOLDER_PATH=Frameworks ${topdir}/mac/scripts/install_wxlibs.sh"
|
-D DST="${_PKGLIB}"
|
||||||
POST_BUILD
|
-P ${CMAKE_MODULE_PATH}/CopyLibs.cmake
|
||||||
)
|
POST_BUILD
|
||||||
endif()
|
)
|
||||||
|
|
||||||
# Define the Wrapper target
|
# Define the Wrapper target
|
||||||
set( WRAPPER_ROOT "${TARGET_ROOT}/../mac" )
|
set( WRAPPER_ROOT "${TARGET_ROOT}/../mac" )
|
||||||
@ -1228,7 +1210,7 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
|||||||
organize_source( "${WRAPPER_ROOT}" "mac" "${WRAPPER_SOURCES}" )
|
organize_source( "${WRAPPER_ROOT}" "mac" "${WRAPPER_SOURCES}" )
|
||||||
|
|
||||||
else()
|
else()
|
||||||
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DESTDIR}" )
|
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DEST}" )
|
||||||
|
|
||||||
# Create the config file
|
# Create the config file
|
||||||
set( HAVE_VISIBILITY 1 )
|
set( HAVE_VISIBILITY 1 )
|
||||||
@ -1275,28 +1257,16 @@ else()
|
|||||||
# Create the desktop file
|
# Create the desktop file
|
||||||
configure_file( audacity.desktop.in ${_INTDIR}/audacity.desktop )
|
configure_file( audacity.desktop.in ${_INTDIR}/audacity.desktop )
|
||||||
|
|
||||||
# Create the script to copy required wxWidgets libraries
|
# Copy the required wxWidgets libs into the bundle
|
||||||
if( ${_OPT}use_wxwidgets STREQUAL "local" )
|
add_custom_command(
|
||||||
file( WRITE "${_INTDIR}/copy_libs.sh"
|
TARGET
|
||||||
"for lib in \$(ldd ${_EXEDIR}/${AUDACITY_NAME} | awk '/libwx/{print \$1}')
|
${TARGET}
|
||||||
do
|
COMMAND
|
||||||
echo \${lib}
|
${CMAKE_COMMAND} -D SRC="${_EXEDIR}/audacity"
|
||||||
ldd ${WXWIN}/lib/\${lib} | awk '/libwx/{print \$1}'
|
-D DST="${_DEST}/${_PKGLIB}"
|
||||||
done | sort -u | xargs cp -n -H -t ${_LIBDIR}
|
-P ${CMAKE_MODULE_PATH}/CopyLibs.cmake
|
||||||
rm \${0}"
|
POST_BUILD
|
||||||
)
|
)
|
||||||
|
|
||||||
# And run it after the build
|
|
||||||
add_custom_command(
|
|
||||||
TARGET
|
|
||||||
${TARGET}
|
|
||||||
COMMAND
|
|
||||||
sh "${_INTDIR}/copy_libs.sh"
|
|
||||||
WORKING_DIRECTORY
|
|
||||||
${WXWIN}/lib
|
|
||||||
POST_BUILD
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_NAME ${AUDACITY_NAME} )
|
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_NAME ${AUDACITY_NAME} )
|
||||||
@ -1347,17 +1317,15 @@ endif()
|
|||||||
|
|
||||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||||
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||||
install( FILES "${_DEST}/Info.plist"
|
install( TARGETS ${TARGET}
|
||||||
DESTINATION "${CMAKE_INSTALL_BINDIR}/Audacity.app/Contents" )
|
DESTINATION "."
|
||||||
install( PROGRAMS "${_EXEDIR}/${AUDACITY_NAME}" "${_EXEDIR}/Wrapper"
|
RESOURCE DESTINATION "${_APPDIR}/Resources" )
|
||||||
DESTINATION "${CMAKE_INSTALL_BINDIR}/Audacity.app/Contents/MacOS" )
|
|
||||||
else()
|
else()
|
||||||
install( PROGRAMS "${_EXEDIR}/${AUDACITY_NAME}"
|
install( TARGETS ${TARGET} RUNTIME )
|
||||||
TYPE BIN )
|
install( DIRECTORY "${_DEST}/${_LIBDIR}/"
|
||||||
install( DIRECTORY "${_DESTDIR}/${_LIBDIR}/"
|
|
||||||
DESTINATION "${_LIBDIR}"
|
DESTINATION "${_LIBDIR}"
|
||||||
USE_SOURCE_PERMISSIONS
|
USE_SOURCE_PERMISSIONS
|
||||||
FILES_MATCHING PATTERN "*.so" )
|
FILES_MATCHING PATTERN "*.so*" )
|
||||||
install( FILES "${_INTDIR}/audacity.desktop"
|
install( FILES "${_INTDIR}/audacity.desktop"
|
||||||
DESTINATION "${_DATADIR}/applications" )
|
DESTINATION "${_DATADIR}/applications" )
|
||||||
install( FILES "${topdir}/LICENSE.txt" "${topdir}/README.txt"
|
install( FILES "${topdir}/LICENSE.txt" "${topdir}/README.txt"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user