| 1 |
|
| 2 |
include(ECMAddAppIcon) |
| 3 |
|
| 4 |
add_subdirectory(ui/icons) |
| 5 |
|
| 6 |
# Sources |
| 7 |
set(APPLIB_SRCS |
| 8 |
core/Synthesizer.cpp |
| 9 |
core/NoiseGenerator.cpp |
| 10 |
core/WavSaver.cpp |
| 11 |
core/Sound.cpp |
| 12 |
core/SoundUtils.cpp |
| 13 |
core/SoundPlayer.cpp |
| 14 |
core/SoundListModel.cpp |
| 15 |
core/SoundIO.cpp |
| 16 |
core/Result.cpp |
| 17 |
core/WaveForm.cpp |
| 18 |
ui/SoundPreview.cpp |
| 19 |
) |
| 20 |
|
| 21 |
qpropgen(QPROPGEN_SRCS |
| 22 |
core/BaseSound.yaml |
| 23 |
core/BaseSoundListModel.yaml |
| 24 |
core/BaseWavSaver.yaml |
| 25 |
) |
| 26 |
|
| 27 |
# App library |
| 28 |
add_library(${APPLIB_NAME} STATIC |
| 29 |
${APPLIB_SRCS} |
| 30 |
${QPROPGEN_SRCS} |
| 31 |
) |
| 32 |
target_include_directories(${APPLIB_NAME} |
| 33 |
PUBLIC core |
| 34 |
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/core |
| 35 |
PRIVATE ${SDL_INCLUDE_DIR} |
| 36 |
) |
| 37 |
target_link_libraries(${APPLIB_NAME} |
| 38 |
SDL |
| 39 |
Qt5::Qml |
| 40 |
Qt5::Concurrent |
| 41 |
Qt5::Core |
| 42 |
Qt5::Quick |
| 43 |
) |
| 44 |
|
| 45 |
# App executable |
| 46 |
set(APP_SRCS |
| 47 |
ui/main.cpp |
| 48 |
ui/Generator.cpp |
| 49 |
) |
| 50 |
|
| 51 |
qt5_add_resources(QRC_SRCS ui/qml.qrc) |
| 52 |
|
| 53 |
ecm_add_app_icon( |
| 54 |
APP_SRCS |
| 55 |
ICONS |
| 56 |
ui/icons/48-apps-${APP_NAME}.png |
| 57 |
ui/icons/32-apps-${APP_NAME}.png |
| 58 |
ui/icons/16-apps-${APP_NAME}.png |
| 59 |
) |
| 60 |
add_executable(${APP_NAME} WIN32 MACOSX_BUNDLE ${APP_SRCS} ${QRC_SRCS}) |
| 61 |
|
| 62 |
target_link_libraries(${APP_NAME} |
| 63 |
${APPLIB_NAME} |
| 64 |
Qt5::Widgets |
| 65 |
Qt5::Quick |
| 66 |
) |
| 67 |
|
| 68 |
target_include_directories(${APP_NAME} |
| 69 |
PRIVATE ui |
| 70 |
) |
| 71 |
|
| 72 |
# Install |
| 73 |
install( |
| 74 |
TARGETS ${APP_NAME} |
| 75 |
BUNDLE DESTINATION . |
| 76 |
RUNTIME DESTINATION bin |
| 77 |
) |
| 78 |
|
| 79 |
if (UNIX AND NOT APPLE) |
| 80 |
install(FILES linux/${APP_NAME}.desktop |
| 81 |
DESTINATION share/applications |
| 82 |
RENAME ${INVERSE_ORGANIZATION_NAME}.${APP_NAME}.desktop |
| 83 |
) |
| 84 |
endif() |
| 85 |
|
| 86 |
if (WIN32) |
| 87 |
include(DeployQt) |
| 88 |
windeployqt(${APP_NAME}) |
| 89 |
endif() |
| 90 |
|
| 91 |
if (APPLE) |
| 92 |
include(DeployQt) |
| 93 |
macdeployqt(${APP_NAME}) |
| 94 |
endif() |