Warning, /education/kig/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 project(kig VERSION ${RELEASE_SERVICE_VERSION})
0010 
0011 
0012 set (KDE5_ICON_DIR  ${CMAKE_INSTALL_PREFIX}/share/icons)
0013 
0014 find_package(ECM REQUIRED NO_MODULE)
0015 set(CMAKE_MODULE_PATH ${kig_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
0016 
0017 include(ECMAddAppIcon)
0018 include(ECMInstallIcons)
0019 include(ECMAddTests)
0020 include(KDEInstallDirs)
0021 include(KDECompilerSettings NO_POLICY_SCOPE)
0022 include(KDECMakeSettings)
0023 include(FeatureSummary)
0024 include(GenerateExportHeader)
0025 include(ECMSetupVersion)
0026 include(KDEGitCommitHooks)
0027 include(KDEClangFormat)
0028 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c)
0029 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0030 
0031 set(QT_MIN_VERSION "5.15.0")
0032 set(KF5_MIN_VERSION "5.90.0")
0033 set(KDE_COMPILERSETTINGS_LEVEL "5.82")
0034 
0035 find_package(KF5Parts ${KF5_MIN_VERSION} REQUIRED)
0036 find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED)
0037 find_package(KF5I18n ${KF5_MIN_VERSION} REQUIRED)
0038 find_package(KF5TextEditor ${KF5_MIN_VERSION} REQUIRED)
0039 find_package(KF5IconThemes ${KF5_MIN_VERSION} REQUIRED)
0040 find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} REQUIRED)
0041 find_package(KF5Archive ${KF5_MIN_VERSION} REQUIRED)
0042 find_package(KF5XmlGui ${KF5_MIN_VERSION} REQUIRED)
0043 find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
0044 find_package(KF5CoreAddons ${KF5_MIN_VERSION} REQUIRED)
0045 find_package(Qt${QT_MAJOR_VERSION}Svg ${QT_REQUIRED_VERSION} REQUIRED)
0046 find_package(Qt${QT_MAJOR_VERSION}PrintSupport ${QT_REQUIRED_VERSION}REQUIRED)
0047 find_package(Qt${QT_MAJOR_VERSION}XmlPatterns ${QT_REQUIRED_VERSION})
0048 
0049 
0050 ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KIG VERSION_HEADER kig_version.h)
0051 
0052 add_definitions (-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_KEYWORDS)
0053 include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
0054 
0055 
0056 if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
0057   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
0058 endif()
0059 
0060 include(KigConfigureChecks.cmake)
0061 
0062 find_package(BoostPython)
0063 
0064 add_subdirectory( doc )
0065 add_subdirectory( icons )
0066 add_subdirectory( kig )
0067 add_subdirectory( mimetypes )
0068 add_subdirectory( macros )
0069 add_subdirectory( data )
0070 add_subdirectory( pykig )
0071 
0072 if(BoostPython_FOUND)
0073   add_subdirectory( scripting )
0074   add_definitions(-DKIG_ENABLE_PYTHON_SCRIPTING)
0075 endif(BoostPython_FOUND)
0076 
0077 set_package_properties(
0078    BoostPython PROPERTIES
0079    DESCRIPTION "Python scripting support in Boost"
0080    URL "https://www.boost.org/"
0081    TYPE OPTIONAL
0082    PURPOSE "Kig can optionally use Boost.Python for Python scripting"
0083 )
0084 
0085 set_package_properties(
0086    Qt${QT_MAJOR_VERSION}XmlPatterns PROPERTIES
0087    DESCRIPTION "Qt${QT_MAJOR_VERSION} XmlPatterns Module"
0088    URL "https://qt.io/"
0089    TYPE OPTIONAL
0090    PURPOSE "Kig uses the XML Patterns module in Qt to support Geogebra files"
0091 )
0092 
0093 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0094 
0095 include_directories( ${CMAKE_SOURCE_DIR}/modes )
0096 if(BoostPython_FOUND)
0097   include_directories(${BoostPython_INCLUDE_DIRS})
0098 endif(BoostPython_FOUND)
0099 
0100 # kigpart
0101 
0102 set(kigpart_PART_SRCS
0103    objects/angle_type.cc
0104    objects/arc_type.cc
0105    objects/base_type.cc
0106    objects/bogus_imp.cc
0107    objects/centerofcurvature_type.cc
0108    objects/circle_imp.cc
0109    objects/circle_type.cc
0110    objects/common.cc
0111    objects/conic_imp.cc
0112    objects/conic_types.cc
0113    objects/cubic_imp.cc
0114    objects/cubic_type.cc
0115    objects/curve_imp.cc
0116    objects/intersection_types.cc
0117    objects/inversion_type.cc
0118    objects/line_imp.cc
0119    objects/line_type.cc
0120    objects/locus_imp.cc
0121    objects/object_calcer.cc
0122    objects/object_drawer.cc
0123    objects/object_factory.cc
0124    objects/object_holder.cc
0125    objects/object_imp.cc
0126    objects/object_imp_factory.cc
0127    objects/object_type.cc
0128    objects/object_type_factory.cc
0129    objects/other_imp.cc
0130    objects/other_type.cc
0131    objects/point_imp.cc
0132    objects/point_type.cc
0133    objects/polygon_imp.cc
0134    objects/polygon_type.cc
0135    objects/bezier_imp.cc
0136    objects/bezier_type.cc
0137    objects/special_imptypes.cc
0138    objects/tangent_type.cc
0139    objects/tests_type.cc
0140    objects/text_imp.cc
0141    objects/text_type.cc
0142    objects/transform_types.cc
0143    objects/vector_type.cc
0144    misc/argsparser.cpp
0145    misc/builtin_stuff.cc
0146    misc/calcpaths.cc
0147    misc/common.cpp
0148    misc/conic-common.cpp
0149    misc/coordinate.cpp
0150    misc/coordinate_system.cpp
0151    misc/cubic-common.cc
0152    misc/equationstring.cc
0153    misc/goniometry.cc
0154    misc/guiaction.cc
0155    misc/kigcoordinateprecisiondialog.cpp
0156    misc/kigfiledialog.cc
0157    misc/kiginputdialog.cc
0158    misc/kignumerics.cpp
0159    misc/kigpainter.cpp
0160    misc/kigtransform.cpp
0161    misc/lists.cc
0162    misc/object_constructor.cc
0163    misc/object_hierarchy.cc
0164    misc/rect.cc
0165    misc/screeninfo.cc
0166    misc/special_constructors.cc
0167    misc/unit.cc
0168    modes/base_mode.cc
0169    modes/construct_mode.cc
0170    modes/dragrectmode.cc
0171    modes/edittype.cc
0172    modes/historydialog.cc
0173    modes/label.cc
0174    modes/linkslabel.cpp
0175    modes/macro.cc
0176    modes/macrowizard.cc
0177    modes/mode.cc
0178    modes/moving.cc
0179    modes/normal.cc
0180    modes/popup/popup.cc
0181    modes/popup/objectchooserpopup.cc
0182    modes/popup/propertiesactionsprovider.cc
0183    modes/popup/objectchooserpopup.cc
0184    modes/popup/objecttypeactionsprovider.cc
0185    modes/popup/nameobjectactionsprovider.cc
0186    modes/popup/objectconstructoractionsprovider.cc
0187    modes/popup/builtindocumentactionsprovider.cc
0188    modes/popup/builtinobjectactionsprovider.cc
0189    modes/textlabelwizard.cc
0190    modes/typesdialog.cpp
0191    filters/asyexporter.cc
0192    filters/asyexporteroptions.cc
0193    filters/asyexporterimpvisitor.cc
0194    filters/cabri-filter.cc
0195    filters/cabri-utils.cc
0196    filters/drgeo-filter.cc
0197    filters/exporter.cc
0198    filters/filter.cc
0199    filters/filters-common.cc
0200    filters/imageexporteroptions.cc
0201    filters/kgeo-filter.cc
0202    filters/kseg-filter.cc
0203    filters/latexexporter.cc
0204    filters/latexexporteroptions.cc
0205    filters/native-filter.cc
0206    filters/pgfexporterimpvisitor.cc
0207    filters/svgexporter.cc
0208    filters/svgexporteroptions.cc
0209    filters/xfigexporter.cc
0210    kig/kig_commands.cpp
0211    kig/kig_document.cc
0212    kig/kig_part.cpp
0213    kig/kig_view.cpp
0214 
0215 
0216    objects/angle_type.h
0217    objects/arc_type.h
0218    objects/base_type.h
0219    objects/bogus_imp.h
0220    objects/centerofcurvature_type.h
0221    objects/circle_imp.h
0222    objects/circle_type.h
0223    objects/common.h
0224    objects/conic_imp.h
0225    objects/conic_types.h
0226    objects/cubic_imp.h
0227    objects/cubic_type.h
0228    objects/curve_imp.h
0229    objects/intersection_types.h
0230    objects/inversion_type.h
0231    objects/line_imp.h
0232    objects/line_type.h
0233    objects/locus_imp.h
0234    objects/object_calcer.h
0235    objects/object_drawer.h
0236    objects/object_factory.h
0237    objects/object_holder.h
0238    objects/object_imp.h
0239    objects/object_imp_factory.h
0240    objects/object_type.h
0241    objects/object_type_factory.h
0242    objects/other_imp.h
0243    objects/other_type.h
0244    objects/point_imp.h
0245    objects/point_type.h
0246    objects/polygon_imp.h
0247    objects/polygon_type.h
0248    objects/bezier_imp.h
0249    objects/bezier_type.h
0250    objects/special_imptypes.h
0251    objects/tangent_type.h
0252    objects/tests_type.h
0253    objects/text_imp.h
0254    objects/text_type.h
0255    objects/transform_types.h
0256    objects/vector_type.h
0257    misc/argsparser.h
0258    misc/builtin_stuff.h
0259    misc/calcpaths.h
0260    misc/common.h
0261    misc/conic-common.h
0262    misc/coordinate.h
0263    misc/coordinate_system.h
0264    misc/cubic-common.h
0265    misc/equationstring.h
0266    misc/goniometry.h
0267    misc/guiaction.h
0268    misc/kigcoordinateprecisiondialog.h
0269    misc/kigfiledialog.h
0270    misc/kiginputdialog.h
0271    misc/kignumerics.h
0272    misc/kigpainter.h
0273    misc/kigtransform.h
0274    misc/lists.h
0275    misc/object_constructor.h
0276    misc/object_hierarchy.h
0277    misc/rect.h
0278    misc/screeninfo.h
0279    misc/special_constructors.h
0280    misc/unit.h
0281    modes/base_mode.h
0282    modes/construct_mode.h
0283    modes/dragrectmode.h
0284    modes/edittype.h
0285    modes/historydialog.h
0286    modes/label.h
0287    modes/linkslabel.h
0288    modes/macro.h
0289    modes/macrowizard.h
0290    modes/mode.h
0291    modes/moving.h
0292    modes/normal.h
0293    modes/popup/popup.h
0294    modes/popup/objectchooserpopup.h
0295    modes/popup/propertiesactionsprovider.h
0296    modes/popup/objectchooserpopup.h
0297    modes/popup/objecttypeactionsprovider.h
0298    modes/popup/nameobjectactionsprovider.h
0299    modes/popup/objectconstructoractionsprovider.h
0300    modes/popup/builtindocumentactionsprovider.h
0301    modes/popup/builtinobjectactionsprovider.h
0302    modes/textlabelwizard.h
0303    modes/typesdialog.h
0304    filters/asyexporter.h
0305    filters/asyexporteroptions.h
0306    filters/asyexporterimpvisitor.h
0307    filters/cabri-filter.h
0308    filters/cabri-utils.h
0309    filters/drgeo-filter.h
0310    filters/exporter.h
0311    filters/filter.h
0312    filters/filters-common.h
0313    filters/imageexporteroptions.h
0314    filters/kgeo-filter.h
0315    filters/kseg-filter.h
0316    filters/latexexporter.h
0317    filters/latexexporteroptions.h
0318    filters/native-filter.h
0319    filters/pgfexporterimpvisitor.h
0320    filters/svgexporter.h
0321    filters/svgexporteroptions.h
0322    filters/xfigexporter.h
0323    kig/kig_commands.h
0324    kig/kig_document.h
0325    kig/kig_part.h
0326    kig/kig_view.h
0327 )
0328 
0329 if (Qt${QT_MAJOR_VERSION}XmlPatterns_FOUND)
0330   set(kigpart_PART_SRCS ${kigpart_PART_SRCS}
0331   geogebra/geogebratransformer.cpp
0332   geogebra/geogebrasection.cpp
0333   filters/geogebra-filter.cpp)
0334   qt_add_resources(kigpart_PART_SRCS ${CMAKE_SOURCE_DIR}/geogebra/geogebra.qrc)
0335   add_definitions(-DWITH_GEOGEBRA=1)
0336 endif()
0337 
0338 ki18n_wrap_ui(kigpart_PART_SRCS
0339    modes/typeswidget.ui
0340    modes/edittypewidget.ui
0341    modes/historywidget.ui
0342    filters/asyexporteroptionswidget.ui
0343    filters/imageexporteroptionswidget.ui
0344    filters/latexexporteroptionswidget.ui
0345    filters/svgexporteroptionswidget.ui
0346    misc/kigcoordinateprecisiondialog.ui
0347 )
0348 
0349 if(BoostPython_FOUND)
0350   set(kigpart_PART_SRCS ${kigpart_PART_SRCS}
0351      modes/popup/scriptactionsprovider.cc
0352      scripting/newscriptwizard.cc
0353      scripting/python_scripter.cc
0354      scripting/python_type.cc
0355      scripting/script-common.cc
0356      scripting/script_mode.cc
0357   )
0358 
0359   kde_source_files_enable_exceptions(scripting/python_scripter.cc)
0360 endif(BoostPython_FOUND)
0361 
0362 
0363 add_library(kigpart MODULE ${kigpart_PART_SRCS})
0364 generate_export_header(kigpart)
0365 
0366 kcoreaddons_desktop_to_json(kigpart kig/kig_part.desktop)
0367 
0368 target_link_libraries(kigpart
0369   Qt::Gui
0370   Qt::Svg
0371   Qt::PrintSupport
0372   KF5::Crash
0373   KF5::Parts
0374   KF5::I18n
0375   KF5::TextEditor
0376   KF5::IconThemes
0377   KF5::ConfigWidgets
0378   KF5::Archive
0379 )
0380 
0381 if(BoostPython_FOUND)
0382   target_link_libraries(kigpart ${BoostPython_LIBRARIES} ${KDE5_KTEXTEDITOR_LIBS})
0383 endif(BoostPython_FOUND)
0384 
0385 if (Qt${QT_MAJOR_VERSION}XmlPatterns_FOUND)
0386   target_link_libraries(kigpart Qt::XmlPatterns)
0387 endif(Qt${QT_MAJOR_VERSION}XmlPatterns_FOUND)
0388 
0389 ki18n_install(po)
0390 if (KF5DocTools_FOUND)
0391     kdoctools_install(po)
0392 endif()
0393 install(TARGETS kigpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/parts)
0394 install(FILES org.kde.kig.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0395 
0396 # unit tests
0397 if (BUILD_TESTING)
0398   add_subdirectory(tests)
0399 endif ()
0400 
0401 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)