Skip to content

Commit

Permalink
fix rtmidi version extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
ycollet committed Oct 31, 2017
1 parent c4cce40 commit 43516de
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cmake/FindRTMIDI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,10 @@ find_library(
if(PC_RTMIDI_VERSION)
set(RTMIDI_VERSION_STRING ${PC_RTMIDI_VERSION})
elseif(RTMIDI_INCLUDE_DIR AND EXISTS "${RTMIDI_INCLUDE_DIR}/RtMidi.h")
file(
STRINGS "${RTMIDI_INCLUDE_DIR}/RtMidi.h" RTMIDI_VERSION_LINE
REGEX "^// RtMidi: Version .*$"
)
string(
REGEX REPLACE "^.*Version (.*)$" "\\1" RTMIDI_VERSION_STRING
${RTMIDI_VERSION_LINE}
)
file(STRINGS "${RTMIDI_INCLUDE_DIR}/RtMidi.h" RTMIDI_VERSION_LINE
REGEX "^#define RTMIDI_VERSION \".*\".*$")
string(REGEX REPLACE "^#define RTMIDI_VERSION \"(.*)\".*$" "\\1" RTMIDI_VERSION_STRING
${RTMIDI_VERSION_LINE})
unset(RTMIDI_VERSION_LINE)
endif()

Expand Down

0 comments on commit 43516de

Please sign in to comment.