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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3851 - (show annotations) (download)
Mon Jan 18 12:04:37 2021 UTC (3 years, 2 months ago) by capela
File MIME type: text/plain
File size: 4669 byte(s)
- CMake build system update (cmake >= 3.10)
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 (cmake_config.h.in ${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 set_target_properties (${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
121
122 if (WIN32)
123 set_target_properties (${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE true)
124 endif ()
125
126 if (APPLE)
127 set_target_properties (${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true)
128 endif ()
129
130 target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
131
132 if (CONFIG_XUNIQUE)
133 target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Network)
134 endif ()
135
136 if (CONFIG_LIBLSCP)
137 target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::LSCP)
138 endif ()
139
140 if (CONFIG_LIBGIG)
141 target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::GIG)
142 endif ()
143
144
145 if (UNIX AND NOT APPLE)
146 install (TARGETS ${PROJECT_NAME} RUNTIME
147 DESTINATION ${CMAKE_INSTALL_BINDIR})
148 install (FILES ${QM_FILES}
149 DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations)
150 install (FILES ${PROJECT_NAME}.desktop
151 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
152 install (FILES images/${PROJECT_NAME}.png
153 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
154 install (FILES images/${PROJECT_NAME}.svg
155 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
156 install (FILES appdata/${PROJECT_NAME}.appdata.xml
157 DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
158 install (FILES mimetypes/${PROJECT_NAME}.xml
159 DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
160 install (FILES mimetypes/application-x-${PROJECT_NAME}-session.png
161 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/mimetypes)
162 install (FILES mimetypes/application-x-${PROJECT_NAME}-session.svg
163 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/mimetypes)
164 endif ()
165
166 if (WIN32)
167 install (TARGETS ${PROJECT_NAME} RUNTIME
168 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
169 install (FILES ${QM_FILES}
170 DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations)
171 endif ()

  ViewVC Help
Powered by ViewVC