# project(qtractor) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.h) file(REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/config.h) endif() configure_file (cmake_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) set (HEADERS qtractor.h qtractorAbout.h qtractorAtomic.h qtractorActionControl.h qtractorAudioBuffer.h qtractorAudioClip.h qtractorAudioConnect.h qtractorAudioEngine.h qtractorAudioFile.h qtractorAudioListView.h qtractorAudioMadFile.h qtractorAudioMeter.h qtractorAudioMonitor.h qtractorAudioPeak.h qtractorAudioSndFile.h qtractorAudioVorbisFile.h qtractorClip.h qtractorClipCommand.h qtractorClipSelect.h qtractorComboBox.h qtractorCommand.h qtractorConnect.h qtractorConnections.h qtractorCtlEvent.h qtractorCurve.h qtractorCurveCommand.h qtractorCurveFile.h qtractorCurveSelect.h qtractorDocument.h qtractorDssiPlugin.h qtractorEngine.h qtractorEngineCommand.h qtractorFileList.h qtractorFileListView.h qtractorFiles.h qtractorFileSystem.h qtractorInsertPlugin.h qtractorInstrument.h qtractorInstrumentMenu.h qtractorLadspaPlugin.h qtractorList.h qtractorLv2Plugin.h qtractorMessageBox.h qtractorMessageList.h qtractorMessages.h qtractorMeter.h qtractorMidiBuffer.h qtractorMidiClip.h qtractorMidiConnect.h qtractorMidiControl.h qtractorMidiControlCommand.h qtractorMidiControlObserver.h qtractorMidiControlTypeGroup.h qtractorMidiCursor.h qtractorMidiEditor.h qtractorMidiEditCommand.h qtractorMidiEditEvent.h qtractorMidiEditList.h qtractorMidiEditSelect.h qtractorMidiEditTime.h qtractorMidiEditView.h qtractorMidiEngine.h qtractorMidiEvent.h qtractorMidiEventList.h qtractorMidiFile.h qtractorMidiFileTempo.h qtractorMidiListView.h qtractorMidiManager.h qtractorMidiMeter.h qtractorMidiMonitor.h qtractorMidiRpn.h qtractorMidiSequence.h qtractorMidiSysex.h qtractorMidiThumbView.h qtractorMidiTimer.h qtractorMixer.h qtractorMmcEvent.h qtractorMonitor.h qtractorNsmClient.h qtractorObserver.h qtractorObserverWidget.h qtractorOptions.h qtractorPlugin.h qtractorPluginFactory.h qtractorPluginCommand.h qtractorPluginListView.h qtractorPropertyCommand.h qtractorRingBuffer.h qtractorRubberBand.h qtractorScrollView.h qtractorSession.h qtractorSessionCommand.h qtractorSessionCursor.h qtractorSpinBox.h qtractorThumbView.h qtractorTimeScale.h qtractorTimeScaleCommand.h qtractorTimeStretcher.h qtractorTrack.h qtractorTrackButton.h qtractorTrackCommand.h qtractorTrackList.h qtractorTrackTime.h qtractorTrackView.h qtractorTracks.h qtractorVstPlugin.h qtractorVst3Plugin.h qtractorZipFile.h qtractorWsolaTimeStretcher.h qtractorBusForm.h qtractorClipForm.h qtractorConnectForm.h qtractorEditRangeForm.h qtractorExportForm.h qtractorInstrumentForm.h qtractorMainForm.h qtractorMidiControlForm.h qtractorMidiControlObserverForm.h qtractorMidiEditorForm.h qtractorMidiSysexForm.h qtractorMidiToolsForm.h qtractorOptionsForm.h qtractorPaletteForm.h qtractorPasteRepeatForm.h qtractorPluginForm.h qtractorPluginSelectForm.h qtractorSessionForm.h qtractorShortcutForm.h qtractorTakeRangeForm.h qtractorTempoAdjustForm.h qtractorTimeScaleForm.h qtractorTrackForm.h ) set (SOURCES qtractor.cpp qtractorActionControl.cpp qtractorAudioBuffer.cpp qtractorAudioClip.cpp qtractorAudioConnect.cpp qtractorAudioEngine.cpp qtractorAudioFile.cpp qtractorAudioListView.cpp qtractorAudioMadFile.cpp qtractorAudioMeter.cpp qtractorAudioMonitor.cpp qtractorAudioPeak.cpp qtractorAudioSndFile.cpp qtractorAudioVorbisFile.cpp qtractorClip.cpp qtractorClipCommand.cpp qtractorClipSelect.cpp qtractorComboBox.cpp qtractorCommand.cpp qtractorConnect.cpp qtractorConnections.cpp qtractorDocument.cpp qtractorCurve.cpp qtractorCurveCommand.cpp qtractorCurveFile.cpp qtractorCurveSelect.cpp qtractorDssiPlugin.cpp qtractorEngine.cpp qtractorEngineCommand.cpp qtractorFileList.cpp qtractorFileListView.cpp qtractorFiles.cpp qtractorFileSystem.cpp qtractorInsertPlugin.cpp qtractorInstrument.cpp qtractorInstrumentMenu.cpp qtractorLadspaPlugin.cpp qtractorLv2Plugin.cpp qtractorMessageBox.cpp qtractorMessageList.cpp qtractorMessages.cpp qtractorMeter.cpp qtractorMidiClip.cpp qtractorMidiConnect.cpp qtractorMidiControl.cpp qtractorMidiControlCommand.cpp qtractorMidiControlObserver.cpp qtractorMidiControlTypeGroup.cpp qtractorMidiCursor.cpp qtractorMidiEditor.cpp qtractorMidiEditCommand.cpp qtractorMidiEditEvent.cpp qtractorMidiEditList.cpp qtractorMidiEditSelect.cpp qtractorMidiEditTime.cpp qtractorMidiEditView.cpp qtractorMidiEngine.cpp qtractorMidiEventList.cpp qtractorMidiFile.cpp qtractorMidiFileTempo.cpp qtractorMidiListView.cpp qtractorMidiManager.cpp qtractorMidiMeter.cpp qtractorMidiMonitor.cpp qtractorMidiRpn.cpp qtractorMidiSequence.cpp qtractorMidiThumbView.cpp qtractorMidiTimer.cpp qtractorMixer.cpp qtractorMmcEvent.cpp qtractorNsmClient.cpp qtractorObserver.cpp qtractorObserverWidget.cpp qtractorOptions.cpp qtractorPlugin.cpp qtractorPluginFactory.cpp qtractorPluginCommand.cpp qtractorPluginListView.cpp qtractorRubberBand.cpp qtractorScrollView.cpp qtractorSession.cpp qtractorSessionCommand.cpp qtractorSessionCursor.cpp qtractorSpinBox.cpp qtractorThumbView.cpp qtractorTimeScale.cpp qtractorTimeScaleCommand.cpp qtractorTimeStretcher.cpp qtractorTrack.cpp qtractorTrackButton.cpp qtractorTrackCommand.cpp qtractorTrackList.cpp qtractorTrackTime.cpp qtractorTrackView.cpp qtractorTracks.cpp qtractorVstPlugin.cpp qtractorVst3Plugin.cpp qtractorWsolaTimeStretcher.cpp qtractorZipFile.cpp qtractorBusForm.cpp qtractorClipForm.cpp qtractorConnectForm.cpp qtractorEditRangeForm.cpp qtractorExportForm.cpp qtractorInstrumentForm.cpp qtractorMainForm.cpp qtractorMidiControlForm.cpp qtractorMidiControlObserverForm.cpp qtractorMidiEditorForm.cpp qtractorMidiSysexForm.cpp qtractorMidiToolsForm.cpp qtractorOptionsForm.cpp qtractorPaletteForm.cpp qtractorPasteRepeatForm.cpp qtractorPluginForm.cpp qtractorPluginSelectForm.cpp qtractorSessionForm.cpp qtractorShortcutForm.cpp qtractorTakeRangeForm.cpp qtractorTempoAdjustForm.cpp qtractorTimeScaleForm.cpp qtractorTrackForm.cpp ) set (FORMS qtractorBusForm.ui qtractorClipForm.ui qtractorConnectForm.ui qtractorEditRangeForm.ui qtractorExportForm.ui qtractorInstrumentForm.ui qtractorMainForm.ui qtractorMidiControlForm.ui qtractorMidiControlObserverForm.ui qtractorMidiEditorForm.ui qtractorMidiSysexForm.ui qtractorMidiToolsForm.ui qtractorOptionsForm.ui qtractorPaletteForm.ui qtractorPasteRepeatForm.ui qtractorPluginForm.ui qtractorPluginSelectForm.ui qtractorSessionForm.ui qtractorShortcutForm.ui qtractorTakeRangeForm.ui qtractorTempoAdjustForm.ui qtractorTimeScaleForm.ui qtractorTrackForm.ui ) set (RESOURCES qtractor.qrc ) set (TRANSLATIONS translations/qtractor_cs.ts translations/qtractor_de.ts translations/qtractor_es.ts translations/qtractor_fr.ts translations/qtractor_it.ts translations/qtractor_ja.ts translations/qtractor_pt.ts translations/qtractor_ru.ts ) if (QT_VERSION VERSION_LESS 5.15.0) qt5_add_translation (QM_FILES ${TRANSLATIONS}) else () qt_add_translation (QM_FILES ${TRANSLATIONS}) endif () add_custom_target (translations ALL DEPENDS ${QM_FILES}) if (WIN32) set (RC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/win32/${PROJECT_NAME}.rc) set (RES_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.res.obj) find_program (WINDRES_EXECUTABLE NAMES windres mingw32-windres i686-mingw32-windres) if (MINGW) exec_program (${WINDRES_EXECUTABLE} ARGS "-i ${RC_FILE} -o ${RES_FILE} --include-dir=${CMAKE_CURRENT_SOURCE_DIR}/images") list (APPEND SOURCES ${RES_FILE}) else () list (APPEND SOURCES ${RC_FILE}) endif () endif () if (APPLE) set (ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/images/${PROJECT_NAME}.icns) list (APPEND SOURCES ${ICON_FILE}) set (MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME}.icns) set_source_files_properties (${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) endif () if (CONFIG_VST3SDK) add_definitions(-DNDEBUG) set (VST3SDK_SOURCES ${CONFIG_VST3SDK}/base/source/baseiids.cpp # ${CONFIG_VST3SDK}/base/source/fstring.cpp ${CONFIG_VST3SDK}/base/source/fobject.cpp ${CONFIG_VST3SDK}/base/thread/source/flock.cpp ${CONFIG_VST3SDK}/public.sdk/source/common/commoniids.cpp ${CONFIG_VST3SDK}/public.sdk/source/vst/vstinitiids.cpp ${CONFIG_VST3SDK}/pluginterfaces/base/coreiids.cpp ${CONFIG_VST3SDK}/pluginterfaces/base/funknown.cpp ) endif () add_executable (${PROJECT_NAME} ${HEADERS} ${SOURCES} ${FORMS} ${RESOURCES} ${VST3SDK_SOURCES} ) add_executable (${PROJECT_NAME}_plugin_scan qtractor_plugin_scan.cpp ${VST3SDK_SOURCES}) set_target_properties (${PROJECT_NAME} PROPERTIES CXX_STANDARD 17) set_target_properties (${PROJECT_NAME}_plugin_scan PROPERTIES CXX_STANDARD 17) if (WIN32) set_target_properties (${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE true) set_target_properties (${PROJECT_NAME}_plugin_scan PROPERTIES WIN32_EXECUTABLE true) endif () if (APPLE) set_target_properties (${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true) set_target_properties (${PROJECT_NAME}_plugin_scan PROPERTIES MACOSX_BUNDLE true) endif () target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml) target_link_libraries (${PROJECT_NAME}_plugin_scan PRIVATE Qt${QT_VERSION_MAJOR}::Core) if (CONFIG_XUNIQUE) target_link_libraries (${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Network) endif () if (CONFIG_LIBJACK) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::JACK) endif () if (CONFIG_LIBASOUND) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::ALSA) endif () if (CONFIG_LIBSNDFILE) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::SNDFILE) endif () if (CONFIG_LIBVORBIS) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::VORBIS) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::VORBISENC) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::VORBISFILE) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::OGG) endif () if (CONFIG_LIBMAD) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::MAD) endif () if (CONFIG_LIBSAMPLERATE) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::SAMPLERATE) endif () if (CONFIG_LIBRUBBERBAND) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::RUBBERBAND) endif () if (CONFIG_LIBAUBIO) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::AUBIO) endif () if (CONFIG_LIBLO) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::LIBLO) endif () if (CONFIG_LIBZ) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::ZLIB) endif () if (CONFIG_LIBLILV) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::LILV) endif () if (CONFIG_LIBSUIL) target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::SUIL) endif () if (UNIX AND NOT APPLE) install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install (TARGETS ${PROJECT_NAME}_plugin_scan RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}) install (FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations) install (FILES ${PROJECT_NAME}.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install (FILES images/${PROJECT_NAME}.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps) install (FILES appdata/${PROJECT_NAME}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) install (FILES mimetypes/${PROJECT_NAME}.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages) install (FILES mimetypes/application-x-${PROJECT_NAME}-session.png mimetypes/application-x-${PROJECT_NAME}-template.png mimetypes/application-x-${PROJECT_NAME}-archive.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/mimetypes) install (FILES mimetypes/application-x-${PROJECT_NAME}-session.svg mimetypes/application-x-${PROJECT_NAME}-template.svg mimetypes/application-x-${PROJECT_NAME}-archive.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/mimetypes) endif () if (WIN32) install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install (TARGETS ${PROJECT_NAME}_plugin_scan RUNTIME DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install (FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations) endif ()