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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC