aboutsummaryrefslogblamecommitdiff
path: root/qmidiplayer-desktop/CMakeLists.txt
blob: 037a3f1a9d5324f5aa033d5117759cfc685bfeac (plain) (tree)
1
2
3
4
5
6




                           
                               













                           
                               











                         
                              










                        
         
                                                  

            







                                                   

                                                               


                                                                                
 











                                 
 



                                                                                        









                                                                                                                                 
                                                                                                        
set(qmpdesktop_SOURCES
    qdialskulpturestyle.hpp
    qmpchanneleditor.hpp
    qmpchannelswindow.hpp
    qmpcustomizewindow.hpp
    qmpdeviceprioritydialog.hpp
    qmpdevpropdialog.hpp
    qmpefxwindow.hpp
    qmphelpwindow.hpp
    qmpinfowindow.hpp
    qmpmainwindow.hpp
    qmpplistwindow.hpp
    qmpplugin.hpp
    qmppresetselect.hpp
    qmpsettingswindow.hpp
    main.cpp
    qdialskulpturestyle.cpp
    qmpchanneleditor.cpp
    qmpchannelswindow.cpp
    qmpcustomizewindow.cpp
    qmpdeviceprioritydialog.cpp
    qmpdevpropdialog.cpp
    qmpefxwindow.cpp
    qmphelpwindow.cpp
    qmpinfowindow.cpp
    qmpmainwindow.cpp
    qmpplistwindow.cpp
    qmpplugin.cpp
    qmppresetselect.cpp
    qmpsettingswindow.cpp
    qmpchanneleditor.ui
    qmpchannelswindow.ui
    qmpcustomizewindow.ui
    qmpdeviceprioritydialog.ui
    qmpdevpropdialog.ui
    qmpefxwindow.ui
    qmphelpwindow.ui
    qmpinfowindow.ui
    qmpmainwindow.ui
    qmpplistwindow.ui
    qmppresetselect.ui
    qmpsettingswindow.ui
    resources.qrc
)

if(WIN32)
    list(APPEND qmpdesktop_SOURCES qmidiplayer.rc)
endif(WIN32)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

include_directories(${fluidsynth_INCLUDE_DIRS})
include_directories(${rtmidi_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR}/include/)

cmake_host_system_information(RESULT build_host QUERY HOSTNAME)
add_definitions(-DBUILD_MACHINE=${build_host})
if(UNIX AND NOT BUILD_PORTABLE)
	add_definitions(-DNON_PORTABLE -DINSTALL_PREFIX=${CMAKE_INSTALL_PREFIX})
endif()

add_executable(qmidiplayer
    ${qmpdesktop_SOURCES}
)

target_link_libraries(qmidiplayer
    Qt5::Widgets
    qmpcore
    ${fluidsynth_LIBRARIES}
    ${rtmidi_LIBRARIES}
    ${CMAKE_THREAD_LIBS_INIT}
    ${CMAKE_DL_LIBS}
)

file(GLOB qmpdesktop_TS_FILES translations/*.ts)
qt5_create_translation(qmpdesktop_QM_FILES ${qmpdesktop_SOURCES} ${qmpdesktop_TS_FILES})
add_custom_target(translations ALL DEPENDS ${qmpdesktop_QM_FILES})

install(TARGETS qmidiplayer)

install(DIRECTORY ${PROJECT_SOURCE_DIR}/doc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/qmidiplayer)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/img DESTINATION ${CMAKE_INSTALL_PREFIX}/share/qmidiplayer FILES_MATCHING PATTERN "*.png")
install(FILES qmidiplayer.appdata.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/appdata)
install(FILES qmidiplayer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
install(FILES ${PROJECT_SOURCE_DIR}/img/qmidiplyr.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/64x64/apps)
install(FILES ${PROJECT_SOURCE_DIR}/img/qmidiplyr.svg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps)
install(FILES menu/qmidiplayer DESTINATION ${CMAKE_INSTALL_PREFIX}/share/menu)
install(FILES qmidiplayer.mime DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mime/packages)
install(FILES ${qmpdesktop_QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/qmidiplayer/translations)