/[svn]/qsampler/trunk/src/CMakeLists.txt
ViewVC logotype

Contents of /qsampler/trunk/src/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4023 - (show annotations) (download)
Sun Jan 9 10:45:21 2022 UTC (2 years, 2 months ago) by capela
File MIME type: text/plain
File size: 4913 byte(s)
0.9.5
1 # project (qsampler)
2
3 set (CMAKE_INCLUDE_CURRENT_DIR ON)
4
5 set (CMAKE_AUTOUIC ON)
6 set (CMAKE_AUTOMOC ON)
7 set (CMAKE_AUTORCC ON)
8
9 if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
10 file (REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
11 endif ()
12 configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
13
14 set (HEADERS
15 qsampler.h
16 qsamplerAbout.h
17 qsamplerOptions.h
18 qsamplerChannel.h
19 qsamplerMessages.h
20 qsamplerInstrument.h
21 qsamplerInstrumentList.h
22 qsamplerDevice.h
23 qsamplerFxSend.h
24 qsamplerFxSendsModel.h
25 qsamplerUtilities.h
26 qsamplerInstrumentForm.h
27 qsamplerInstrumentListForm.h
28 qsamplerDeviceForm.h
29 qsamplerDeviceStatusForm.h
30 qsamplerChannelStrip.h
31 qsamplerChannelForm.h
32 qsamplerChannelFxForm.h
33 qsamplerOptionsForm.h
34 qsamplerPaletteForm.h
35 qsamplerMainForm.h
36 )
37
38 set (SOURCES
39 qsampler.cpp
40 qsamplerOptions.cpp
41 qsamplerChannel.cpp
42 qsamplerMessages.cpp
43 qsamplerInstrument.cpp
44 qsamplerInstrumentList.cpp
45 qsamplerDevice.cpp
46 qsamplerFxSend.cpp
47 qsamplerFxSendsModel.cpp
48 qsamplerUtilities.cpp
49 qsamplerInstrumentForm.cpp
50 qsamplerInstrumentListForm.cpp
51 qsamplerDeviceForm.cpp
52 qsamplerDeviceStatusForm.cpp
53 qsamplerChannelStrip.cpp
54 qsamplerChannelForm.cpp
55 qsamplerChannelFxForm.cpp
56 qsamplerOptionsForm.cpp
57 qsamplerPaletteForm.cpp
58 qsamplerMainForm.cpp
59 )
60
61 set (FORMS
62 qsamplerInstrumentForm.ui
63 qsamplerInstrumentListForm.ui
64 qsamplerDeviceForm.ui
65 qsamplerChannelStrip.ui
66 qsamplerChannelForm.ui
67 qsamplerChannelFxForm.ui
68 qsamplerOptionsForm.ui
69 qsamplerPaletteForm.ui
70 qsamplerMainForm.ui
71 )
72
73 set (RESOURCES
74 qsampler.qrc
75 )
76
77 set (TRANSLATIONS
78 translations/qsampler_cs.ts
79 translations/qsampler_fr.ts
80 translations/qsampler_ru.ts
81 )
82
83 if (QT_VERSION VERSION_LESS 5.15.0)
84 qt5_add_translation (QM_FILES ${TRANSLATIONS})
85 else ()
86 qt_add_translation (QM_FILES ${TRANSLATIONS})
87 endif ()
88
89 add_custom_target (translations ALL DEPENDS ${QM_FILES})
90
91 if (WIN32)
92 set (RC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/win32/${PROJECT_NAME}.rc)
93 set (RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.res.obj)
94 find_program (WINDRES_EXECUTABLE NAMES windres mingw32-windres i686-mingw32-windres)
95 if (MINGW)
96 exec_program (${WINDRES_EXECUTABLE}
97 ARGS "-i ${RC_FILE} -o ${RES_FILE} --include-dir=${CMAKE_CURRENT_SOURCE_DIR}/images")
98 list (APPEND SOURCES ${RES_FILE})
99 else ()
100 list (APPEND SOURCES ${RC_FILE})
101 endif ()
102 endif ()
103
104 if (APPLE)
105 set (ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/images/${PROJECT_NAME}.icns)
106 list (APPEND SOURCES ${ICON_FILE})
107 set (MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME}.icns)
108 set_source_files_properties (${ICON_FILE} PROPERTIES
109 MACOSX_PACKAGE_LOCATION Resources)
110 endif ()
111
112
113 add_executable (${PROJECT_NAME}
114 ${HEADERS}
115 ${SOURCES}
116 ${FORMS}
117 ${RESOURCES}
118 )
119
120 # Add some debugger flags.
121 if (CONFIG_DEBUG AND UNIX AND NOT APPLE)
122 target_compile_options (${PROJECT_NAME} PRIVATE -g -fsanitize=address -fno-omit-frame-pointer)
123 target_link_libraries (${PROJECT_NAME} PRIVATE asan)
124 endif ()
125
126 set_target_properties (${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
127
128 if (WIN32)
129 set_target_properties (${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE true)
130 endif ()
131
132 if (APPLE)
133 set_target_properties (${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true)
134 endif ()
135
136 target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
137
138 if (CONFIG_XUNIQUE)
139 target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Network)
140 endif ()
141
142 if (CONFIG_LIBLSCP)
143 target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::LSCP)
144 endif ()
145
146 if (CONFIG_LIBGIG)
147 target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::GIG)
148 endif ()
149
150
151 if (UNIX AND NOT APPLE)
152 install (TARGETS ${PROJECT_NAME} RUNTIME
153 DESTINATION ${CMAKE_INSTALL_BINDIR})
154 install (FILES ${QM_FILES}
155 DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations)
156 install (FILES org.rncbc.${PROJECT_NAME}.desktop
157 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
158 install (FILES images/${PROJECT_NAME}.png
159 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
160 install (FILES images/${PROJECT_NAME}.svg
161 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
162 install (FILES appdata/org.rncbc.${PROJECT_NAME}.xml
163 DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
164 install (FILES mimetypes/${PROJECT_NAME}.xml
165 DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
166 install (FILES mimetypes/application-x-${PROJECT_NAME}-session.png
167 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/mimetypes)
168 install (FILES mimetypes/application-x-${PROJECT_NAME}-session.svg
169 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/mimetypes)
170 endif ()
171
172 if (WIN32)
173 install (TARGETS ${PROJECT_NAME} RUNTIME
174 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
175 install (FILES ${QM_FILES}
176 DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations)
177 endif ()

  ViewVC Help
Powered by ViewVC