-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
88 lines (62 loc) · 1.9 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 2.8)
project(midi2exp CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(CheckIncludeFiles)
include_directories(include include/midifile)
##############################
##
## Operating-system specific settings:
##
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version")
endif()
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
option(STATIC_CRT "Use static CRT libraries" OFF)
# Rewrite command line flags to use /MT if necessary
if(STATIC_CRT)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
endif()
endif()
##############################
##
## Library:
##
set(SRCS
src/midifile/Options.cpp
src/midifile/Binasc.cpp
src/midifile/MidiEvent.cpp
src/midifile/MidiEventList.cpp
src/midifile/MidiFile.cpp
src/midifile/MidiMessage.cpp
src/Expressionizer.cpp
src/MidiRoll.cpp
)
set(HDRS
include/midifile/Binasc.h
include/midifile/MidiEvent.h
include/midifile/MidiEventList.h
include/midifile/MidiFile.h
include/midifile/MidiMessage.h
include/midifile/Options.h
include/Expressionizer.h
include/MidiRoll.h
)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
add_library(expression STATIC ${SRCS} ${HDRS})
##############################
##
## Programs:
##
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin)
add_executable(midi2exp tools/midi2exp.cpp)
add_executable(velocities tools/velocities.cpp)
target_link_libraries(midi2exp expression)
target_link_libraries(velocities expression)