1
0
Fork 0
cmake_helpers/external/rnnoise/CMakeLists.txt
2021-04-29 12:22:35 +04:00

48 lines
1.7 KiB
CMake

# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
if (DESKTOP_APP_USE_PACKAGED)
add_library(external_rnnoise INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_rnnoise ALIAS external_rnnoise)
find_package(PkgConfig REQUIRED)
pkg_check_modules(RNNOISE IMPORTED_TARGET rnnoise)
target_link_libraries(external_rnnoise INTERFACE PkgConfig::RNNOISE)
else()
add_library(external_rnnoise STATIC IMPORTED GLOBAL)
add_library(desktop-app::external_rnnoise ALIAS external_rnnoise)
set(rnnoise_lib_loc ${libs_loc}/rnnoise/out)
if (WIN32)
target_include_directories(external_rnnoise
INTERFACE
${libs_loc}/rnnoise/include
)
set_target_properties(external_rnnoise PROPERTIES
IMPORTED_LOCATION "${rnnoise_lib_loc}/Release/rnnoise.lib"
IMPORTED_LOCATION_DEBUG "${rnnoise_lib_loc}/Debug/rnnoise.lib"
)
elseif (APPLE)
target_include_directories(external_rnnoise
INTERFACE
${libs_loc}/rnnoise/include
)
set_target_properties(external_rnnoise PROPERTIES
IMPORTED_LOCATION "${rnnoise_lib_loc}/Release/librnnoise.a"
IMPORTED_LOCATION_DEBUG "${rnnoise_lib_loc}/Debug/librnnoise.a"
)
else()
target_include_directories(external_rnnoise
INTERFACE
/usr/local/include
)
find_library(RNNOISE_LIBRARY librnnoise.a)
set_target_properties(external_rnnoise PROPERTIES
IMPORTED_LOCATION "${RNNOISE_LIBRARY}"
)
endif()
endif()