Warning, /rolisteam/rolisteam-diceparser/src/bin/cli/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 cmake_minimum_required(VERSION 3.16) 0002 #project(dice) 0003 0004 option(UPDATE_TRANSLATIONS "update Translation" OFF) 0005 option(NO_PAINTER_OPERATOR "No PAINTING" OFF) 0006 MESSAGE(STATUS "UPDATE TRANSLATIONS: ${UPDATE_TRANSLATIONS}") 0007 0008 0009 # Find includes in corresponding build directories 0010 set(CMAKE_INCLUDE_CURRENT_DIR ON) 0011 # Instruct CMake to run moc automatically when needed. 0012 set(CMAKE_AUTOMOC ON) 0013 set(EXECUTABLE_OUTPUT_PATH bin/) 0014 0015 # Find the QtWidgets library 0016 set(QT_REQUIRED_VERSION "6.2.0") 0017 0018 IF(NO_PAINTER_OPERATOR) 0019 find_package(Qt6 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core Svg LinguistTools) 0020 else() 0021 MESSAGE(STATUS "Compilation of operator Paint") 0022 find_package(Qt6 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Svg LinguistTools) 0023 add_definitions(-DPAINTER_OP) 0024 endif() 0025 0026 set(MODE "cli") 0027 0028 set(dice_RESOURCES diceparser.qrc) 0029 find_package(Qt6LinguistTools) 0030 find_package(Qt6Svg) 0031 0032 IF(UPDATE_TRANSLATIONS) 0033 MESSAGE( update Translation ) 0034 FILE(GLOB_RECURSE translate_dice_SRCS ../*.cpp ../*.h) 0035 SET(translate_SRCS ${translate_dice_SRCS}) 0036 SET(dice_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/dice_en.ts" "${CMAKE_CURRENT_SOURCE_DIR}/i18n/dice_fr.ts") 0037 ELSE() 0038 MESSAGE( NO updates for translations) 0039 FILE(GLOB dice_TS "${CMAKE_CURRENT_SOURCE_DIR}/i18n/*.ts") 0040 ENDIF(UPDATE_TRANSLATIONS) 0041 0042 if(Qt6Core_FOUND) 0043 MESSAGE(status "find" ${dice_TS} ${translate_SRCS} ) 0044 QT_ADD_RESOURCES(dice_RESOURCES_RCC ${dice_RESOURCES}) 0045 set(QT_PLUGINS_DIR "${Qt6Core_DIR}/../../../plugins") 0046 get_target_property(QT_LIBRARY_DIR Qt6::Core LOCATION) 0047 get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH) 0048 endif() 0049 0050 SET( cli_sources 0051 main.cpp 0052 displaytoolbox.cpp 0053 ) 0054 0055 add_executable( dice ${cli_sources} ${dice_QM}) 0056 set(diceparser_shared_INCLUDE_DIRS "../diceparser") 0057 link_directories(BEFORE ${CMAKE_BINARY_DIR}) 0058 IF(NO_PAINTER_OPERATOR) 0059 target_link_libraries(dice PUBLIC Qt6::Core Qt6::Svg PRIVATE diceparser_shared) 0060 ELSE() 0061 target_link_libraries(dice PUBLIC Qt6::Core Qt6::Gui Qt6::Svg PRIVATE diceparser_shared) 0062 ENDIF() 0063 0064 include(install_helper OPTIONAL RESULT_VARIABLE installFound) 0065 0066 0067 if(installFound STREQUAL "NOTFOUND") 0068 install(TARGETS dice RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 0069 else() 0070 set(CPACK_OUTPUT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CPackConfigDice.cmake") 0071 rinstallRT(dice diceComp) 0072 endif()