-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
55 lines (41 loc) · 1.35 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
52
53
54
55
cmake_minimum_required(VERSION 3.10.2)
project(cxxmidi VERSION 0.2.0 LANGUAGES CXX)
include(CTest)
add_library(CxxMidi INTERFACE)
add_library(CxxMidi::CxxMidi ALIAS CxxMidi)
target_include_directories(CxxMidi
INTERFACE
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
include(CMakePackageConfigHelpers)
set(INCLUDE_INSTALL_DIR include)
set(LIB_INSTALL_DIR lib)
set(SYSCONFIG_INSTALL_DIR etc)
configure_package_config_file(cmake/CxxMidiConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/CxxMidiConfig.cmake
INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cxxmidi/cmake
PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/CxxMidiConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/CxxMidiConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/CxxMidiConfigVersion.cmake
DESTINATION
${LIB_INSTALL_DIR}/cxxmidi/cmake)
install(DIRECTORY include/cxxmidi
DESTINATION ${INCLUDE_INSTALL_DIR})
install(TARGETS CxxMidi
EXPORT CxxMidi
DESTINATION ${LIB_INSTALL_DIR}/cxxmidi/cmake)
install(EXPORT CxxMidi
FILE CxxMidiTargets.cmake
NAMESPACE CxxMidi::
DESTINATION ${LIB_INSTALL_DIR}/cxxmidi/cmake)
if(BUILD_TESTING)
enable_testing()
add_subdirectory(tests)
endif()
add_subdirectory(examples)