diff options
| author | 2022-04-29 10:48:09 +0200 | |
|---|---|---|
| committer | 2022-04-29 10:48:09 +0200 | |
| commit | 07c5f6ec23fcf9237a24e71adcfacabce677f818 (patch) | |
| tree | 588e8c5f82b9163181fad3581f610e6f1d88cba4 /src/bin/mobile/CMakeLists.txt | |
| parent | a9153f1615a842cfb9e9bcda4d9071e202618569 (diff) | |
| download | OneRoll-07c5f6ec23fcf9237a24e71adcfacabce677f818.tar.gz OneRoll-07c5f6ec23fcf9237a24e71adcfacabce677f818.zip | |
Change file organization.
Diffstat (limited to 'src/bin/mobile/CMakeLists.txt')
| -rw-r--r-- | src/bin/mobile/CMakeLists.txt | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/src/bin/mobile/CMakeLists.txt b/src/bin/mobile/CMakeLists.txt new file mode 100644 index 0000000..ddc0543 --- /dev/null +++ b/src/bin/mobile/CMakeLists.txt @@ -0,0 +1,109 @@ +cmake_minimum_required(VERSION 3.16) + +option(UPDATE_TRANSLATIONS "update Translation" OFF) +MESSAGE(STATUS "UPDATE TRANSLATIONS: ${UPDATE_TRANSLATIONS}") + + +project(diceGui) + + +# Find includes in corresponding build directories +set(CMAKE_INCLUDE_CURRENT_DIR ON) +# Instruct CMake to run moc automatically when needed. +set(CMAKE_AUTOMOC ON) + +# Find the QtWidgets library +find_package(Qt6 COMPONENTS Quick Qml Core Widgets Gui) +#find_package(Qt6QuickCompiler) + +set(EXECUTABLE_OUTPUT_PATH bin/) + +include_directories(${Qt5Core_INCLUDES} ${Qt5Widgets_INCLUDES} ${Qt5Gui_INCLUDES} ${Qt5Qml_INCLUDES} ${Qt5Quick_INCLUDES}../) +add_definitions(${Qt5Core_DEFINITIONS} ${Qt5Qml_DEFINITIONS} ${Qt5Quick_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ) + +ADD_DEFINITIONS( + -std=c++11 +) + +set(diceGui_RESOURCES diceparser.qrc) +FIND_PACKAGE(Qt6LinguistTools) + + +IF(UPDATE_TRANSLATIONS) + MESSAGE( update Translation ) + FILE(GLOB_RECURSE translate_diceGui_SRCS ../*.cpp ../*.h) + SET(translate_SRCS ${translate_dice_SRCS}) + SET(diceGui_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/diceGui_en.ts" "${CMAKE_CURRENT_SOURCE_DIR}/i18n/diceGui_fr.ts") +ELSE() + MESSAGE( NO updates for translations) + FILE(GLOB diceGui_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/*.ts") +ENDIF(UPDATE_TRANSLATIONS) + +if(Qt5Core_FOUND) + + IF(UPDATE_TRANSLATIONS) + MESSAGE(status "find" ${diceGui_TS} ${translate_SRCS} ) + QT5_CREATE_TRANSLATION(diceGui_QM ${translate_SRCS} ${diceGui_TS}) + ELSE() + QT5_ADD_TRANSLATION(diceGui_QM ${diceGui_TS}) + ENDIF() + + QT5_ADD_RESOURCES(diceGui_RESOURCES_RCC ${diceGui_RESOURCES}) + + # guess plugins and libraries directory + set(QT_PLUGINS_DIR "${Qt5Core_DIR}/../../../plugins") + get_target_property(QT_LIBRARY_DIR Qt6::Core LOCATION) + get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH) +endif() + +SET( diceGui_sources + ../diceparser.cpp + ../range.cpp + ../booleancondition.cpp + ../validator.cpp + ../compositevalidator.cpp + ../operationcondition.cpp + ../die.cpp + ../parsingtoolbox.cpp + ../dicealias.cpp + ../result/result.cpp + ../result/scalarresult.cpp + ../result/stringresult.cpp + ../result/diceresult.cpp + ../node/countexecutenode.cpp + ../node/dicerollernode.cpp + ../node/executionnode.cpp + ../node/explodedicenode.cpp + ../node/helpnode.cpp + ../node/mergenode.cpp + ../node/jumpbackwardnode.cpp + ../node/keepdiceexecnode.cpp + ../node/listaliasnode.cpp + ../node/listsetrollnode.cpp + ../node/numbernode.cpp + ../node/parenthesesnode.cpp + ../node/paintnode.cpp + ../node/rerolldicenode.cpp + ../node/scalaroperatornode.cpp + ../node/sortresult.cpp + ../node/startingnode.cpp + ../node/ifnode.cpp + ../node/filternode.cpp + ../node/stringnode.cpp + ../node/splitnode.cpp + ../node/groupnode.cpp + ../node/variablenode.cpp + ../node/bind.cpp + main.cpp + maincontroller.cpp + commandmodel.cpp + ../highlightdice.cpp +) +qt5_add_resources(RESOURCE_ADDED mobile.qrc) + +add_executable( diceGui ${diceGui_sources} ${diceGui_QM} ${RESOURCE_ADDED} ) + +target_link_libraries(diceGui ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Qml_LIBRARIES} ${Qt5Quick_LIBRARIES}) +INSTALL_TARGETS(/bin diceGui) + +#qt5_use_modules() |