2018-03-15 00:25:29 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
|
|
|
|
2019-08-25 22:27:40 +00:00
|
|
|
# Automatically handle invoking autorcc, moc, and uic.
|
2019-08-25 22:09:10 +00:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
2019-08-25 22:27:40 +00:00
|
|
|
set(CMAKE_AUTORCC ON)
|
2019-08-25 22:13:21 +00:00
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
|
2019-08-25 22:27:40 +00:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
2021-01-24 00:27:34 +00:00
|
|
|
find_package(Qt6 COMPONENTS LinguistTools Network Qml SvgWidgets Widgets Xml REQUIRED)
|
2018-03-15 00:25:29 +00:00
|
|
|
|
2018-07-25 06:01:01 +00:00
|
|
|
configure_file(resources/translation_res.qrc translation_res.qrc @ONLY)
|
|
|
|
set(TRANSLATIONS
|
2019-08-25 22:04:47 +00:00
|
|
|
resources/lang_de.ts
|
|
|
|
)
|
2021-01-24 00:27:34 +00:00
|
|
|
QT6_CREATE_TRANSLATION(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../lib ${TRANSLATIONS})
|
2018-07-25 06:01:01 +00:00
|
|
|
|
2018-03-15 00:25:29 +00:00
|
|
|
add_executable(amuse-gui WIN32 MACOSX_BUNDLE
|
2019-08-25 22:01:04 +00:00
|
|
|
ADSREditor.cpp
|
|
|
|
ADSREditor.hpp
|
|
|
|
Common.cpp
|
|
|
|
Common.hpp
|
|
|
|
CurveEditor.cpp
|
|
|
|
CurveEditor.hpp
|
|
|
|
EditorWidget.cpp
|
|
|
|
EditorWidget.hpp
|
|
|
|
KeyboardWidget.cpp
|
|
|
|
KeyboardWidget.hpp
|
|
|
|
KeymapEditor.cpp
|
|
|
|
KeymapEditor.hpp
|
|
|
|
LayersEditor.cpp
|
|
|
|
LayersEditor.hpp
|
|
|
|
MainWindow.cpp
|
|
|
|
MainWindow.hpp
|
|
|
|
MainWindow.ui
|
|
|
|
MIDIReader.cpp
|
|
|
|
MIDIReader.hpp
|
|
|
|
NewSoundMacroDialog.cpp
|
|
|
|
NewSoundMacroDialog.hpp
|
|
|
|
ProjectModel.cpp
|
|
|
|
ProjectModel.hpp
|
|
|
|
SampleEditor.cpp
|
|
|
|
SampleEditor.hpp
|
|
|
|
SongGroupEditor.cpp
|
|
|
|
SongGroupEditor.hpp
|
|
|
|
SoundGroupEditor.cpp
|
|
|
|
SoundGroupEditor.hpp
|
|
|
|
SoundMacroEditor.cpp
|
|
|
|
SoundMacroEditor.hpp
|
|
|
|
StatusBarWidget.cpp
|
|
|
|
StatusBarWidget.hpp
|
|
|
|
StudioSetupWidget.cpp
|
|
|
|
StudioSetupWidget.hpp
|
|
|
|
|
|
|
|
main.cpp
|
2019-08-25 22:13:21 +00:00
|
|
|
|
2019-08-25 22:01:04 +00:00
|
|
|
resources/resources.qrc
|
2019-08-25 22:27:40 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/translation_res.qrc
|
2019-08-25 22:01:04 +00:00
|
|
|
|
|
|
|
${QM_FILES}
|
|
|
|
)
|
2019-08-25 22:04:47 +00:00
|
|
|
|
2019-08-26 01:37:48 +00:00
|
|
|
target_compile_definitions(amuse-gui PRIVATE
|
2019-08-26 02:52:24 +00:00
|
|
|
# Disable implicit conversions from ASCII to QString.
|
|
|
|
-DQT_NO_CAST_FROM_ASCII
|
|
|
|
-DQT_NO_CAST_TO_ASCII
|
|
|
|
|
2019-08-26 03:05:19 +00:00
|
|
|
# Disable implicit conversions of QByteArray to const char* or const void*
|
|
|
|
-DQT_NO_CAST_FROM_BYTEARRAY
|
|
|
|
|
2019-08-26 02:16:30 +00:00
|
|
|
# Disable narrowing conversions in signal/slot connect() calls.
|
|
|
|
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
|
|
|
|
|
2019-08-26 02:59:44 +00:00
|
|
|
# Disable unsafe overloads of QProcess' start() function.
|
|
|
|
-DQT_NO_PROCESS_COMBINED_ARGUMENT_START
|
|
|
|
|
2019-08-26 02:56:46 +00:00
|
|
|
# Disable implicit QString->QUrl conversions to enforce use of proper resolving functions.
|
|
|
|
-DQT_NO_URL_CAST_FROM_STRING
|
|
|
|
|
2019-08-26 01:37:48 +00:00
|
|
|
# Allows for more efficient string concatenation, resulting in less temporaries.
|
|
|
|
-DQT_USE_QSTRINGBUILDER
|
|
|
|
)
|
|
|
|
|
2019-09-11 00:40:24 +00:00
|
|
|
if (MSVC)
|
|
|
|
target_compile_options(amuse-gui PRIVATE
|
|
|
|
# Enforce various standards compliant behavior.
|
2020-04-11 04:59:16 +00:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/permissive->
|
2019-09-11 00:40:24 +00:00
|
|
|
|
|
|
|
# Enable standard volatile semantics.
|
2020-04-11 04:59:16 +00:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/volatile:iso>
|
2019-09-11 00:40:24 +00:00
|
|
|
|
|
|
|
# Reports the proper value for the __cplusplus preprocessor macro.
|
2020-04-11 04:59:16 +00:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>
|
2019-09-11 00:40:24 +00:00
|
|
|
|
2020-04-11 04:59:16 +00:00
|
|
|
# Use latest C++ standard.
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
|
2019-09-11 00:40:24 +00:00
|
|
|
)
|
2020-04-11 04:59:16 +00:00
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
|
|
# Flags for MSVC (not clang-cl)
|
|
|
|
target_compile_options(amuse-gui PRIVATE
|
|
|
|
# Allow constexpr variables to have explicit external linkage.
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>
|
|
|
|
|
|
|
|
# Assume that new throws exceptions, allowing better code generation.
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew>
|
|
|
|
)
|
|
|
|
endif()
|
2019-09-11 00:40:24 +00:00
|
|
|
endif()
|
|
|
|
|
2019-08-25 22:04:47 +00:00
|
|
|
if(WIN32)
|
|
|
|
target_sources(amuse-gui PRIVATE
|
|
|
|
platforms/win/amuse-gui.rc
|
|
|
|
platforms/win/amuse-gui.manifest
|
|
|
|
)
|
|
|
|
elseif(APPLE)
|
|
|
|
target_sources(amuse-gui PRIVATE
|
|
|
|
MacOSExtras.mm
|
|
|
|
platforms/mac/mainicon.icns
|
|
|
|
)
|
|
|
|
set_source_files_properties(platforms/mac/mainicon.icns PROPERTIES
|
|
|
|
MACOSX_PACKAGE_LOCATION Resources
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_subdirectory(platforms/freedesktop)
|
|
|
|
declare_qticon_target()
|
|
|
|
target_sources(amuse-gui PRIVATE mainicon_qt.cpp)
|
|
|
|
|
2018-07-14 06:06:33 +00:00
|
|
|
if(COMMAND add_sanitizers)
|
|
|
|
add_sanitizers(amuse-gui)
|
|
|
|
endif()
|
2018-03-15 00:25:29 +00:00
|
|
|
|
|
|
|
set_target_properties(amuse-gui PROPERTIES
|
2019-08-25 08:55:33 +00:00
|
|
|
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/platforms/mac/Info.plist"
|
|
|
|
)
|
2018-03-15 00:25:29 +00:00
|
|
|
|
2019-08-25 08:55:33 +00:00
|
|
|
target_link_libraries(amuse-gui
|
|
|
|
${PLAT_LIBS}
|
|
|
|
|
2021-01-24 00:27:34 +00:00
|
|
|
Qt6::Network
|
|
|
|
Qt6::Qml
|
|
|
|
Qt6::SvgWidgets
|
|
|
|
Qt6::Widgets
|
|
|
|
Qt6::Xml
|
2019-08-25 08:55:33 +00:00
|
|
|
|
|
|
|
amuse
|
|
|
|
athena-core
|
|
|
|
boo
|
|
|
|
${BOO_SYS_LIBS}
|
|
|
|
logvisor
|
|
|
|
lzokay
|
|
|
|
xxhash
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
)
|