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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3589 - (hide annotations) (download)
Sun Sep 1 20:01:03 2019 UTC (3 years, 4 months ago) by capela
File MIME type: text/plain
File size: 4274 byte(s)
- Added alternate yet non-official CMake build option. (EXPERIMENTAL)
1 capela 3570 set(NAME qsampler)
2 capela 3567
3     include_directories (
4 capela 3589 ${CMAKE_CURRENT_SOURCE_DIR}
5 capela 3567 ${CMAKE_CURRENT_BINARY_DIR}
6     )
7    
8     configure_file (cmake_config.h ${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 capela 3570 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 capela 3567 ${UI_SOURCES}
107     ${MOC_SOURCES}
108     ${QRC_SOURCES}
109     ${SOURCES}
110     )
111    
112 capela 3572 set_target_properties (${NAME} PROPERTIES CXX_STANDARD 11)
113    
114 capela 3570 if (WIN32)
115 capela 3572 set_target_properties (${NAME} PROPERTIES WIN32_EXECUTABLE true)
116 capela 3570 endif ()
117 capela 3567
118 capela 3570 if (APPLE)
119 capela 3572 set_target_properties (${NAME} PROPERTIES MACOSX_BUNDLE true)
120 capela 3567 endif ()
121    
122 capela 3570 target_link_libraries (${NAME} PRIVATE Qt5::Widgets)
123    
124 capela 3569 if (CONFIG_XUNIQUE)
125 capela 3570 target_link_libraries (${NAME} PRIVATE Qt5::Network)
126 capela 3569 endif ()
127    
128 capela 3570 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 capela 3567 if (UNIX AND NOT APPLE)
138 capela 3570 install (TARGETS ${NAME} RUNTIME
139 capela 3569 DESTINATION ${CMAKE_INSTALL_BINDIR})
140 capela 3567 install (FILES ${QM_FILES}
141 capela 3570 DESTINATION ${CMAKE_INSTALL_DATADIR}/${NAME}/translations)
142 capela 3589 install (FILES ${NAME}.desktop
143 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
144 capela 3570 install (FILES images/${NAME}.png
145 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
146 capela 3570 install (FILES images/${NAME}.svg
147 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
148 capela 3570 install (FILES appdata/${NAME}.appdata.xml
149 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
150 capela 3570 install (FILES mimetypes/${NAME}.xml
151 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages)
152 capela 3570 install (FILES mimetypes/application-x-${NAME}-session.png
153 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/mimetypes)
154 capela 3570 install (FILES mimetypes/application-x-${NAME}-session.svg
155 capela 3569 DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/mimetypes)
156 capela 3567 endif ()
157 capela 3570
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