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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC