# This file is copyrighted under the GPL2+ license # copyright 2013, Jean-Philippe Meuret # qatsh executable message(STATUS "Configuring qatsh ...") # External dependencies. find_package(Qt4 4.4 COMPONENTS QtCore QtGui REQUIRED) include(${QT_USE_FILE}) set(QT_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) # Odd it is needed (CMake 2.8.8) ! find_package(LibSndFile REQUIRED) # Sources set(_SRCS Main.cpp MainWindow.cpp DocumentWindow.cpp ATSModelManager.cpp ATSModel.cpp ATSModelItems.cpp ATSDataProxyModel.cpp ATSFrameProxyModel.cpp ATSPartialsFrameProxyModel.cpp ATSPartialsProxyModel.cpp ATSPropertiesProxyModel.cpp ATSResidualsFrameProxyModel.cpp ATSResidualsProxyModel.cpp FrameAndDataProcessor.cpp ATSSound.cpp ATSSynthesis.cpp IATSAnalysis.cpp ColorMap.cpp ColorScale.cpp Ruler.cpp RulerSpec.cpp SampledSound.cpp StandardAnalysis.cpp AnalysisParamsDialog.cpp FilePropertiesDialog.cpp PreferencesDialog.cpp DataSelectionWidget.cpp AnalysisParamsWidget.cpp SynthesisParamsWidget.cpp TableAndToolsWidget.cpp FrameAndDataEditionWidget.cpp FrameSelectionWidget.cpp PartialsSpecgramWidget.cpp ResidualsSpecgramWidget.cpp FilePropertiesView.cpp PartialsFrameTableView.cpp ResidualsFrameTableView.cpp PartialsSpecgramGraphicsFrameItem.cpp PartialsSpecgramGraphicsScene.cpp ResidualsSpecgramGraphicsScene.cpp PartialsSpecgramGraphicsView.cpp ResidualsSpecgramGraphicsView.cpp) set(_HDRS TypesAndConstants.h ColorMap.h RulerSpec.h SampledSound.h ATSMath.h ATSSound.h ATSModelManager.h ATSModelItems.h PartialsSpecgramGraphicsFrameItem.h FrameAndDataProcessor.h IATSAnalysis.h StandardAnalysis.h ATSSynthesis.h) set(_MOC_HDRS MainWindow.h DocumentWindow.h ATSModel.h ATSDataProxyModel.h ATSFrameProxyModel.h ATSPartialsFrameProxyModel.h ATSPartialsProxyModel.h ATSPropertiesProxyModel.h ATSResidualsFrameProxyModel.h ATSResidualsProxyModel.h ColorScale.h Ruler.h PreferencesDialog.h AnalysisParamsDialog.h FilePropertiesDialog.h AnalysisParamsWidget.h DataSelectionWidget.h FrameAndDataEditionWidget.h FrameSelectionWidget.h SynthesisParamsWidget.h TableAndToolsWidget.h PartialsSpecgramWidget.h ResidualsSpecgramWidget.h FilePropertiesView.h PartialsFrameTableView.h ResidualsFrameTableView.h PartialsSpecgramGraphicsScene.h ResidualsSpecgramGraphicsScene.h PartialsSpecgramGraphicsView.h ResidualsSpecgramGraphicsView.h) set(_UIS MainWindow.ui DocumentWindow.ui PreferencesDialog.ui FilePropertiesDialog.ui AnalysisParamsDialog.ui AnalysisParamsWidget.ui DataSelectionWidget.ui FrameAndDataEditionWidget.ui FrameSelectionWidget.ui FilePropertiesView.ui PartialsFrameTableView.ui ResidualsFrameTableView.ui PartialsSpecgramWidget.ui ResidualsSpecgramWidget.ui SynthesisParamsWidget.ui TableAndToolsWidget.ui) set(_RSCS qatsh.qrc) # Run moc on header files using Q_OBJECT qt4_wrap_cpp(_MOC_SRCS ${_MOC_HDRS}) # Run uic on .ui files. qt4_wrap_ui(_UI_HDRS ${_UIS}) # Generate code for resources. qt4_add_resources(_RCC_SRCS ${_RSCS}) # Embbed icon in executable. if(MINGW) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o COMMAND windres.exe -i ${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.rc -o ${CMAKE_CURRENT_BINARY_DIR}/icon.o) set(_RCC_SRCS ${_RCC_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/icon.o) elseif (MSVC) set(_RCC_SRC ${_RCC_SRCS} icons/icon.rc) endif(MINGW) # Include dirs. include_directories(${CMAKE_SOURCE_DIR}/mathexpr ${CMAKE_SOURCE_DIR}/atsa ${QT_INCLUDES} ${LIBSNDFILE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) # The executable add_executable(qatsh ${_SRCS} ${_MOC_SRCS} ${_MOC_HDRS} ${_HDRS} ${_UI_HDRS} ${_RCC_SRCS}) # Link libs. target_link_libraries(qatsh atsa mathexpr ${QT_LIBRARIES} ${LIBSNDFILE_LIBRARY}) # Installation. install(TARGETS qatsh RUNTIME DESTINATION bin) if(UNIX) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/qatsh-b48.png DESTINATION share/icons) endif(UNIX) # 3rd party and compiler run-times installation. if(WIN32) include(thirdparty) INSTALL_3RDPARTY_RUNTIME() endif(WIN32)