

If you do not want to install portaudio into your system but would rather just have it get built as part of your own project (which may be particularly convenient on Windows), you may also use: add_subdirectory("path to PortAudio location" "some binary directory" EXCLUDE_FROM_ALL)ĮXCLUDE_FROM_ALL is not strictly necessary, but will ensure that targets which you don't use in your project won't get built. To define the "portaudio_static" and "portaudio" targets in your CMake project. If you installed PortAudio as described above in Building PortAudio stand-alone on Windows, OS X or Linux and the install prefix you used (CMAKE_INSTALL_PREFIX) is in your system PATH or CMAKE_MODULE_PATH CMake variable, you should be able to use: find_package(portaudio)
CMAKE IF WINDOWS HOW TO
The following shows an example of how to build a release configuration (assuming the above command was executed previously in the same directory): C:\PABUILD> cmake -build. The equivalent of the following on POSIX'y systems: build_path> -G "Visual StuWin64"Īfter executing the above, you can either open the generated solution with Visual Studio or use CMake to invoke the build process. On Linux, CMake serves a very similar purpose to an autotools "configure" script - except it can generate build metadata apart from Makefiles.

If you are unfamiliar with CMake, this section will provide some information on using CMake to build PortAudio. You should obtain a recent version of CMake from if you do not have one already.

Building PortAudio stand-alone on Windows, OS X or LinuxĬMake can be used to generate Visual Studio solutions on Windows, Makefiles (on Linux and OS X) and build metadata for other build systems for PortAudio.
