

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. CMake-gui Windows Tutorial For Windows, cmake and make compatibilities especially can be more involved, as gcc and such compilers do not come packaged with the OS. 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) On Linux, you can also install the packages from the distribution's package manager. On Windows double click the binary to install. Dependency on protobuf To specify a dependency on protobuf, the following line can be added into CMakeLists. The executable of protobuf is not sufficient to compile C++ projects.
Cmake windows download#
"portaudio_static" for a static library and CMake Installation Head over to CMake download page and get a binary for your operating system, e.g. To build Visual C++ projects on Windows that has dependency on Google protobuf library, we can use CMake.PortAudio defines the following CMake targets:

Both ASIO and the DirectX SDK are automatically searched for by the CMake script - if they are found, they will be enabled by default. If you want ASIO support you need to obtain the ASIO2 SDK from Steinberg and place it according to Building Portaudio for Windows with ASIO support using MSVC. After cmake generates your build directory, you can use make (or nmake on Windows), or MSBUILD ( C:Program Files (x86)Microsoft Visual Studio2019Community.
Cmake 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.

Running CMake for Windows / Microsoft Visual C++ (MSVC) Run cmake-gui. Kitware also provides online and onsite CMake trainings. We will cover the process for Windows and then UNIX. 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. The CMake Tutorial is now available as the CMake Tutorial Guide in the official documentation.
