6
A
回答
6
這裏有一個:
# - 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_DEFINITIONS - Compiler switches required for using Portaudio
# PORTAUDIO_VERSION - Portaudio version
#
# Copyright (c) 2006 Andreas Schneider <[email protected]>
#
# Redistribution and use is allowed according to the terms of the New BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
# in cache already
set(PORTAUDIO_FOUND TRUE)
else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
if (NOT WIN32)
include(FindPkgConfig)
pkg_check_modules(PORTAUDIO2 portaudio-2.0)
endif (NOT WIN32)
if (PORTAUDIO2_FOUND)
set(PORTAUDIO_INCLUDE_DIRS
${PORTAUDIO2_INCLUDE_DIRS}
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(PORTAUDIO_LIBRARIES "${PORTAUDIO2_LIBRARY_DIRS}/lib${PORTAUDIO2_LIBRARIES}.dylib")
else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(PORTAUDIO_LIBRARIES
${PORTAUDIO2_LIBRARIES}
)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(PORTAUDIO_VERSION
19
)
set(PORTAUDIO_FOUND TRUE)
else (PORTAUDIO2_FOUND)
find_path(PORTAUDIO_INCLUDE_DIR
NAMES
portaudio.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)
find_library(PORTAUDIO_LIBRARY
NAMES
portaudio
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
find_path(PORTAUDIO_LIBRARY_DIR
NAMES
portaudio
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
set(PORTAUDIO_INCLUDE_DIRS
${PORTAUDIO_INCLUDE_DIR}
)
set(PORTAUDIO_LIBRARIES
${PORTAUDIO_LIBRARY}
)
set(PORTAUDIO_LIBRARY_DIRS
${PORTAUDIO_LIBRARY_DIR}
)
set(PORTAUDIO_VERSION
18
)
if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
set(PORTAUDIO_FOUND TRUE)
endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES)
if (PORTAUDIO_FOUND)
if (NOT Portaudio_FIND_QUIETLY)
message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
endif (NOT Portaudio_FIND_QUIETLY)
else (PORTAUDIO_FOUND)
if (Portaudio_FIND_REQUIRED)
message(FATAL_ERROR "Could not find Portaudio")
endif (Portaudio_FIND_REQUIRED)
endif (PORTAUDIO_FOUND)
endif (PORTAUDIO2_FOUND)
# show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
相關問題
- 1. Cmake包含文件
- 2. CMake和Window.Lib文件
- 3. 使用CMake的zip文件?
- 4. CMake的depend.make文件空
- 5. CMake衝突的頭文件
- 6. C++項目的CMake文件
- 7. CMake的鏈接文件
- 8. CMake globbing生成的文件
- 9. PortAudio-19 for mac
- 10. CMake的:仰望在cmake的文件中的變量,而不與其他文件
- 11. 播放帶有portaudio和sndfile的wav文件
- 12. Portaudio錯誤「LNK1104:無法打開文件'ksguid.lib'」文件不在我的電腦上?
- 13. CMake的FindPackage在從父顯示目錄cmake的文件夾add_subdirectory
- 14. Pyaudio,portaudio和mac 10.7.5
- 15. 在cmake中,可以cmake文件夾和CMakeLists.txt坐在不同的文件夾?
- 16. 爲cmake生成文件
- 17. 用CMake添加文件
- 18. cmake創建大量文件
- 19. CMake - 找不到文件
- 20. 參考文件與CMake
- 21. cmake找不到頭文件
- 22. cmake set_property SOURCE文件與COMPILE_FLAGS
- 23. cMake SOURCE_GROUP多個文件?
- 24. Portaudio + Opus:糟糕的音質
- 25. Portaudio:打開文件而不是使用麥克風
- 26. CMake的增加的.o和.a文件
- 27. 調用從不同的文件cmake的
- 28. CMake的可執行文件的位置
- 29. CMake無法找到我的庫文件
- 30. 使用cmake安裝的PDB文件