Windows update

This commit is contained in:
Ilya Shurupov 2024-10-22 05:40:45 -07:00
parent c41dc20132
commit afad2c80e5
9 changed files with 64 additions and 51 deletions

16
cmake/FindPortAudio.cmake Normal file
View file

@ -0,0 +1,16 @@
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# relative paths
set(RELATIVE_INCLUDE_DIR "${WINDOWS_LIBRARIES}/portaudio/include")
set(RELATIVE_LIB "${WINDOWS_LIBRARIES}/portaudio_build/Debug/portaudio.lib")
# Convert to absolute paths
get_filename_component(ABSOLUTE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${RELATIVE_INCLUDE_DIR}" ABSOLUTE)
get_filename_component(ABSOLUTE_LIB "${CMAKE_CURRENT_SOURCE_DIR}/${RELATIVE_LIB}" ABSOLUTE)
# Set absolute paths with respect to the parent scope
set(PORTAUDIO_INCLUDE_DIR "${ABSOLUTE_INCLUDE_DIR}" CACHE STRING "Path to PortAudio includes")
set(PORTAUDIO_LIB "${ABSOLUTE_LIB}" CACHE STRING "Path to PortAudio library")
else()
set(PORTAUDIO_LIB portaudio CACHE STRING "Path to PortAudio library")
endif()