Permalink
Browse files

CMake: Fix FindSndio module

Fixes a bug where the module would set SNDIO_LIBRARY to NOT-FOUND
resulting in a CMake error when trying to link to ${SNDIO_LIBRARY}.
  • Loading branch information...
Lukas W Lukas W
Lukas W authored and Lukas W committed Jun 20, 2018
1 parent d1c36d7 commit c45a21aac3beb0bba4c1796cf591ea44d2f2bc46
Showing with 12 additions and 10 deletions.
  1. +11 −9 cmake/modules/FindSndio.cmake
  2. +1 −1 src/CMakeLists.txt
@@ -19,14 +19,16 @@ if(SNDIO_LIBRARY)
get_filename_component(SNDIO_LIBRARY_DIR ${SNDIO_LIBRARY} PATH)
endif(SNDIO_LIBRARY)
check_library_exists(sndio sio_open "${SNDIO_LIBRARY_DIR}" HAVE_SNDIO)
if(HAVE_SNDIO)
message(STATUS "Found sndio: ${SNDIO_LIBRARY}")
else(HAVE_SNDIO)
message(STATUS "sndio not found")
endif(HAVE_SNDIO)
set(SNDIO_FOUND ${HAVE_SNDIO})
check_library_exists(sndio sio_open "${SNDIO_LIBRARY_DIR}" HAVE_SIO_OPEN)
find_path(SNDIO_INCLUDE_DIR sndio.h)
find_path(SNDIO_INCLUDES sndio.h)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SNDIO DEFAULT_MSG SNDIO_LIBRARY SNDIO_INCLUDE_DIR HAVE_SIO_OPEN)
if(SNDIO_FOUND)
set(SNDIO_INCLUDE_DIRS "${SNDIO_INCLUDE_DIR}")
set(SNDIO_LIBRARIES "${SNDIO_LIBRARY}")
endif(HAVE_SNDIO)
mark_as_advanced(SNDIO_INCLUDES SNDIO_LIBRARY)
mark_as_advanced(SNDIO_INCLUDE_DIR SNDIO_LIBRARY SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES)
View
@@ -138,7 +138,7 @@ SET(LMMS_REQUIRED_LIBS ${LMMS_REQUIRED_LIBS}
${SDL_LIBRARY}
${PORTAUDIO_LIBRARIES}
${SOUNDIO_LIBRARY}
${SNDIO_LIBRARY}
${SNDIO_LIBRARIES}
${PULSEAUDIO_LIBRARIES}
${JACK_LIBRARIES}
${OGGVORBIS_LIBRARIES}

1 comment on commit c45a21a

@lukas-w

This comment has been minimized.

Show comment
Hide comment
@lukas-w

lukas-w Jun 21, 2018

Member

image
WTF

Member

lukas-w commented on c45a21a Jun 21, 2018

image
WTF

Please sign in to comment.