Debian Codegraph @

CMakeLists.txt

raw
1 #=============================================================================
2 # MuseScore sftools
3 #
4 # Copyright (C) 2011-2014 Werner Schweer
5 #
6 # This work is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public
8 # License as published by the Free Software Foundation; either
9 # version 2 of the License, or (at your option) any later version.
10 #
11 # In addition, as a special exception, licensor gives permission to
12 # link the code of this work with the OpenSSL Library (or with modified
13 # versions of OpenSSL that use the same license as OpenSSL), and
14 # distribute linked combinations including the two. You must obey the
15 # GNU General Public License in all respects for all of the code used
16 # other than OpenSSL. If you modify this file, you may extend this
17 # exception to your version of the file, but you are not obligated to
18 # do so. If you do not wish to do so, delete this exception statement
19 # from your version. (This exception is necessary should this work be
20 # included in a GPL-licenced work.)
21 #
22 # See COPYING.LIB for the licence text and disclaimer of warranty.
23 #=============================================================================
24
25 project(sf3convert)
26 CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
27 include (GNUInstallDirs)
28 include (${PROJECT_SOURCE_DIR}/build/FindQt5.cmake)
29 include (${PROJECT_SOURCE_DIR}/build/UsePkgConfig1.cmake)
30 # set(CMAKE_VERBOSE_MAKEFILE ON)
31
32 set(QT_MIN_VERSION "5.6")
33 set(QT_USE_QTXML TRUE)
34
35 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
36
37 # distributions might need to override these
38 if (MINGW)
39 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
40 else (MINGW)
41 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fPIC -fPIE")
42 endif (MINGW)
43
44 add_executable(sf3convert
45 sfconvert.cpp sfont.cpp xml.cpp
46 )
47
48 if (MINGW)
49 target_link_libraries(sf3convert
50 ${QT_LIBRARIES}
51 vorbis
52 ##vorbisfile
53 ogg
54 sndfile-1
55 )
56
57 install( TARGETS sf3convert RUNTIME DESTINATION . )
58
59 install_files ( . .dll
60 ${CROSS}/bin/libgcc_s_dw2-1.dll
61 ${CROSS}/bin/libstdc++-6.dll
62 ${CROSS}/bin/libwinpthread-1.dll
63 ${CROSS}/lib/libsndfile-1.dll
64 ${CROSS}/lib/libogg.dll
65 ${CROSS}/lib/libvorbis.dll
66 ${CROSSQT}/bin/Qt5Core.dll
67 ${CROSSQT}/bin/Qt5Xml.dll
68 ${CROSSQT}/bin/icuin51.dll
69 ${CROSSQT}/bin/icuuc51.dll
70 ${CROSSQT}/bin/icudt51.dll
71 )
72 else (MINGW)
73
74 ##
75 ## libsndfile
76 ##
77
78 PKGCONFIG1 (sndfile 1.0.25 SNDFILE_INCDIR SNDFILE_LIBDIR SNDFILE_LIB SNDFILE_CPP)
79 if (SNDFILE_INCDIR)
80 message("libsndfile detected ${SNDFILE_INCDIR} ${SNDFILE_LIBDIR} ${SNDFILE_LIB}")
81 else (SNDFILE_INCDIR)
82 message("libsndfile not found\n")
83 endif (SNDFILE_INCDIR)
84
85 ##
86 ## libvorbis
87 ##
88
89 PKGCONFIG1 (vorbis 1.3.3 VORBIS_INCDIR VORBIS_LIBDIR VORBIS_LIB VORBIS_CPP)
90 if (VORBIS_INCDIR)
91 message("libvorbis detected ${VORBIS_INCDIR} ${VORBIS_LIBDIR} ${VORBIS_LIB}")
92 else (VORBIS_INCDIR)
93 message("libvorbis not found\n")
94 endif (VORBIS_INCDIR)
95
96 ##
97 ## libogg
98 ##
99
100 PKGCONFIG1 (ogg 1.3.0 OGG_INCDIR OGG_LIBDIR OGG_LIB OGG_CPP)
101 if (OGG_INCDIR)
102 message("libogg detected ${OGG_INCDIR} ${OGG_LIBDIR} ${OGG_LIB}")
103 else (OGG_INCDIR)
104 message("libogg not found\n")
105 endif (OGG_INCDIR)
106
107 ##
108 ## Includes
109 ##
110 include_directories(
111 ${PROJECT_SOURCE_DIR}
112 ${PROJECT_BINARY_DIR}
113 ${SNDFILE_INCDIR}
114 ${OGG_INCDIR}
115 ${VORBIS_INCDIR}
116 )
117
118 target_link_libraries(sf3convert
119 ${QT_LIBRARIES}
120 ${OGG_LIB}
121 ${VORBIS_LIB}
122 vorbisenc
123 ${SNDFILE_LIB}
124 )
125
126 install(TARGETS sf3convert RUNTIME DESTINATION bin)
127 install(FILES sf3convert.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc)
128 endif (MINGW)