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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4025 - (show annotations) (download)
Wed Feb 9 11:18:09 2022 UTC (2 years, 2 months ago) by capela
File MIME type: text/plain
File size: 4991 byte(s)
- Dropped travis-ci.com configuration.
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 set (CONFIG_DEBUG_OPTIONS -g -fsanitize=address -fno-omit-frame-pointer)
123 target_compile_options (${PROJECT_NAME} PRIVATE ${CONFIG_DEBUG_OPTIONS})
124 target_link_options (${PROJECT_NAME} PRIVATE ${CONFIG_DEBUG_OPTIONS})
125 endif ()
126
127 set_target_properties (${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
128
129 if (WIN32)
130 set_target_properties (${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE true)
131 endif ()
132
133 if (APPLE)
134 set_target_properties (${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true)
135 endif ()
136
137 target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
138
139 if (CONFIG_XUNIQUE)
140 target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Network)
141 endif ()
142
143 if (CONFIG_LIBLSCP)
144 target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::LSCP)
145 endif ()
146
147 if (CONFIG_LIBGIG)
148 target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::GIG)
149 endif ()
150
151
152 if (UNIX AND NOT APPLE)
153 install (TARGETS ${PROJECT_NAME} RUNTIME
154 DESTINATION ${CMAKE_INSTALL_BINDIR})
155 install (FILES ${QM_FILES}
156 DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations)
157 install (FILES images/${PROJECT_NAME}.png
158 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
159 install (FILES images/${PROJECT_NAME}.svg
160 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
161 install (FILES appdata/org.rncbc.${PROJECT_NAME}.desktop
162 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
163 install (FILES appdata/org.rncbc.${PROJECT_NAME}.metainfo.xml
164 DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
165 install (FILES mimetypes/${PROJECT_NAME}.xml
166 DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
167 install (FILES mimetypes/application-x-${PROJECT_NAME}-session.png
168 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/mimetypes)
169 install (FILES mimetypes/application-x-${PROJECT_NAME}-session.svg
170 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/mimetypes)
171 endif ()
172
173 if (WIN32)
174 install (TARGETS ${PROJECT_NAME} RUNTIME
175 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
176 install (FILES ${QM_FILES}
177 DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations)
178 endif ()

  ViewVC Help
Powered by ViewVC