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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4023 - (hide annotations) (download)
Sun Jan 9 10:45:21 2022 UTC (4 months, 1 week ago) by capela
File MIME type: text/plain
File size: 4913 byte(s)
0.9.5
1 capela 3910 # project (qsampler)
2 capela 3567
3 capela 3910 set (CMAKE_INCLUDE_CURRENT_DIR ON)
4 capela 3567
5 capela 3910 set (CMAKE_AUTOUIC ON)
6     set (CMAKE_AUTOMOC ON)
7     set (CMAKE_AUTORCC ON)
8 capela 3851
9     if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
10 capela 4005 file (REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
11 capela 3910 endif ()
12 capela 4005 configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
13 capela 3567
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 capela 3648 qsamplerPaletteForm.h
35 capela 3567 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 capela 3648 qsamplerPaletteForm.cpp
58 capela 3567 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 capela 3648 qsamplerPaletteForm.ui
70 capela 3567 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 capela 3851 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 capela 3567
89 capela 3841 add_custom_target (translations ALL DEPENDS ${QM_FILES})
90 capela 3567
91 capela 3570 if (WIN32)
92 capela 3839 set (RC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/win32/${PROJECT_NAME}.rc)
93     set (RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.res.obj)
94 capela 3570 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 capela 3839 set (ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/images/${PROJECT_NAME}.icns)
106 capela 3570 list (APPEND SOURCES ${ICON_FILE})
107 capela 3839 set (MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME}.icns)
108 capela 3570 set_source_files_properties (${ICON_FILE} PROPERTIES
109     MACOSX_PACKAGE_LOCATION Resources)
110     endif ()
111    
112    
113 capela 3839 add_executable (${PROJECT_NAME}
114 capela 3851 ${HEADERS}
115 capela 3567 ${SOURCES}
116 capela 3851 ${FORMS}
117     ${RESOURCES}
118 capela 3567 )
119    
120 capela 3910 # Add some debugger flags.
121 capela 3973 if (CONFIG_DEBUG AND UNIX AND NOT APPLE)
122 capela 3910 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 capela 3839 set_target_properties (${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
127 capela 3572
128 capela 3570 if (WIN32)
129 capela 3839 set_target_properties (${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE true)
130 capela 3570 endif ()
131 capela 3567
132 capela 3570 if (APPLE)
133 capela 3839 set_target_properties (${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true)
134 capela 3567 endif ()
135    
136 capela 3841 target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
137 capela 3570
138 capela 3569 if (CONFIG_XUNIQUE)
139 capela 3841 target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Network)
140 capela 3569 endif ()
141    
142 capela 3570 if (CONFIG_LIBLSCP)
143 capela 3851 target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::LSCP)
144 capela 3570 endif ()
145    
146     if (CONFIG_LIBGIG)
147 capela 3851 target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::GIG)
148 capela 3570 endif ()
149    
150    
151 capela 3567 if (UNIX AND NOT APPLE)
152 capela 3839 install (TARGETS ${PROJECT_NAME} RUNTIME
153 capela 3569 DESTINATION ${CMAKE_INSTALL_BINDIR})
154 capela 3567 install (FILES ${QM_FILES}
155 capela 3839 DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations)
156 capela 4023 install (FILES org.rncbc.${PROJECT_NAME}.desktop
157 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
158 capela 3839 install (FILES images/${PROJECT_NAME}.png
159 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
160 capela 3839 install (FILES images/${PROJECT_NAME}.svg
161 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
162 capela 4023 install (FILES appdata/org.rncbc.${PROJECT_NAME}.xml
163 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
164 capela 3839 install (FILES mimetypes/${PROJECT_NAME}.xml
165 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
166 capela 3839 install (FILES mimetypes/application-x-${PROJECT_NAME}-session.png
167 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/mimetypes)
168 capela 3839 install (FILES mimetypes/application-x-${PROJECT_NAME}-session.svg
169 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/mimetypes)
170 capela 3567 endif ()
171 capela 3570
172     if (WIN32)
173 capela 3839 install (TARGETS ${PROJECT_NAME} RUNTIME
174 capela 3570 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
175     install (FILES ${QM_FILES}
176 capela 3839 DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations)
177 capela 3570 endif ()

  ViewVC Help
Powered by ViewVC