1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-11 17:13:37 +02:00

Add the first Conan-based dependecies

add_conan_lib cmake function is defined, that allows to add a dependency using Conan with two possible system fallbacks:

1. pkg_check_modules is invoked, if `PGK_CONFIG ...` is present
2. find_package is invoked if `FIND_PACKAGE_OPTIONS` is present and `pkg_check_modules` has failed

If `ALWAYS_ALLOW_CONAN_FALLBACK` is present - `obey_system_dependencies` will be ignored for the package

Currently, the following dependencies are retrieved using Conan:

* zlib
* expat
* wxwidgets
* libmp3lame
* libid3tag
* libmad

The last three libraries are included in this commit, as they depend on zlib.
Properly pass **arch** and **os.version** to Conan
This commit is contained in:
Dmitry Vedenko
2021-05-21 18:58:48 +03:00
parent 576b7e66d2
commit 8aca9d02de
12 changed files with 1479 additions and 63 deletions

View File

@@ -97,7 +97,18 @@ if( APPLE )
endif()
# Add our module path
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake-proxies/cmake-modules)
# CMAKE_BINARY_DIR is required for Conan to work
set( AUDACITY_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-proxies/cmake-modules")
set( CMAKE_MODULE_PATH
${AUDACITY_MODULE_PATH}
${CMAKE_BINARY_DIR}
${CMAKE_MODULE_PATH}
)
set( CMAKE_PREFIX_PATH
${CMAKE_BINARY_DIR}
${CMAKE_PREFIX_PATH}
)
# This "is a good thing" but greatly increases link time on Linux
#set( CMAKE_INTERPROCEDURAL_OPTIMIZATION ON )
@@ -116,6 +127,9 @@ if( CCACHE_PROGRAM )
set_property( GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}" )
endif()
# Define option() prefix
set( _OPT "audacity_" )
# Our very own project
project( Audacity )
@@ -125,7 +139,7 @@ include( AudacityFunctions )
# Allow user to globally set the library preference
cmd_option( ${_OPT}lib_preference
"Library preference [system (if available), local]"
"local"
"system"
STRINGS "system" "local"
)
@@ -215,9 +229,6 @@ endif()
message( STATUS " Current Commit: ${GIT_COMMIT_SHORT}" )
message( STATUS )
# Define option() prefix
set( _OPT "audacity_" )
# Organize subdirectories/targets into folders for the IDEs
set_property( GLOBAL PROPERTY USE_FOLDERS ON )
@@ -437,6 +448,7 @@ find_package( Python3 )
if( Python3_FOUND )
set( PYTHON "${Python3_EXECUTABLE}" )
elseif( CMAKE_SYSTEM_NAME MATCHES "Windows" )
# This is an odd case now, as Conan requires Python as well
nuget_package( pkgdir "python3" "3.7.7" )
file( TO_NATIVE_PATH "${pkgdir}/tools/python.exe" PYTHON )
endif()
@@ -447,6 +459,10 @@ include( "src/Experimental.cmake" )
# Add our children
add_subdirectory( "cmake-proxies" )
# Conan uses find_package and does not set GLOBAL flag
resolve_conan_dependencies()
add_subdirectory( "help" )
add_subdirectory( "images" )
add_subdirectory( "libraries" )