mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 08:58:59 +08:00
[rtmidi] Slightly simplify cmake replacement
This commit is contained in:
parent
9eca90f2d1
commit
2c248dd4a6
@ -1,32 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(rtmidi CXX)
|
||||
set(RTMIDI_SOURCES
|
||||
${PROJECT_SOURCE_DIR}/RtMidi.cpp
|
||||
${PROJECT_SOURCE_DIR}/rtmidi_c.cpp
|
||||
)
|
||||
|
||||
set(RTMIDI_HEADERS
|
||||
${PROJECT_SOURCE_DIR}/RtMidi.h
|
||||
${PROJECT_SOURCE_DIR}/rtmidi_c.h
|
||||
)
|
||||
|
||||
include_directories(${RTMIDI_HEADERS})
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
else()
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
endif()
|
||||
|
||||
|
||||
add_library(rtmidi RtMidi.cpp rtmidi_c.cpp)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(rtmidi SHARED ${RTMIDI_SOURCES})
|
||||
target_compile_definitions(rtmidi PRIVATE -DRTMIDI_EXPORT)
|
||||
else()
|
||||
add_library(rtmidi STATIC ${RTMIDI_SOURCES})
|
||||
endif()
|
||||
|
||||
|
||||
file(READ "${PROJECT_SOURCE_DIR}/rtmidi_c.h" RTMIDI_EXPORT)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
string(REPLACE "if defined(RTMIDI_EXPORT)" "if 1" RTMIDI_EXPORT "${RTMIDI_EXPORT}")
|
||||
@ -43,6 +22,6 @@ install(
|
||||
)
|
||||
|
||||
if(NOT DISABLE_INSTALL_HEADERS)
|
||||
install(FILES "${PROJECT_SOURCE_DIR}/RtMidi.h" DESTINATION include)
|
||||
install(FILES "RtMidi.h" DESTINATION include)
|
||||
install(FILES "${PROJECT_BINARY_DIR}/rtmidi_c.h" DESTINATION include)
|
||||
endif()
|
||||
|
@ -1,3 +1,3 @@
|
||||
Source: rtmidi
|
||||
Version: 2.1.1
|
||||
Version: 2.1.1-1
|
||||
Description: A set of C++ classes that provide a common API for realtime MIDI input/output across Linux (ALSA & JACK), Macintosh OS X (CoreMidi & JACK) and Windows (Multimedia)
|
||||
|
Loading…
Reference in New Issue
Block a user