Warning, /education/kiten/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required( VERSION 3.16 )
0002 
0003 # KDE Application Version, managed by release script
0004 set(RELEASE_SERVICE_VERSION_MAJOR "23")
0005 set(RELEASE_SERVICE_VERSION_MINOR "03")
0006 set(RELEASE_SERVICE_VERSION_MICRO "70")
0007 set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0008 
0009 #Name the project
0010 project(kiten VERSION ${RELEASE_SERVICE_VERSION})
0011 
0012 #ECM setup
0013 set(KF5_MIN_VERSION "5.90.0")
0014 set(KDE_COMPILERSETTINGS_LEVEL "5.82")
0015 set(QT_REQUIRED_VERSION "5.15.0")
0016 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
0017 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0018 include(KDEInstallDirs)
0019 include(KDECompilerSettings NO_POLICY_SCOPE)
0020 include(KDECMakeSettings)
0021 include(ECMInstallIcons)
0022 include(CheckIncludeFiles)
0023 include(ECMGenerateHeaders)
0024 include(ECMAddAppIcon)
0025 include(ECMMarkNonGuiExecutable)
0026 include(GenerateExportHeader)
0027 include(ECMSetupVersion)
0028 include(KDEClangFormat)
0029 include(KDEGitCommitHooks)
0030 
0031 find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} REQUIRED COMPONENTS Core Widgets)
0032 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
0033     Archive
0034     Completion
0035     Config
0036     ConfigWidgets
0037     CoreAddons
0038     Crash
0039     DocTools
0040     I18n
0041     KIO
0042     Notifications
0043     XmlGui)
0044 if (QT_MAJOR_VERSION STREQUAL "6")
0045     find_package(Qt6Core5Compat)
0046 endif()
0047 
0048 ## Make it easy for radselect and kiten to find libkiten headers
0049 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib)
0050 include_directories(${CMAKE_CURRENT_BINARY_DIR})
0051 
0052 ## Find mman.h on Windows
0053 if(WIN32)
0054     find_path(MMAN_INCLUDE_PATH NAMES sys/mman.h)
0055     if(NOT MMAN_INCLUDE_PATH)
0056         message(FATAL_ERROR "On Windows, you need to install mman-win32 headers.")
0057     endif()
0058     message(STATUS "Found mman-win32 include: ${MMAN_INCLUDE_PATH}")
0059 
0060     find_library(MMAN_LIBRARY NAMES mman)
0061     if(NOT MMAN_LIBRARY)
0062         message(FATAL_ERROR "On Windows, you need to install mman-win32 library.")
0063     endif()
0064     message(STATUS "Found mman-win32 library: ${MMAN_LIBRARY}")
0065 endif(WIN32)
0066 
0067 ## Generate config.h
0068 check_include_files(stdint.h HAVE_STDINT_H)
0069 check_include_files(inttypes.h HAVE_INTTYPES_H)
0070 configure_file( config-kiten.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kiten.h )
0071 
0072 add_definitions(-DTRANSLATION_DOMAIN=\"kiten\")
0073 
0074 
0075 
0076 ## Build each subdir
0077 add_subdirectory( app )
0078 add_subdirectory( data/font )
0079 add_subdirectory( data/pics )
0080 add_subdirectory( doc )
0081 add_subdirectory( kanjibrowser )
0082 add_subdirectory( lib )
0083 add_subdirectory( radselect )
0084 
0085 ## Build kitengen, a small index generator used by the kiten app
0086 set(kitengen_SRCS xjdxgen.c)
0087 add_executable(kitengen ${kitengen_SRCS})
0088 ecm_mark_nongui_executable(kitengen)
0089 target_link_libraries(kitengen Qt::Core)
0090 install( TARGETS kitengen ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
0091 install(FILES org.kde.kiten.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0092 ki18n_install(po)
0093 if (KF5DocTools_FOUND)
0094     kdoctools_install(po)
0095 endif()
0096 
0097 ## Install our datafiles
0098 install( FILES data/edict data/kanjidic data/radkfile data/vconj data/romkana.cnv DESTINATION ${KDE_INSTALL_DATADIR}/kiten )
0099 
0100 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0101 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0102 
0103 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0104 
0105 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)