(Please use the mailing list for support requests and general discussion. This is only for actual bugs.)
Describe the bug
After building and installing via CMake, I tried to include the library in my CMake project but was met with the following error and was unable to build my CMake project
CMake Warning at CMakeLists.txt:8 (find_package):
By not providing "Findportaudio.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"portaudio", but CMake did not find one.
Could not find a package configuration file provided by "portaudio" with
any of the following names:
portaudioConfig.cmake
portaudio-config.cmake
Add the installation prefix of "portaudio" to CMAKE_PREFIX_PATH or set
"portaudio_DIR" to a directory containing one of the above files. If
"portaudio" provides a separate development package or SDK, be sure it has
been installed.
To Reproduce
Steps to reproduce the behavior. Include code if applicable.
Clone PortAudio repo master branch
Build and install PortAudio using cmake
cd build
cmake ..
sudo make install
In a separate CMake project, include the following lines in your CMakeLists.txt file
Expected behavior
Obviously, the expected behavior is for my project to build with portaudio included. I was able to successfully build my project after manually going to the location where the portaudio .cmake files were installed and renaming them to match the expected CMake naming convention.
/usr/local/lib/cmake/portaudio# ls
PortAudioConfig.cmake PortAudioTargets.cmake portaudio-targets-noconfig.cmake
PortAudioConfigVersion.cmake portaudio-config-version.cmake portaudio-targets.cmake
PortAudioTargets-noconfig.cmake portaudio-config.cmake
Desktop (please complete the following information):
OS: Windows 10 running WSL 2 Ubuntu 22.04
PortAudio version: v19.7.0
If Windows or Linux, which Host API (e.g. WASAPI): N/A
Additional context
Full CMake project CMakeLists.txt script
cmake_minimum_required(VERSION 3.14)
project(audio-sandbox VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED 20)
find_package(portaudio)
if (portaudio_FOUND)
message(STATUS "PortAudio version: " ${portaudio_VERSION})
else()
message(FATAL_ERROR "PortAudio NOT found!")
endif()
set(SOURCE_FILES
main.cpp
)
set(TARGET sandbox)
add_executable(${TARGET} ${SOURCE_FILES})
target_link_libraries(${TARGET} PortAudio::PortAudio)
Note: PortAudio is a community supported project. If you have a solution, please create a Pull Request for us to consider.
(Please use the mailing list for support requests and general discussion. This is only for actual bugs.)
Describe the bug After building and installing via CMake, I tried to include the library in my CMake project but was met with the following error and was unable to build my CMake project
To Reproduce Steps to reproduce the behavior. Include code if applicable.
Expected behavior Obviously, the expected behavior is for my project to build with portaudio included. I was able to successfully build my project after manually going to the location where the portaudio .cmake files were installed and renaming them to match the expected CMake naming convention.
Desktop (please complete the following information):
Additional context Full CMake project CMakeLists.txt script
Note: PortAudio is a community supported project. If you have a solution, please create a Pull Request for us to consider.