-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
51 lines (43 loc) · 1.38 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.12)
project(libmidi2)
function(setupTarget target)
target_compile_options("${target}" PRIVATE -Wall)
target_compile_features("${target}" PUBLIC cxx_std_11)
endfunction()
set(INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(LIBMIDI2_HEADERS
"${INCLUDE_DIR}/bytestreamToUMP.h"
"${INCLUDE_DIR}/mcoded7.h"
"${INCLUDE_DIR}/midiCIMessageCreate.h"
"${INCLUDE_DIR}/midiCIProcessor.h"
"${INCLUDE_DIR}/umpMessageCreate.h"
"${INCLUDE_DIR}/umpProcessor.h"
"${INCLUDE_DIR}/umpToBytestream.h"
"${INCLUDE_DIR}/umpToMIDI1Protocol.h"
"${INCLUDE_DIR}/umpToMIDI2Protocol.h"
"${INCLUDE_DIR}/utils.h"
)
add_library(libmidi2 ${LIBMIDI2_HEADERS}
src/umpMessageCreate.cpp
src/midiCIMessageCreate.cpp
src/midiCIProcessor.cpp
src/umpProcessor.cpp
src/mcoded7.cpp
)
setupTarget(libmidi2)
target_include_directories(libmidi2 PUBLIC
$<BUILD_INTERFACE:${INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>
)
set(LIBMIDI2_EXPORT_NAME libmidi2-config)
install(TARGETS libmidi2
EXPORT ${LIBMIDI2_EXPORT_NAME}
)
install(EXPORT ${LIBMIDI2_EXPORT_NAME}
NAMESPACE libmidi2::
DESTINATION "share/${PROJECT_NAME}"
)
install(FILES ${LIBMIDI2_HEADERS} DESTINATION "include/${PROJECT_NAME}")
add_executable(tests tests.cpp)
target_link_libraries(tests PRIVATE libmidi2)
setupTarget(tests)