CMakeLists: Set CMAKE_AUTOMOC

This allows the build system to automatically invoke moc for us when
building the GUI. Now we don't need to manually keep track of which
files need to be wrapped, simplifying the CMake file a little bit more.
This commit is contained in:
Lioncash 2019-08-25 18:09:10 -04:00
parent 07b4f02d1d
commit f140972920
1 changed files with 3 additions and 20 deletions

View File

@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.10)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Automatically handle invoking moc
set(CMAKE_AUTOMOC ON)
find_package(Qt5 COMPONENTS LinguistTools Network Qml Svg Widgets Xml REQUIRED) find_package(Qt5 COMPONENTS LinguistTools Network Qml Svg Widgets Xml REQUIRED)
configure_file(resources/translation_res.qrc translation_res.qrc @ONLY) configure_file(resources/translation_res.qrc translation_res.qrc @ONLY)
@ -15,25 +18,6 @@ QT5_ADD_RESOURCES(qrc_translation_res.cpp ${CMAKE_CURRENT_BINARY_DIR}/translatio
QT5_WRAP_UI(MAIN_WINDOW_UI MainWindow.ui) QT5_WRAP_UI(MAIN_WINDOW_UI MainWindow.ui)
QT5_WRAP_CPP(AMUSE_MOC
ADSREditor.hpp
Common.hpp
CurveEditor.hpp
EditorWidget.hpp
LayersEditor.hpp
MainWindow.hpp
NewSoundMacroDialog.hpp
KeyboardWidget.hpp
KeymapEditor.hpp
ProjectModel.hpp
SampleEditor.hpp
SongGroupEditor.hpp
SoundGroupEditor.hpp
SoundMacroEditor.hpp
StatusBarWidget.hpp
StudioSetupWidget.hpp
)
add_executable(amuse-gui WIN32 MACOSX_BUNDLE add_executable(amuse-gui WIN32 MACOSX_BUNDLE
ADSREditor.cpp ADSREditor.cpp
ADSREditor.hpp ADSREditor.hpp
@ -76,7 +60,6 @@ add_executable(amuse-gui WIN32 MACOSX_BUNDLE
qrc_translation_res.cpp qrc_translation_res.cpp
resources/resources.qrc resources/resources.qrc
${AMUSE_MOC}
${MAIN_WINDOW_UI} ${MAIN_WINDOW_UI}
${QM_FILES} ${QM_FILES}
) )