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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3570 - (show annotations) (download)
Mon Aug 26 13:49:09 2019 UTC (2 years, 10 months ago) by capela
File MIME type: text/plain
File size: 4462 byte(s)
- Updated/added README.cmake to present new CMake build instructions.
1 set(NAME qsampler)
2
3 include_directories (
4 ${CMAKE_CURRENT_BINARY_DIR}
5 ${CMAKE_CURRENT_SOURCE_DIR}
6 ${QT_INCLUDES}
7 )
8
9 link_directories (
10 ${CMAKE_CURRENT_BINARY_DIR}
11 ${QT_LIBRARY_DIR}
12 )
13
14 configure_file (cmake_config.h ${CMAKE_CURRENT_BINARY_DIR}/config.h)
15
16 configure_file (${NAME}.desktop ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.desktop)
17
18 set (HEADERS
19 qsampler.h
20 qsamplerAbout.h
21 qsamplerOptions.h
22 qsamplerChannel.h
23 qsamplerMessages.h
24 qsamplerInstrument.h
25 qsamplerInstrumentList.h
26 qsamplerDevice.h
27 qsamplerFxSend.h
28 qsamplerFxSendsModel.h
29 qsamplerUtilities.h
30 qsamplerInstrumentForm.h
31 qsamplerInstrumentListForm.h
32 qsamplerDeviceForm.h
33 qsamplerDeviceStatusForm.h
34 qsamplerChannelStrip.h
35 qsamplerChannelForm.h
36 qsamplerChannelFxForm.h
37 qsamplerOptionsForm.h
38 qsamplerMainForm.h
39 )
40
41 set (SOURCES
42 qsampler.cpp
43 qsamplerOptions.cpp
44 qsamplerChannel.cpp
45 qsamplerMessages.cpp
46 qsamplerInstrument.cpp
47 qsamplerInstrumentList.cpp
48 qsamplerDevice.cpp
49 qsamplerFxSend.cpp
50 qsamplerFxSendsModel.cpp
51 qsamplerUtilities.cpp
52 qsamplerInstrumentForm.cpp
53 qsamplerInstrumentListForm.cpp
54 qsamplerDeviceForm.cpp
55 qsamplerDeviceStatusForm.cpp
56 qsamplerChannelStrip.cpp
57 qsamplerChannelForm.cpp
58 qsamplerChannelFxForm.cpp
59 qsamplerOptionsForm.cpp
60 qsamplerMainForm.cpp
61 )
62
63 set (FORMS
64 qsamplerInstrumentForm.ui
65 qsamplerInstrumentListForm.ui
66 qsamplerDeviceForm.ui
67 qsamplerChannelStrip.ui
68 qsamplerChannelForm.ui
69 qsamplerChannelFxForm.ui
70 qsamplerOptionsForm.ui
71 qsamplerMainForm.ui
72 )
73
74 set (RESOURCES
75 qsampler.qrc
76 )
77
78 set (TRANSLATIONS
79 translations/qsampler_cs.ts
80 translations/qsampler_fr.ts
81 translations/qsampler_ru.ts
82 )
83
84 qt5_add_translation ( QM_FILES ${TRANSLATIONS} )
85 add_custom_target( translations ALL DEPENDS ${QM_FILES} )
86
87 qt5_wrap_ui (UI_SOURCES ${FORMS})
88 qt5_wrap_cpp (MOC_SOURCES ${HEADERS})
89 qt5_add_resources (QRC_SOURCES ${RESOURCES})
90
91 if (WIN32)
92 set (RC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/win32/${NAME}.rc)
93 set (RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/${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/${NAME}.icns)
106 list (APPEND SOURCES ${ICON_FILE})
107 set (MACOSX_BUNDLE_ICON_FILE ${NAME}.icns)
108 set_source_files_properties (${ICON_FILE} PROPERTIES
109 MACOSX_PACKAGE_LOCATION Resources)
110 endif ()
111
112
113 add_executable (${NAME}
114 ${UI_SOURCES}
115 ${MOC_SOURCES}
116 ${QRC_SOURCES}
117 ${SOURCES}
118 )
119
120 if (WIN32)
121 set_target_properties ($[NAME} PROPERTIES WIN32_EXECUTABLE true)
122 endif ()
123
124 if (APPLE)
125 set_target_properties ($[NAME} PROPERTIES MACOSX_BUNDLE true)
126 endif ()
127
128 target_compile_options (${NAME} PRIVATE -std=c++11)
129
130 target_link_libraries (${NAME} PRIVATE Qt5::Widgets)
131
132 if (CONFIG_XUNIQUE)
133 target_link_libraries (${NAME} PRIVATE Qt5::Network)
134 endif ()
135
136 if (CONFIG_LIBLSCP)
137 target_link_libraries (${NAME} PRIVATE ${LSCP_LIBRARIES})
138 endif ()
139
140 if (CONFIG_LIBGIG)
141 target_link_libraries (${NAME} PRIVATE ${GIG_LIBRARIES})
142 endif ()
143
144
145 if (UNIX AND NOT APPLE)
146 install (TARGETS ${NAME} RUNTIME
147 DESTINATION ${CMAKE_INSTALL_BINDIR})
148 install (FILES ${QM_FILES}
149 DESTINATION ${CMAKE_INSTALL_DATADIR}/${NAME}/translations)
150 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.desktop
151 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
152 install (FILES images/${NAME}.png
153 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
154 install (FILES images/${NAME}.svg
155 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
156 install (FILES appdata/${NAME}.appdata.xml
157 DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
158 install (FILES mimetypes/${NAME}.xml
159 DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
160 install (FILES mimetypes/application-x-${NAME}-session.png
161 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/mimetypes)
162 install (FILES mimetypes/application-x-${NAME}-session.svg
163 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/mimetypes)
164 endif ()
165
166 if (WIN32)
167 install (TARGETS ${NAME} RUNTIME
168 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
169 install (FILES ${QM_FILES}
170 DESTINATION ${CMAKE_INSTALL_DATADIR}/${NAME}/translations)
171 endif ()

  ViewVC Help
Powered by ViewVC