summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-03-26 18:21:01 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-03-26 18:21:01 +0100
commit0a8588189593004d1e4bdc2df60f529383d793bf (patch)
treea84345b4ed284c25747eda66fbfa2059a34e1c30 /cmake
parent78a64741efa6ad6d0e4666b9d73f3b6d8a38d03e (diff)
CMake: Fix PortAudio package warning
This fixes a CMake 3.17.0 complaint about the variable naming in our CMake module for PortAudio detection: CMake Warning (dev) at /usr/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message): The package name passed to `find_package_handle_standard_args` (PORTAUDIO) does not match the name of the calling package (PortAudio). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern. Call Stack (most recent call first): cmake/modules/FindPortAudio.cmake:48 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:1321 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindPortAudio.cmake36
1 files changed, 18 insertions, 18 deletions
diff --git a/cmake/modules/FindPortAudio.cmake b/cmake/modules/FindPortAudio.cmake
index eb4e465ba3..59fb90f6ad 100644
--- a/cmake/modules/FindPortAudio.cmake
+++ b/cmake/modules/FindPortAudio.cmake
@@ -1,26 +1,26 @@
# - Try to find Portaudio
# Once done this will define
#
-# PORTAUDIO_FOUND - system has Portaudio
-# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
-# PORTAUDIO_LIBRARIES - Link these to use Portaudio
+# PortAudio_FOUND - system has Portaudio
+# PortAudio_INCLUDE_DIRS - the Portaudio include directory
+# PortAudio_LIBRARIES - Link these to use Portaudio
find_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
- pkg_check_modules(PC_PORTAUDIO portaudio-2.0)
+ pkg_check_modules(PC_PortAudio portaudio-2.0)
endif()
-find_path(PORTAUDIO_INCLUDE_DIRS
+find_path(PortAudio_INCLUDE_DIRS
NAMES
portaudio.h
PATHS
/usr/local/include
/usr/include
HINTS
- ${PC_PORTAUDIO_INCLUDEDIR}
+ ${PC_PortAudio_INCLUDEDIR}
)
-find_library(PORTAUDIO_LIBRARIES
+find_library(PortAudio_LIBRARIES
NAMES
portaudio
PATHS
@@ -28,27 +28,27 @@ find_library(PORTAUDIO_LIBRARIES
/usr/lib
/usr/lib64
HINTS
- ${PC_PORTAUDIO_LIBDIR}
+ ${PC_PortAudio_LIBDIR}
)
-mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
+mark_as_advanced(PortAudio_INCLUDE_DIRS PortAudio_LIBRARIES)
-# Found PORTAUDIO, but it may be version 18 which is not acceptable.
-if(EXISTS ${PORTAUDIO_INCLUDE_DIRS}/portaudio.h)
+# Found PortAudio, but it may be version 18 which is not acceptable.
+if(EXISTS ${PortAudio_INCLUDE_DIRS}/portaudio.h)
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_INCLUDES_SAVED ${CMAKE_REQUIRED_INCLUDES})
- set(CMAKE_REQUIRED_INCLUDES ${PORTAUDIO_INCLUDE_DIRS})
+ set(CMAKE_REQUIRED_INCLUDES ${PortAudio_INCLUDE_DIRS})
CHECK_CXX_SOURCE_COMPILES(
"#include <portaudio.h>\nPaDeviceIndex pa_find_device_by_name(const char *name); int main () {return 0;}"
- PORTAUDIO2_FOUND)
+ PortAudio2_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVED})
unset(CMAKE_REQUIRED_INCLUDES_SAVED)
- if(PORTAUDIO2_FOUND)
+ if(PortAudio2_FOUND)
INCLUDE(FindPackageHandleStandardArgs)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
- else(PORTAUDIO2_FOUND)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PortAudio DEFAULT_MSG PortAudio_INCLUDE_DIRS PortAudio_LIBRARIES)
+ else(PortAudio2_FOUND)
message(STATUS
" portaudio.h not compatible (requires API 2.0)")
- set(PORTAUDIO_FOUND FALSE)
- endif(PORTAUDIO2_FOUND)
+ set(PortAudio_FOUND FALSE)
+ endif(PortAudio2_FOUND)
endif()