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( 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
|
||||
cmake_policy( SET CMP0043 NEW )
|
||||
|
||||
|
@ -96,11 +101,25 @@ include( CMakePushCheckState )
|
|||
include( GNUInstallDirs )
|
||||
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 " Host System: ${CMAKE_HOST_SYSTEM}" )
|
||||
message( STATUS " Host System Name: ${CMAKE_HOST_SYSTEM_NAME}" )
|
||||
message( STATUS " Host System Processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}" )
|
||||
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 " Compiler: ${CMAKE_CXX_COMPILER}" )
|
||||
message( STATUS " Compiler Version: ${CMAKE_CXX_COMPILER_VERSION}" )
|
||||
|
@ -176,22 +195,41 @@ if( CMAKE_GENERATOR MATCHES "Visual Studio" )
|
|||
endif()
|
||||
|
||||
# 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 up RPATH handling
|
||||
set( CMAKE_SKIP_BUILD_RPATH FALSE )
|
||||
set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE )
|
||||
set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}/audacity" )
|
||||
set( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )
|
||||
set( CMAKE_MACOSX_RPATH FALSE )
|
||||
# Define the non-install and executable paths
|
||||
if( CMAKE_CONFIGURATION_TYPES )
|
||||
set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" )
|
||||
else()
|
||||
set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}" )
|
||||
endif()
|
||||
|
||||
# the RPATH to be used when installing, but only if it's not a system directory
|
||||
#list( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" isSysDir )
|
||||
#if( "${isSysDir}" STREQUAL "-1" )
|
||||
# set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" )
|
||||
#endif()
|
||||
set( _DEST "${_DESTDIR}" )
|
||||
set( _PREFIX "${CMAKE_INSTALL_PREFIX}" )
|
||||
set( _LIBDIR "${CMAKE_INSTALL_LIBDIR}" )
|
||||
set( _DATADIR "${CMAKE_INSTALL_DATADIR}" )
|
||||
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
|
||||
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
|
||||
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
|
||||
if( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU" )
|
||||
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( "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
|
||||
find_package( PkgConfig QUIET )
|
||||
|
||||
# Mostly just to make the CMP0072 policy happy
|
||||
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
|
||||
if( NOT EXISTS "${CMAKE_BINARY_DIR}/lib" )
|
||||
file( MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
|
||||
|
|
|
@ -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}
|
||||
PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "${_DESTDIR}/${_LIBDIR}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${_DEST}/${_PKGLIB}"
|
||||
PREFIX ""
|
||||
)
|
||||
|
||||
|
|
|
@ -207,6 +207,36 @@ if( "${wxTOOLKIT}" MATCHES "GTK." )
|
|||
pkg_check_modules( GLIB REQUIRED IMPORTED_TARGET GLOBAL ${glib} )
|
||||
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_compile_definitions( ${TARGET} INTERFACE ${DEFINES} )
|
||||
target_compile_options( ${TARGET} INTERFACE ${COPTS} )
|
||||
|
|
|
@ -34,12 +34,14 @@ add_custom_command(
|
|||
|
||||
add_custom_target( ${TARGET} DEPENDS "${out}" )
|
||||
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||
install( DIRECTORY "${dst}" OPTIONAL
|
||||
DESTINATION "${_DATADIR}/audacity/help" )
|
||||
install( FILES "${_SRCDIR}/audacity.1"
|
||||
DESTINATION "${_MANDIR}/man1" )
|
||||
install( FILES "${_SRCDIR}/audacity.appdata.xml"
|
||||
DESTINATION "${_DATADIR}/appdata" )
|
||||
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||
install( DIRECTORY "${dst}" OPTIONAL
|
||||
DESTINATION "${_DATADIR}/audacity/help" )
|
||||
install( FILES "${_SRCDIR}/audacity.1"
|
||||
DESTINATION "${_MANDIR}/man1" )
|
||||
install( FILES "${_SRCDIR}/audacity.appdata.xml"
|
||||
DESTINATION "${_DATADIR}/appdata" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -15,13 +15,15 @@ list( APPEND PIXMAPS
|
|||
${_SRCDIR}/icons/48x48/audacity.xpm
|
||||
)
|
||||
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||
install( FILES "${_SRCDIR}/audacity.svg"
|
||||
DESTINATION "${_DATADIR}/icons/hicolor/scalable/apps" )
|
||||
install( DIRECTORY "${_SRCDIR}/icons/"
|
||||
DESTINATION "${_DATADIR}/icons/hicolor"
|
||||
FILES_MATCHING PATTERN "*.png" )
|
||||
install( FILES ${PIXMAPS}
|
||||
DESTINATION "${_DATADIR}/pixmaps" )
|
||||
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||
install( FILES "${_SRCDIR}/audacity.svg"
|
||||
DESTINATION "${_DATADIR}/icons/hicolor/scalable/apps" )
|
||||
install( DIRECTORY "${_SRCDIR}/icons/"
|
||||
DESTINATION "${_DATADIR}/icons/hicolor"
|
||||
FILES_MATCHING PATTERN "*.png" )
|
||||
install( FILES ${PIXMAPS}
|
||||
DESTINATION "${_DATADIR}/pixmaps" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -80,8 +80,10 @@ endforeach()
|
|||
|
||||
add_custom_target( "${TARGET}" ALL DEPENDS ${OUTPUTS} SOURCES "${SOURCES}" )
|
||||
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||
install( DIRECTORY ${locale}/
|
||||
TYPE LOCALE )
|
||||
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||
install( DIRECTORY ${locale}/
|
||||
TYPE LOCALE )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
# Include the modules that we'll build
|
||||
|
||||
if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
||||
add_subdirectory( mod-null )
|
||||
add_subdirectory( mod-nyq-bench )
|
||||
add_subdirectory( mod-script-pipe )
|
||||
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||
install( DIRECTORY "${_DEST}/modules"
|
||||
DESTINATION "${_PKGDATA}" )
|
||||
endif()
|
||||
|
||||
add_subdirectory( mod-script-pipe )
|
||||
|
||||
|
||||
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||
install( DIRECTORY "${_DEST}/modules"
|
||||
DESTINATION "${_PKGDATA}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -42,11 +42,11 @@ list( APPEND LIBRARIES
|
|||
$<$<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}
|
||||
PROPERTIES
|
||||
PREFIX ""
|
||||
FOLDER "lib-src"
|
||||
FOLDER "modules"
|
||||
)
|
||||
|
||||
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
||||
|
|
|
@ -47,11 +47,11 @@ list( APPEND LIBRARIES
|
|||
$<$<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}
|
||||
PROPERTIES
|
||||
PREFIX ""
|
||||
FOLDER "lib-src"
|
||||
FOLDER "modules"
|
||||
)
|
||||
|
||||
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
||||
|
|
|
@ -44,11 +44,11 @@ list( APPEND LIBRARIES
|
|||
$<$<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}
|
||||
PROPERTIES
|
||||
PREFIX ""
|
||||
FOLDER "lib-src"
|
||||
FOLDER "modules"
|
||||
)
|
||||
|
||||
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
||||
|
|
|
@ -82,8 +82,10 @@ endforeach()
|
|||
|
||||
add_custom_target( ${TARGET} ALL DEPENDS ${OUTPUTS} SOURCES ${SOURCES} )
|
||||
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||
install( DIRECTORY "${_DEST}/${TARGET}"
|
||||
DESTINATION "${_PKGDATA}" )
|
||||
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||
install( DIRECTORY "${_DEST}/${TARGET}"
|
||||
DESTINATION "${_PKGDATA}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -59,8 +59,10 @@ endforeach()
|
|||
|
||||
add_custom_target( ${TARGET} ALL DEPENDS ${OUTPUTS} SOURCES ${SOURCES} )
|
||||
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||
install( DIRECTORY "${_DEST}/${TARGET}"
|
||||
DESTINATION "${_PKGDATA}" )
|
||||
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
|
||||
install( DIRECTORY "${_DEST}/${TARGET}"
|
||||
DESTINATION "${_PKGDATA}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
@ -1011,12 +1011,12 @@ list( APPEND OPTIONS
|
|||
PRIVATE
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/permissive->
|
||||
$<$<CXX_COMPILER_ID:AppleClang,Clang>:-Wno-underaligned-exception-object>
|
||||
# $<$<CXX_COMPILER_ID:GNU>:-Wl,-rpath -Wl,${_RPATH}>
|
||||
)
|
||||
|
||||
list( APPEND LDFLAGS
|
||||
PRIVATE
|
||||
$<$<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( INSTALL_PREFIX "${_PREFIX}" )
|
||||
set( PKGLIBDIR "${_LIBDIR}" )
|
||||
set( LIBDIR "${_LIBDIR}" )
|
||||
set( PKGLIBDIR "${_PKGLIBDIR}" )
|
||||
set( LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}" )
|
||||
set( HAVE_GTK ${GTK_FOUND} )
|
||||
|
||||
# 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 "${_EXEDIR}" exedir )
|
||||
|
||||
# And create the script to copy the WX libs to the exeutable directory
|
||||
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
|
||||
# Copy the required wxWidgets libs into the bundle
|
||||
add_custom_command(
|
||||
TARGET
|
||||
${TARGET}
|
||||
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
|
||||
)
|
||||
|
||||
|
@ -1206,16 +1188,16 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
|||
set( HAVE_VISIBILITY 1 )
|
||||
configure_file( audacity_config.h.in private/configmac.h )
|
||||
|
||||
# Copy the wxWidgets libraries into the bundle
|
||||
if( "${CMAKE_GENERATOR}" MATCHES "Xcode" )
|
||||
add_custom_command(
|
||||
TARGET
|
||||
${TARGET}
|
||||
COMMAND
|
||||
sh -c "TARGET_BUILD_DIR=${_DEST} EXECUTABLE_PATH=MacOS/${AUDACITY_NAME} FRAMEWORKS_FOLDER_PATH=Frameworks ${topdir}/mac/scripts/install_wxlibs.sh"
|
||||
POST_BUILD
|
||||
)
|
||||
endif()
|
||||
# Copy the required wxWidgets libs into the bundle
|
||||
add_custom_command(
|
||||
TARGET
|
||||
${TARGET}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -D SRC="${_EXEDIR}/Audacity"
|
||||
-D DST="${_PKGLIB}"
|
||||
-P ${CMAKE_MODULE_PATH}/CopyLibs.cmake
|
||||
POST_BUILD
|
||||
)
|
||||
|
||||
# Define the Wrapper target
|
||||
set( WRAPPER_ROOT "${TARGET_ROOT}/../mac" )
|
||||
|
@ -1228,7 +1210,7 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
|||
organize_source( "${WRAPPER_ROOT}" "mac" "${WRAPPER_SOURCES}" )
|
||||
|
||||
else()
|
||||
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DESTDIR}" )
|
||||
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DEST}" )
|
||||
|
||||
# Create the config file
|
||||
set( HAVE_VISIBILITY 1 )
|
||||
|
@ -1275,28 +1257,16 @@ else()
|
|||
# Create the desktop file
|
||||
configure_file( audacity.desktop.in ${_INTDIR}/audacity.desktop )
|
||||
|
||||
# Create the script to copy required wxWidgets libraries
|
||||
if( ${_OPT}use_wxwidgets STREQUAL "local" )
|
||||
file( WRITE "${_INTDIR}/copy_libs.sh"
|
||||
"for lib in \$(ldd ${_EXEDIR}/${AUDACITY_NAME} | awk '/libwx/{print \$1}')
|
||||
do
|
||||
echo \${lib}
|
||||
ldd ${WXWIN}/lib/\${lib} | awk '/libwx/{print \$1}'
|
||||
done | sort -u | xargs cp -n -H -t ${_LIBDIR}
|
||||
rm \${0}"
|
||||
)
|
||||
|
||||
# And run it after the build
|
||||
add_custom_command(
|
||||
TARGET
|
||||
${TARGET}
|
||||
COMMAND
|
||||
sh "${_INTDIR}/copy_libs.sh"
|
||||
WORKING_DIRECTORY
|
||||
${WXWIN}/lib
|
||||
POST_BUILD
|
||||
)
|
||||
endif()
|
||||
# Copy the required wxWidgets libs into the bundle
|
||||
add_custom_command(
|
||||
TARGET
|
||||
${TARGET}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -D SRC="${_EXEDIR}/audacity"
|
||||
-D DST="${_DEST}/${_PKGLIB}"
|
||||
-P ${CMAKE_MODULE_PATH}/CopyLibs.cmake
|
||||
POST_BUILD
|
||||
)
|
||||
endif()
|
||||
|
||||
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_NAME ${AUDACITY_NAME} )
|
||||
|
@ -1347,17 +1317,15 @@ endif()
|
|||
|
||||
if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
install( FILES "${_DEST}/Info.plist"
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}/Audacity.app/Contents" )
|
||||
install( PROGRAMS "${_EXEDIR}/${AUDACITY_NAME}" "${_EXEDIR}/Wrapper"
|
||||
DESTINATION "${CMAKE_INSTALL_BINDIR}/Audacity.app/Contents/MacOS" )
|
||||
install( TARGETS ${TARGET}
|
||||
DESTINATION "."
|
||||
RESOURCE DESTINATION "${_APPDIR}/Resources" )
|
||||
else()
|
||||
install( PROGRAMS "${_EXEDIR}/${AUDACITY_NAME}"
|
||||
TYPE BIN )
|
||||
install( DIRECTORY "${_DESTDIR}/${_LIBDIR}/"
|
||||
install( TARGETS ${TARGET} RUNTIME )
|
||||
install( DIRECTORY "${_DEST}/${_LIBDIR}/"
|
||||
DESTINATION "${_LIBDIR}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
FILES_MATCHING PATTERN "*.so" )
|
||||
FILES_MATCHING PATTERN "*.so*" )
|
||||
install( FILES "${_INTDIR}/audacity.desktop"
|
||||
DESTINATION "${_DATADIR}/applications" )
|
||||
install( FILES "${topdir}/LICENSE.txt" "${topdir}/README.txt"
|
||||
|
|
Loading…
Reference in New Issue