-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
128 lines (111 loc) · 3.72 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
#=============================================================================
# MuseScore sftools
#
# Copyright (C) 2011-2014 Werner Schweer
#
# This work is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# In addition, as a special exception, licensor gives permission to
# link the code of this work with the OpenSSL Library (or with modified
# versions of OpenSSL that use the same license as OpenSSL), and
# distribute linked combinations including the two. You must obey the
# GNU General Public License in all respects for all of the code used
# other than OpenSSL. If you modify this file, you may extend this
# exception to your version of the file, but you are not obligated to
# do so. If you do not wish to do so, delete this exception statement
# from your version. (This exception is necessary should this work be
# included in a GPL-licenced work.)
#
# See COPYING.LIB for the licence text and disclaimer of warranty.
#=============================================================================
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
##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
${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)
##
## 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}
)
target_link_libraries(sf3convert
${QT_LIBRARIES}
${OGG_LIB}
${VORBIS_LIB}
vorbisenc
${SNDFILE_LIB}
)
install(TARGETS sf3convert RUNTIME DESTINATION bin)
install(FILES sf3convert.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc)
endif (MINGW)