2017-06-23 16:25:31 -07:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
|
|
|
project(rtmidi CXX)
|
2017-06-23 16:37:25 -07:00
|
|
|
|
2017-06-28 14:26:44 -07:00
|
|
|
add_library(rtmidi RtMidi.cpp rtmidi_c.cpp)
|
2017-06-23 16:31:26 -07:00
|
|
|
if(BUILD_SHARED_LIBS)
|
2017-06-23 16:25:31 -07:00
|
|
|
target_compile_definitions(rtmidi PRIVATE -DRTMIDI_EXPORT)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(READ "${PROJECT_SOURCE_DIR}/rtmidi_c.h" RTMIDI_EXPORT)
|
2017-06-23 16:33:25 -07:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2017-06-23 16:25:31 -07:00
|
|
|
string(REPLACE "if defined(RTMIDI_EXPORT)" "if 1" RTMIDI_EXPORT "${RTMIDI_EXPORT}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "if defined(RTMIDI_EXPORT)" "if 0" RTMIDI_EXPORT "${RTMIDI_EXPORT}")
|
|
|
|
endif()
|
|
|
|
file(WRITE "${PROJECT_BINARY_DIR}/rtmidi_c.h" "${RTMIDI_EXPORT}")
|
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS rtmidi
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|
|
|
|
|
|
|
|
if(NOT DISABLE_INSTALL_HEADERS)
|
2017-06-28 14:26:44 -07:00
|
|
|
install(FILES "RtMidi.h" DESTINATION include)
|
2017-06-23 16:25:31 -07:00
|
|
|
install(FILES "${PROJECT_BINARY_DIR}/rtmidi_c.h" DESTINATION include)
|
|
|
|
endif()
|