Warning, /education/kalzium/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 "22")
0005 set(RELEASE_SERVICE_VERSION_MINOR "11")
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(kalzium VERSION ${RELEASE_SERVICE_VERSION})
0010 
0011 set(QT_MIN_VERSION "5.15.2")
0012 set(KF5_MIN_VERSION "5.90.0")
0013 set(KDE_COMPILERSETTINGS_LEVEL "5.82")
0014 
0015 set(CMAKE_CXX_STANDARD 17)
0016 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0017 
0018 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
0019 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${kalzium_SOURCE_DIR}/cmake/modules)
0020 
0021 include(KDEInstallDirs)
0022 include(KDECompilerSettings NO_POLICY_SCOPE)
0023 include(KDECMakeSettings)
0024 include(FeatureSummary)
0025 include(ECMInstallIcons)
0026 include(ECMMarkNonGuiExecutable)
0027 include(CheckIncludeFiles)
0028 include(ECMSetupVersion)
0029 include(ECMQtDeclareLoggingCategory)
0030 include(GenerateExportHeader)
0031 include(KDEGitCommitHooks)
0032 include(KDEClangFormat)
0033 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c)
0034 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0035 
0036 
0037 find_package(Gettext REQUIRED)
0038 find_package(PythonInterp REQUIRED)
0039 find_package(PkgConfig)
0040 find_package(OpenBabel3 3.1)
0041 if(NOT ${OpenBabel3_FOUND})
0042     find_package(OpenBabel2)
0043 endif()
0044 find_package(AvogadroLibs)
0045 find_package(Eigen3 CONFIG)
0046 find_package(OCaml)
0047 find_package(Libfacile)
0048 
0049 pkg_check_modules(CHEMICAL_MIME_DATA chemical-mime-data)
0050 check_include_files(ieeefp.h HAVE_IEEEFP_H)
0051 
0052 # create configuration file
0053 set(HAVE_FACILE ${LIBFACILE_FOUND})
0054 set(HAVE_OPENBABEL3 ${OpenBabel3_FOUND})
0055 set(HAVE_OPENBABEL2 ${OPENBABEL2_FOUND})
0056 if(HAVE_OPENBABEL2 OR HAVE_OPENBABEL3)
0057     set(HAVE_OPENBABEL 1)
0058 endif()
0059 set(HAVE_EIGEN ${EIGEN3_FOUND})
0060 set(HAVE_AVOGADRO ${AvogadroLibs_FOUND})
0061 
0062 if(HAVE_OPENBABEL3)
0063     set(OPENBABEL_INCLUDE_DIR ${OpenBabel3_INCLUDE_DIRS})
0064     set(OPENBABEL_LIBRARIES ${OpenBabel3_LIBRARIES})
0065 elseif(HAVE_OPENBABEL2)
0066     set(OPENBABEL_INCLUDE_DIR ${OPENBABEL2_INCLUDE_DIR})
0067     set(OPENBABEL_LIBRARIES ${OPENBABEL2_LIBRARIES})
0068 endif()
0069 
0070 configure_file(
0071    ${CMAKE_CURRENT_SOURCE_DIR}/config-kalzium.h.cmake
0072    ${CMAKE_CURRENT_BINARY_DIR}/config-kalzium.h
0073 )
0074 
0075 include_directories(${AvogadroLibs_INCLUDE_DIRS})
0076 
0077 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS
0078     Core
0079     Gui
0080     Svg
0081     Widgets
0082     Xml
0083 )
0084 
0085 
0086 if (QT_MAJOR_VERSION STREQUAL "6")
0087     find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Core5Compat StateMachine)
0088 else()
0089     find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Script)
0090 endif()
0091 
0092 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
0093     Archive
0094     Config
0095     CoreAddons
0096     DocTools
0097     I18n
0098     Parts
0099     Plotting
0100     UnitConversion
0101     WidgetsAddons
0102 )
0103 
0104 ecm_setup_version("5.0.0"
0105     VARIABLE_PREFIX KALZIUMLIB
0106 )
0107 
0108 add_definitions(
0109     -DQT_NO_URL_CAST_FROM_STRING
0110 )
0111 if(MSVC)
0112 # for correctly linking openbabel:
0113 # see https://www.mail-archive.com/openbabel-devel@lists.sourceforge.net/msg01975.html
0114 add_definitions(-DUSING_DYNAMIC_LIBS)
0115 endif(MSVC)
0116 
0117 if (HAVE_OPENBABEL AND AvogadroLibs_FOUND AND EIGEN3_FOUND)
0118   find_package(Qt5OpenGL ${QT_MIN_VERSION} REQUIRED)
0119   find_package(KF5NewStuff REQUIRED)
0120   # avoid compilerwarnings about redefinitions
0121   # todo: use check_function_exits() ?
0122   message(STATUS "Kalzium molecular editor enabled")
0123   if (WIN32)
0124     add_definitions(-DHAVE_SNPRINTF -DHAVE_STRCASECMP -DHAVE_STRNCASECMP)
0125   endif (WIN32)
0126   add_subdirectory(compoundviewer)
0127 else (HAVE_OPENBABEL AND AvogadroLibs_FOUND AND EIGEN3_FOUND)
0128   message(STATUS "Kalzium molecular editor disabled")
0129 endif (HAVE_OPENBABEL AND AvogadroLibs_FOUND AND EIGEN3_FOUND)
0130 
0131 add_subdirectory(doc)
0132 add_subdirectory(src)
0133 add_subdirectory(data)
0134 add_subdirectory(libscience)
0135 
0136 ki18n_install(po)
0137 if (KF5DocTools_FOUND)
0138     kdoctools_install(po)
0139 endif()
0140 install(FILES org.kde.kalzium.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0141 
0142 ecm_qt_install_logging_categories(
0143         EXPORT KALZIUM
0144         FILE kalzium.categories
0145         DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
0146         )
0147 
0148 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)