diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cee9176..0907da8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # Set minimum CMake required version for this project. -cmake_minimum_required(VERSION 3.13 FATAL_ERROR) +cmake_minimum_required(VERSION 3.21 FATAL_ERROR) # Define a C++ project. project(RtAudio LANGUAGES CXX) @@ -306,6 +306,10 @@ endif() string(REPLACE ";" " " apilist "${API_LIST}") message(STATUS "Compiling with support for: ${apilist}") +if(NOT PROJECT_IS_TOP_LEVEL) + return() +endif() + # PkgConfig file string(REPLACE ";" " " req "${PKGCONFIG_REQUIRES}") string(REPLACE ";" " " req_libs "${LIBS_REQUIRES}")