Skip to content
Permalink
Browse files

Bump rtmidi-4.0.0. Add lib/ for contributed libraries.

  • Loading branch information...
matevz committed Sep 15, 2019
1 parent b3ad9bd commit 1c2fba037b3922fa7a7f5ce7258c957e4ac0ed8d
Showing with 56,699 additions and 2,770 deletions.
  1. +1 −1 AUTHORS
  2. +5 −0 README
  3. +273 −0 lib/rtmidi-4.0.0/CMakeLists.txt
  4. +21 −0 lib/rtmidi-4.0.0/Makefile.am
  5. +1,058 −0 lib/rtmidi-4.0.0/Makefile.in
  6. +66 −0 lib/rtmidi-4.0.0/README.md
  7. +3,445 −0 lib/rtmidi-4.0.0/RtMidi.cpp
  8. +629 −0 lib/rtmidi-4.0.0/RtMidi.h
  9. +1,236 −0 lib/rtmidi-4.0.0/aclocal.m4
  10. +107 −0 lib/rtmidi-4.0.0/autogen.sh
  11. +21 −0 lib/rtmidi-4.0.0/cmake/RtMidiConfigUninstall.cmake.in
  12. +270 −0 lib/rtmidi-4.0.0/config/ar-lib
  13. +348 −0 lib/rtmidi-4.0.0/config/compile
  14. +1,476 −0 lib/rtmidi-4.0.0/config/config.guess
  15. +1,801 −0 lib/rtmidi-4.0.0/config/config.sub
  16. +791 −0 lib/rtmidi-4.0.0/config/depcomp
  17. +518 −0 lib/rtmidi-4.0.0/config/install-sh
  18. +11,147 −0 lib/rtmidi-4.0.0/config/ltmain.sh
  19. +215 −0 lib/rtmidi-4.0.0/config/missing
  20. +148 −0 lib/rtmidi-4.0.0/config/test-driver
  21. +19,586 −0 lib/rtmidi-4.0.0/configure
  22. +238 −0 lib/rtmidi-4.0.0/configure.ac
  23. +355 −0 lib/rtmidi-4.0.0/contrib/go/rtmidi/rtmidi.go
  24. +4 −0 lib/rtmidi-4.0.0/contrib/go/rtmidi/rtmidi_stub.cpp
  25. +1 −0 lib/rtmidi-4.0.0/contrib/go/rtmidi/rtmidi_stub.h
  26. +46 −0 lib/rtmidi-4.0.0/contrib/go/rtmidi/rtmidi_test.go
  27. +33 −0 lib/rtmidi-4.0.0/doc/Makefile.am
  28. +476 −0 lib/rtmidi-4.0.0/doc/Makefile.in
  29. +1,865 −0 lib/rtmidi-4.0.0/doc/doxygen/Doxyfile.in
  30. +9 −0 lib/rtmidi-4.0.0/doc/doxygen/footer.html
  31. +9 −0 lib/rtmidi-4.0.0/doc/doxygen/header.html
  32. +11 −0 lib/rtmidi-4.0.0/doc/doxygen/samples/getting_started.cpp
  33. +482 −0 lib/rtmidi-4.0.0/doc/doxygen/tutorial.txt
  34. +90 −0 lib/rtmidi-4.0.0/doc/html/RtMidi_8h.html
  35. +404 −0 lib/rtmidi-4.0.0/doc/html/RtMidi_8h_source.html
  36. +39 −0 lib/rtmidi-4.0.0/doc/html/annotated.html
  37. BIN lib/rtmidi-4.0.0/doc/html/bc_s.png
  38. BIN lib/rtmidi-4.0.0/doc/html/bdwn.png
  39. +28 −0 lib/rtmidi-4.0.0/doc/html/classMidiApi-members.html
  40. +48 −0 lib/rtmidi-4.0.0/doc/html/classMidiApi.html
  41. BIN lib/rtmidi-4.0.0/doc/html/classMidiApi.png
  42. +28 −0 lib/rtmidi-4.0.0/doc/html/classMidiInApi-members.html
  43. +57 −0 lib/rtmidi-4.0.0/doc/html/classMidiInApi.html
  44. BIN lib/rtmidi-4.0.0/doc/html/classMidiInApi.png
  45. +28 −0 lib/rtmidi-4.0.0/doc/html/classMidiOutApi-members.html
  46. +47 −0 lib/rtmidi-4.0.0/doc/html/classMidiOutApi.html
  47. BIN lib/rtmidi-4.0.0/doc/html/classMidiOutApi.png
  48. +47 −0 lib/rtmidi-4.0.0/doc/html/classRtMidi-members.html
  49. +336 −0 lib/rtmidi-4.0.0/doc/html/classRtMidi.html
  50. BIN lib/rtmidi-4.0.0/doc/html/classRtMidi.png
  51. +45 −0 lib/rtmidi-4.0.0/doc/html/classRtMidiError-members.html
  52. +146 −0 lib/rtmidi-4.0.0/doc/html/classRtMidiError.html
  53. BIN lib/rtmidi-4.0.0/doc/html/classRtMidiError.png
  54. +55 −0 lib/rtmidi-4.0.0/doc/html/classRtMidiIn-members.html
  55. +537 −0 lib/rtmidi-4.0.0/doc/html/classRtMidiIn.html
  56. BIN lib/rtmidi-4.0.0/doc/html/classRtMidiIn.png
  57. +52 −0 lib/rtmidi-4.0.0/doc/html/classRtMidiOut-members.html
  58. +399 −0 lib/rtmidi-4.0.0/doc/html/classRtMidiOut.html
  59. BIN lib/rtmidi-4.0.0/doc/html/classRtMidiOut.png
  60. +35 −0 lib/rtmidi-4.0.0/doc/html/classes.html
  61. BIN lib/rtmidi-4.0.0/doc/html/closed.png
  62. +1,184 −0 lib/rtmidi-4.0.0/doc/html/doxygen.css
  63. BIN lib/rtmidi-4.0.0/doc/html/doxygen.png
  64. +97 −0 lib/rtmidi-4.0.0/doc/html/dynsections.js
  65. +30 −0 lib/rtmidi-4.0.0/doc/html/files.html
  66. BIN lib/rtmidi-4.0.0/doc/html/ftv2blank.png
  67. BIN lib/rtmidi-4.0.0/doc/html/ftv2cl.png
  68. BIN lib/rtmidi-4.0.0/doc/html/ftv2doc.png
  69. BIN lib/rtmidi-4.0.0/doc/html/ftv2folderclosed.png
  70. BIN lib/rtmidi-4.0.0/doc/html/ftv2folderopen.png
  71. BIN lib/rtmidi-4.0.0/doc/html/ftv2lastnode.png
  72. BIN lib/rtmidi-4.0.0/doc/html/ftv2link.png
  73. BIN lib/rtmidi-4.0.0/doc/html/ftv2mlastnode.png
  74. BIN lib/rtmidi-4.0.0/doc/html/ftv2mnode.png
  75. BIN lib/rtmidi-4.0.0/doc/html/ftv2mo.png
  76. BIN lib/rtmidi-4.0.0/doc/html/ftv2node.png
  77. BIN lib/rtmidi-4.0.0/doc/html/ftv2ns.png
  78. BIN lib/rtmidi-4.0.0/doc/html/ftv2plastnode.png
  79. BIN lib/rtmidi-4.0.0/doc/html/ftv2pnode.png
  80. BIN lib/rtmidi-4.0.0/doc/html/ftv2splitbar.png
  81. BIN lib/rtmidi-4.0.0/doc/html/ftv2vertline.png
  82. +261 −0 lib/rtmidi-4.0.0/doc/html/functions.html
  83. +28 −0 lib/rtmidi-4.0.0/doc/html/functions_enum.html
  84. +74 −0 lib/rtmidi-4.0.0/doc/html/functions_eval.html
  85. +160 −0 lib/rtmidi-4.0.0/doc/html/functions_func.html
  86. +25 −0 lib/rtmidi-4.0.0/doc/html/functions_type.html
  87. +34 −0 lib/rtmidi-4.0.0/doc/html/functions_vars.html
  88. +156 −0 lib/rtmidi-4.0.0/doc/html/globals.html
  89. +28 −0 lib/rtmidi-4.0.0/doc/html/globals_enum.html
  90. +76 −0 lib/rtmidi-4.0.0/doc/html/globals_eval.html
  91. +88 −0 lib/rtmidi-4.0.0/doc/html/globals_func.html
  92. +28 −0 lib/rtmidi-4.0.0/doc/html/globals_type.html
  93. +553 −0 lib/rtmidi-4.0.0/doc/html/group__C-interface.html
  94. +40 −0 lib/rtmidi-4.0.0/doc/html/hierarchy.html
  95. +423 −0 lib/rtmidi-4.0.0/doc/html/index.html
  96. +8 −0 lib/rtmidi-4.0.0/doc/html/jquery.js
  97. +29 −0 lib/rtmidi-4.0.0/doc/html/modules.html
  98. BIN lib/rtmidi-4.0.0/doc/html/nav_f.png
  99. BIN lib/rtmidi-4.0.0/doc/html/nav_g.png
  100. BIN lib/rtmidi-4.0.0/doc/html/nav_h.png
  101. BIN lib/rtmidi-4.0.0/doc/html/open.png
  102. +164 −0 lib/rtmidi-4.0.0/doc/html/rtmidi__c_8h.html
  103. +147 −0 lib/rtmidi-4.0.0/doc/html/rtmidi__c_8h_source.html
  104. +32 −0 lib/rtmidi-4.0.0/doc/html/structMidiInApi_1_1MidiMessage-members.html
  105. +42 −0 lib/rtmidi-4.0.0/doc/html/structMidiInApi_1_1MidiMessage.html
  106. +31 −0 lib/rtmidi-4.0.0/doc/html/structMidiInApi_1_1MidiQueue-members.html
  107. +33 −0 lib/rtmidi-4.0.0/doc/html/structMidiInApi_1_1MidiQueue.html
  108. +31 −0 lib/rtmidi-4.0.0/doc/html/structMidiInApi_1_1RtMidiInData-members.html
  109. +33 −0 lib/rtmidi-4.0.0/doc/html/structMidiInApi_1_1RtMidiInData.html
  110. BIN lib/rtmidi-4.0.0/doc/html/sync_off.png
  111. BIN lib/rtmidi-4.0.0/doc/html/sync_on.png
  112. BIN lib/rtmidi-4.0.0/doc/html/tab_a.png
  113. BIN lib/rtmidi-4.0.0/doc/html/tab_b.png
  114. BIN lib/rtmidi-4.0.0/doc/html/tab_h.png
  115. BIN lib/rtmidi-4.0.0/doc/html/tab_s.png
  116. +60 −0 lib/rtmidi-4.0.0/doc/html/tabs.css
  117. BIN lib/rtmidi-4.0.0/doc/images/ccrma.gif
  118. BIN lib/rtmidi-4.0.0/doc/images/mcgill.gif
  119. +129 −0 lib/rtmidi-4.0.0/doc/release.txt
  120. +1 −0 lib/rtmidi-4.0.0/msw/readme
  121. +20 −0 lib/rtmidi-4.0.0/msw/rtmidilib.sln
  122. +186 −0 lib/rtmidi-4.0.0/msw/rtmidilib.vcproj
  123. +19 −0 lib/rtmidi-4.0.0/rtmidi-config.in
  124. +12 −0 lib/rtmidi-4.0.0/rtmidi.pc.in
  125. +362 −0 lib/rtmidi-4.0.0/rtmidi_c.cpp
  126. +246 −0 lib/rtmidi-4.0.0/rtmidi_c.h
  127. 0 lib/rtmidi-4.0.0/tests/Debug/.placeholder
  128. +33 −0 lib/rtmidi-4.0.0/tests/Makefile.am
  129. +1,075 −0 lib/rtmidi-4.0.0/tests/Makefile.in
  130. 0 lib/rtmidi-4.0.0/tests/Release/.placeholder
  131. +77 −0 lib/rtmidi-4.0.0/tests/RtMidi.dsw
  132. +159 −0 lib/rtmidi-4.0.0/tests/apinames.cpp
  133. +111 −0 lib/rtmidi-4.0.0/tests/cmidiin.cpp
  134. +110 −0 lib/rtmidi-4.0.0/tests/cmidiin.dsp
  135. +231 −0 lib/rtmidi-4.0.0/tests/midiclock.cpp
  136. +146 −0 lib/rtmidi-4.0.0/tests/midiout.cpp
  137. +110 −0 lib/rtmidi-4.0.0/tests/midiout.dsp
  138. +71 −0 lib/rtmidi-4.0.0/tests/midiprobe.cpp
  139. +110 −0 lib/rtmidi-4.0.0/tests/midiprobe.dsp
  140. +98 −0 lib/rtmidi-4.0.0/tests/qmidiin.cpp
  141. +110 −0 lib/rtmidi-4.0.0/tests/qmidiin.dsp
  142. +152 −0 lib/rtmidi-4.0.0/tests/sysextest.cpp
  143. +110 −0 lib/rtmidi-4.0.0/tests/sysextest.dsp
  144. 0 {src/zlib → lib/zlib-1.2.3}/ChangeLog
  145. 0 {src/zlib → lib/zlib-1.2.3}/FAQ
  146. 0 {src/zlib → lib/zlib-1.2.3}/README
  147. 0 {src/zlib → lib/zlib-1.2.3}/adler32.c
  148. 0 {src/zlib → lib/zlib-1.2.3}/algorithm.txt
  149. 0 {src/zlib → lib/zlib-1.2.3}/compress.c
  150. 0 {src/zlib → lib/zlib-1.2.3}/crc32.c
  151. 0 {src/zlib → lib/zlib-1.2.3}/crc32.h
  152. 0 {src/zlib → lib/zlib-1.2.3}/deflate.c
  153. 0 {src/zlib → lib/zlib-1.2.3}/deflate.h
  154. 0 {src/zlib → lib/zlib-1.2.3}/gzio.c
  155. 0 {src/zlib → lib/zlib-1.2.3}/infback.c
  156. 0 {src/zlib → lib/zlib-1.2.3}/inffast.c
  157. 0 {src/zlib → lib/zlib-1.2.3}/inffast.h
  158. 0 {src/zlib → lib/zlib-1.2.3}/inffixed.h
  159. 0 {src/zlib → lib/zlib-1.2.3}/inflate.c
  160. 0 {src/zlib → lib/zlib-1.2.3}/inflate.h
  161. 0 {src/zlib → lib/zlib-1.2.3}/inftrees.c
  162. 0 {src/zlib → lib/zlib-1.2.3}/inftrees.h
  163. 0 {src/zlib → lib/zlib-1.2.3}/trees.c
  164. 0 {src/zlib → lib/zlib-1.2.3}/trees.h
  165. 0 {src/zlib → lib/zlib-1.2.3}/uncompr.c
  166. 0 {src/zlib → lib/zlib-1.2.3}/zconf.h
  167. 0 {src/zlib → lib/zlib-1.2.3}/zconf.in.h
  168. 0 {src/zlib → lib/zlib-1.2.3}/zlib.3
  169. 0 {src/zlib → lib/zlib-1.2.3}/zlib.h
  170. 0 {src/zlib → lib/zlib-1.2.3}/zutil.c
  171. 0 {src/zlib → lib/zlib-1.2.3}/zutil.h
  172. +3 −3 src/CMakeLists.txt
  173. +11 −11 src/interface/rtmididevice.cpp
  174. +0 −60 src/rtmidi/RtError.h
  175. +0 −2,340 src/rtmidi/RtMidi.cpp
  176. +0 −299 src/rtmidi/RtMidi.h
  177. +0 −56 src/rtmidi/readme
@@ -56,5 +56,5 @@ RtMidi Library <http://www.music.mcgill.ca/~gary/rtmidi>
zlib <http://www.zlib.net>
Compression for our file format
pmidi http://www.parabola.me.uk/alsa/pmidi.html
Parsing midi files
Snippets for parsing midi files

5 README
@@ -186,3 +186,8 @@ See windows/Readme.txt for details about building Canorus under Microsoft Window
Mac OS X users
==============
Check macosx/ directory and run Make.

License
=======
Canorus is licensed under GPLv3. See COPYING for details. Consult documentation
of other libraries in folder lib/ for their respective license.
@@ -0,0 +1,273 @@
# 2018 (c) Juan G. Victores, Bartek Łukawski, Stephen Sinclair
# CopyPolicy: RtMidi license.

# Set minimum CMake required version for this project.
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)

# Define a C++ project.
project(RtMidi LANGUAGES CXX)

# Check for Jack (any OS)
find_library(JACK_LIB jack)
find_package(PkgConfig)
pkg_check_modules(jack jack)
if(JACK_LIB OR jack_FOUND)
set(HAVE_JACK TRUE)
endif()

# Necessary for Windows
if(WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

# Standard CMake options
option(BUILD_SHARED_LIBS "Build as shared library" ON)

if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel")
endif()
if(WINDOWS)
set(CMAKE_DEBUG_POSTFIX d CACHE STRING "Postfix for debug version of library")
endif()

# Build Options
set(RTMIDI_TARGETNAME_UNINSTALL "uninstall" CACHE STRING "Name of 'uninstall' build target")

# API Options
option(RTMIDI_API_JACK "Compile with JACK support." ${HAVE_JACK})
if(UNIX AND NOT APPLE)
option(RTMIDI_API_ALSA "Compile with ALSA support." ON)
endif()
option(RTMIDI_API_WINMM "Compile with WINMM support." ${WIN32})
option(RTMIDI_API_CORE "Compile with CoreMIDI support." ${APPLE})

# Add -Wall if possible
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif (CMAKE_COMPILER_IS_GNUCXX)

# Add debug flags
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-D__RTMIDI_DEBUG__)
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif (CMAKE_COMPILER_IS_GNUCXX)
endif ()

# Read libtool version info from configure.ac
set(R "m4_define\\(\\[lt_([a-z]+)\\], ([0-9]+)\\)")
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" CONFIGAC
REGEX ${R})
foreach(_S ${CONFIGAC})
string(REGEX REPLACE ${R} "\\1" k ${_S})
string(REGEX REPLACE ${R} "\\2" v ${_S})
set(SO_${k} ${v})
endforeach()
math(EXPR SO_current_minus_age "${SO_current} - ${SO_age}")
set(SO_VER "${SO_current_minus_age}")
set(FULL_VER "${SO_current_minus_age}.${SO_revision}.${SO_age}")

# Read package version info from configure.ac
set(R "AC_INIT\\(RtMidi, ([0-9\\.]+),.*\\)")
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" CONFIGAC
REGEX ${R})
string(REGEX REPLACE ${R} "\\1" PACKAGE_VERSION ${CONFIGAC})

# Init variables
set(rtmidi_SOURCES RtMidi.cpp RtMidi.h rtmidi_c.cpp rtmidi_c.h)
set(LINKLIBS)
set(INCDIRS)
set(PKGCONFIG_REQUIRES)
set(API_DEFS)
set(API_LIST)

# Tweak API-specific configuration.

# Jack
if(RTMIDI_API_JACK)
if (NOT HAVE_JACK)
message(FATAL_ERROR "Jack API requested but no Jack dev libraries found")
endif()
set(NEED_PTHREAD ON)
list(APPEND PKGCONFIG_REQUIRES "jack")
list(APPEND API_DEFS "-D__UNIX_JACK__")
list(APPEND API_LIST "jack")
if(jack_FOUND)
list(APPEND LINKLIBS ${jack_LIBRARIES})
list(APPEND INCDIRS ${jack_INCLUDEDIR})
else()
list(APPEND LINKLIBS ${JACK_LIB})
endif()

# Check for jack_port_rename
include(CheckSymbolExists)
set(tmp_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
list(APPEND CMAKE_REQUIRED_LIBRARIES jack)
check_symbol_exists(jack_port_rename ${jack_INCLUDEDIR}/jack/jack.h JACK_HAS_PORT_RENAME)
set(CMAKE_REQUIRED_LIBRARIES ${tmp_CMAKE_REQUIRED_LIBRARIES})
if(JACK_HAS_PORT_RENAME)
list(APPEND API_DEFS "JACK_HAS_PORT_RENAME")
endif()
endif()

# ALSA
if(RTMIDI_API_ALSA)
set(NEED_PTHREAD ON)
find_package(ALSA)
if (NOT ALSA_FOUND)
message(FATAL_ERROR "ALSA API requested but no ALSA dev libraries found")
endif()
list(APPEND INCDIRS ${ALSA_INCLUDE_DIR})
list(APPEND LINKLIBS ${ALSA_LIBRARY})
list(APPEND PKGCONFIG_REQUIRES "alsa")
list(APPEND API_DEFS "-D__LINUX_ALSA__")
list(APPEND API_LIST "alsa")
endif()

# WinMM
if(RTMIDI_API_WINMM)
list(APPEND API_DEFS "-D__WINDOWS_MM__")
list(APPEND API_LIST "winmm")
list(APPEND LINKLIBS winmm)
endif()

# CoreMIDI
if(RTMIDI_API_CORE)
list(APPEND API_DEFS "-D__MACOSX_CORE__")
list(APPEND API_LIST "coremidi")
list(APPEND LINKLIBS "-framework CoreServices")
list(APPEND LINKLIBS "-framework CoreAudio")
list(APPEND LINKLIBS "-framework CoreMIDI")
list(APPEND LINKLIBS "-framework CoreFoundation")
list(APPEND LINKFLAGS "-Wl,-F/Library/Frameworks")
endif()

# pthread
if (NEED_PTHREAD)
find_package(Threads REQUIRED
CMAKE_THREAD_PREFER_PTHREAD
THREADS_PREFER_PTHREAD_FLAG)
list(APPEND LINKLIBS Threads::Threads)
endif()

# Create library targets.
cmake_policy(SET CMP0042 OLD)
set(LIB_TARGETS)

# Use RTMIDI_BUILD_SHARED_LIBS / RTMIDI_BUILD_STATIC_LIBS if they
# are defined, otherwise default to standard BUILD_SHARED_LIBS.
if (DEFINED RTMIDI_BUILD_SHARED_LIBS AND NOT RTMIDI_BUILD_SHARED_LIBS STREQUAL "")
if (RTMIDI_BUILD_SHARED_LIBS)
add_library(rtmidi SHARED ${rtmidi_SOURCES})
else()
add_library(rtmidi STATIC ${rtmidi_SOURCES})
endif()
elseif (DEFINED RTMIDI_BUILD_STATIC_LIBS AND NOT RTMIDI_BUILD_STATIC_LIBS STREQUAL "")
if (RTMIDI_BUILD_STATIC_LIBS)
add_library(rtmidi STATIC ${rtmidi_SOURCES})
else()
add_library(rtmidi SHARED ${rtmidi_SOURCES})
endif()
else()
add_library(rtmidi ${rtmidi_SOURCES})
endif()
list(APPEND LIB_TARGETS rtmidi)

# Add headers destination for install rule.
set_target_properties(rtmidi PROPERTIES PUBLIC_HEADER RtMidi.h
SOVERSION ${SO_VER}
VERSION ${FULL_VER})

# Set include paths, populate target interface.
target_include_directories(rtmidi PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${INCDIRS})

# Set compile-time definitions
target_compile_definitions(rtmidi PRIVATE ${API_DEFS})
target_compile_definitions(rtmidi PRIVATE RTMIDI_EXPORT)
target_link_libraries(rtmidi ${LINKLIBS})

# Set standard installation directories.
include(GNUInstallDirs)

# Add tests if requested.
include(CTest)
if (NOT DEFINED RTMIDI_BUILD_TESTING OR RTMIDI_BUILD_TESTING STREQUAL "")
set(RTMIDI_BUILD_TESTING ${BUILD_TESTING})
endif()
if (RTMIDI_BUILD_TESTING)
add_executable(cmidiin tests/cmidiin.cpp)
add_executable(midiclock tests/midiclock.cpp)
add_executable(midiout tests/midiout.cpp)
add_executable(midiprobe tests/midiprobe.cpp)
add_executable(qmidiin tests/qmidiin.cpp)
add_executable(sysextest tests/sysextest.cpp)
add_executable(apinames tests/apinames.cpp)
list(GET LIB_TARGETS 0 LIBRTMIDI)
set_target_properties(cmidiin midiclock midiout midiprobe qmidiin sysextest apinames
PROPERTIES RUNTIME_OUTPUT_DIRECTORY tests
INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}
LINK_LIBRARIES ${LIBRTMIDI})
add_test(NAME apinames COMMAND apinames)
endif()

# Set standard installation directories.
include(GNUInstallDirs)

# Message
string(REPLACE ";" " " apilist "${API_LIST}")
message(STATUS "Compiling with support for: ${apilist}")

# PkgConfig file
string(REPLACE ";" " " req "${PKGCONFIG_REQUIRES}")
string(REPLACE ";" " " api "${API_DEFS}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/rtmidi.pc.in" "rtmidi.pc" @ONLY)

# Add install rule.
install(TARGETS ${LIB_TARGETS}
EXPORT RtMidiTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# Store the package in the user registry.
export(PACKAGE RtMidi)

# Set installation path for CMake files.
set(RTMIDI_CMAKE_DESTINATION share/rtmidi)

# Create CMake configuration export file.
if(NEED_PTHREAD)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/RtMidiConfig.cmake "find_package(Threads REQUIRED)\n")
endif()

file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/RtMidiConfig.cmake "include(\${CMAKE_CURRENT_LIST_DIR}/RtMidiTargets.cmake)")

# Install CMake configuration export file.
install(FILES ${CMAKE_BINARY_DIR}/RtMidiConfig.cmake
DESTINATION ${RTMIDI_CMAKE_DESTINATION})

# Export library target (build-tree).
export(EXPORT RtMidiTargets
NAMESPACE RtMidi::)

# Export library target (install-tree).
install(EXPORT RtMidiTargets
DESTINATION ${RTMIDI_CMAKE_DESTINATION}
NAMESPACE RtMidi::)

# Configure uninstall target.
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/RtMidiConfigUninstall.cmake.in"
"${CMAKE_BINARY_DIR}/RtMidiConfigUninstall.cmake" @ONLY)

# Create uninstall target.
add_custom_target(${RTMIDI_TARGETNAME_UNINSTALL}
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/RtMidiConfigUninstall.cmake)

install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/rtmidi.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
@@ -0,0 +1,21 @@
SUBDIRS = . tests
if MAKE_DOC
SUBDIRS += doc
endif

lib_LTLIBRARIES = %D%/librtmidi.la
%C%_librtmidi_la_CXXFLAGS = -DRTMIDI_EXPORT
%C%_librtmidi_la_LDFLAGS = -no-undefined -export-dynamic -version-info @SO_VERSION@
%C%_librtmidi_la_SOURCES = \
%D%/RtMidi.cpp \
%D%/rtmidi_c.cpp

rtmidi_incdir = $(includedir)/rtmidi
rtmidi_inc_HEADERS = \
%D%/RtMidi.h \
%D%/rtmidi_c.h

pkgconfigdatadir = $(libdir)/pkgconfig
pkgconfigdata_DATA = rtmidi.pc

EXTRA_DIST = autogen.sh README.md msw rtmidi-config.in contrib cmake CMakeLists.txt

0 comments on commit 1c2fba0

Please sign in to comment.
You can’t perform that action at this time.