forked from musescore/sftools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
146 lines (124 loc) · 3.86 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#=============================================================================
# MuseScore
# Music Composition & Notation
# $Id:$
#
# Copyright (C) 2011-2014 Werner Schweer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation and appearing in
# the file LICENSE.GPL
#=============================================================================
project(sf3convert)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
include (GNUInstallDirs)
include (${PROJECT_SOURCE_DIR}/build/FindQt5.cmake)
include (${PROJECT_SOURCE_DIR}/build/UsePkgConfig1.cmake)
# set(CMAKE_VERBOSE_MAKEFILE ON)
set(QT_MIN_VERSION "5.6")
set(QT_USE_QTXML TRUE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
# distributions might need to override these
if (MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
else (MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fPIC -fPIE")
endif (MINGW)
add_executable(sf3convert
sfconvert.cpp sfont.cpp xml.cpp
)
if (MINGW)
target_link_libraries(sf3convert
${QT_LIBRARIES}
vorbis
vorbisenc
vorbisfile
ogg
sndfile-1
)
install( TARGETS sf3convert RUNTIME DESTINATION . )
install_files ( . .dll
${CROSS}/bin/libgcc_s_dw2-1.dll
${CROSS}/bin/libstdc++-6.dll
${CROSS}/bin/libwinpthread-1.dll
${CROSS}/lib/libsndfile-1.dll
${CROSS}/lib/libogg.dll
${CROSS}/lib/libvorbis.dll
${CROSS}/lib/libvorbisenc.dll
${CROSS}/lib/libvorbisfile.dll
${CROSSQT}/bin/Qt5Core.dll
${CROSSQT}/bin/Qt5Xml.dll
${CROSSQT}/bin/icuin51.dll
${CROSSQT}/bin/icuuc51.dll
${CROSSQT}/bin/icudt51.dll
)
else (MINGW)
##
## libsndfile
##
PKGCONFIG1 (sndfile 1.0.25 SNDFILE_INCDIR SNDFILE_LIBDIR SNDFILE_LIB SNDFILE_CPP)
if (SNDFILE_INCDIR)
message("libsndfile detected ${SNDFILE_INCDIR} ${SNDFILE_LIBDIR} ${SNDFILE_LIB}")
else (SNDFILE_INCDIR)
message("libsndfile not found\n")
endif (SNDFILE_INCDIR)
##
## libvorbis
##
PKGCONFIG1 (vorbis 1.3.3 VORBIS_INCDIR VORBIS_LIBDIR VORBIS_LIB VORBIS_CPP)
if (VORBIS_INCDIR)
message("libvorbis detected ${VORBIS_INCDIR} ${VORBIS_LIBDIR} ${VORBIS_LIB}")
else (VORBIS_INCDIR)
message("libvorbis not found\n")
endif (VORBIS_INCDIR)
##
## libvorbisenc
##
PKGCONFIG1 (vorbisenc 1.3.3 VORBISENC_INCDIR VORBISENC_LIBDIR VORBISENC_LIB VORBISENC_CPP)
if (VORBISENC_INCDIR)
message("libvorbisenc detected ${VORBISENC_INCDIR} ${VORBISENC_LIBDIR} ${VORBISENC_LIB}")
else (VORBISENC_INCDIR)
message("libvorbisenc not found\n")
endif (VORBISENC_INCDIR)
##
## libvorbisfile
##
PKGCONFIG1 (vorbisfile 1.3.3 VORBISFILE_INCDIR VORBISFILE_LIBDIR VORBISFILE_LIB VORBISFILE_CPP)
if (VORBISFILE_INCDIR)
message("libvorbisfile detected ${VORBISFILE_INCDIR} ${VORBISFILE_LIBDIR} ${VORBISFILE_LIB}")
else (VORBISFILE_INCDIR)
message("libvorbisfile not found\n")
endif (VORBISFILE_INCDIR)
##
## libogg
##
PKGCONFIG1 (ogg 1.3.0 OGG_INCDIR OGG_LIBDIR OGG_LIB OGG_CPP)
if (OGG_INCDIR)
message("libogg detected ${OGG_INCDIR} ${OGG_LIBDIR} ${OGG_LIB}")
else (OGG_INCDIR)
message("libogg not found\n")
endif (OGG_INCDIR)
##
## Includes
##
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_BINARY_DIR}
${SNDFILE_INCDIR}
${OGG_INCDIR}
${VORBIS_INCDIR}
${VORBISENC_INCDIR}
${VORBISFILE_INCDIR}
)
target_link_libraries(sf3convert
${QT_LIBRARIES}
${OGG_LIB}
${VORBIS_LIB}
${VORBISENC_LIB}
${VORBISFILE_LIB}
${SNDFILE_LIB}
)
install(TARGETS sf3convert RUNTIME DESTINATION bin)
install(FILES sf3convert.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc)
endif (MINGW)