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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC