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 "24") 0005 set(RELEASE_SERVICE_VERSION_MINOR "01") 0006 set(RELEASE_SERVICE_VERSION_MICRO "95") 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.92.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(ECMAddAppIcon) 0029 include(ECMSetupVersion) 0030 include(ECMQtDeclareLoggingCategory) 0031 include(GenerateExportHeader) 0032 include(KDEGitCommitHooks) 0033 include(KDEClangFormat) 0034 include(ECMDeprecationSettings) 0035 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c) 0036 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) 0037 0038 0039 find_package(Gettext REQUIRED) 0040 find_package(PkgConfig) 0041 find_package(OpenBabel3 3.1) 0042 if(NOT ${OpenBabel3_FOUND}) 0043 find_package(OpenBabel2) 0044 endif() 0045 if (QT_MAJOR_VERSION STREQUAL "5") 0046 find_package(AvogadroLibs) 0047 endif() 0048 find_package(Eigen3 CONFIG) 0049 find_package(OCaml) 0050 find_package(Libfacile) 0051 0052 pkg_check_modules(CHEMICAL_MIME_DATA chemical-mime-data) 0053 check_include_files(ieeefp.h HAVE_IEEEFP_H) 0054 0055 # create configuration file 0056 set(HAVE_FACILE ${LIBFACILE_FOUND}) 0057 set(HAVE_OPENBABEL3 ${OpenBabel3_FOUND}) 0058 set(HAVE_OPENBABEL2 ${OPENBABEL2_FOUND}) 0059 if(HAVE_OPENBABEL2 OR HAVE_OPENBABEL3) 0060 set(HAVE_OPENBABEL 1) 0061 endif() 0062 set(HAVE_EIGEN ${EIGEN3_FOUND}) 0063 if (QT_MAJOR_VERSION STREQUAL "6") 0064 set(HAVE_AVOGADRO FALSE) 0065 else() 0066 set(HAVE_AVOGADRO ${AvogadroLibs_FOUND}) 0067 endif() 0068 0069 if(HAVE_OPENBABEL3) 0070 set(OPENBABEL_INCLUDE_DIR ${OpenBabel3_INCLUDE_DIRS}) 0071 set(OPENBABEL_LIBRARIES ${OpenBabel3_LIBRARIES}) 0072 elseif(HAVE_OPENBABEL2) 0073 set(OPENBABEL_INCLUDE_DIR ${OPENBABEL2_INCLUDE_DIR}) 0074 set(OPENBABEL_LIBRARIES ${OPENBABEL2_LIBRARIES}) 0075 endif() 0076 0077 configure_file( 0078 ${CMAKE_CURRENT_SOURCE_DIR}/config-kalzium.h.in 0079 ${CMAKE_CURRENT_BINARY_DIR}/config-kalzium.h 0080 ) 0081 0082 include_directories(${AvogadroLibs_INCLUDE_DIRS}) 0083 0084 if (QT_MAJOR_VERSION STREQUAL "6") 0085 set(QT_REQUIRED_VERSION "6.4.0") 0086 set(KF_MIN_VERSION "5.240.0") 0087 set(KF_MAJOR_VERSION "6") 0088 else() 0089 set(KF_MAJOR_VERSION "5") 0090 endif() 0091 0092 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS 0093 Core 0094 Gui 0095 Svg 0096 Widgets 0097 Xml 0098 ) 0099 0100 if (QT_MAJOR_VERSION STREQUAL "6") 0101 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Core5Compat StateMachine) 0102 else() 0103 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Script) 0104 endif() 0105 0106 find_package(KF${KF_MAJOR_VERSION} ${KF5_MIN_VERSION} REQUIRED COMPONENTS 0107 Archive 0108 Config 0109 ConfigWidgets 0110 CoreAddons 0111 DocTools 0112 I18n 0113 ItemViews 0114 KIO 0115 Plotting 0116 UnitConversion 0117 WidgetsAddons 0118 TextWidgets 0119 XmlGui 0120 ) 0121 0122 ecm_setup_version("5.0.0" 0123 VARIABLE_PREFIX KALZIUMLIB 0124 ) 0125 0126 add_definitions( 0127 -DQT_NO_URL_CAST_FROM_STRING 0128 ) 0129 if(MSVC) 0130 # for correctly linking openbabel: 0131 # see https://www.mail-archive.com/openbabel-devel@lists.sourceforge.net/msg01975.html 0132 add_definitions(-DUSING_DYNAMIC_LIBS) 0133 endif() 0134 0135 ecm_set_disabled_deprecation_versions(QT 5.14.0 0136 KF 5.101 0137 ) 0138 0139 0140 if (HAVE_OPENBABEL AND AvogadroLibs_FOUND AND EIGEN3_FOUND) 0141 find_package(Qt${QT_MAJOR_VERSION}OpenGL ${QT_MIN_VERSION} REQUIRED) 0142 find_package(KF${KF_MAJOR_VERSION}NewStuff ${KF5_MIN_VERSION} REQUIRED) 0143 # avoid compilerwarnings about redefinitions 0144 # todo: use check_function_exits() ? 0145 message(STATUS "Kalzium molecular editor enabled") 0146 if (WIN32) 0147 add_definitions(-DHAVE_SNPRINTF -DHAVE_STRCASECMP -DHAVE_STRNCASECMP) 0148 endif () 0149 add_subdirectory(compoundviewer) 0150 else () 0151 message(STATUS "Kalzium molecular editor disabled") 0152 endif () 0153 0154 add_subdirectory(doc) 0155 add_subdirectory(src) 0156 add_subdirectory(data) 0157 add_subdirectory(libscience) 0158 0159 ki18n_install(po) 0160 if (KF5DocTools_FOUND) 0161 kdoctools_install(po) 0162 endif() 0163 install(FILES org.kde.kalzium.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) 0164 0165 ecm_qt_install_logging_categories( 0166 EXPORT KALZIUM 0167 FILE kalzium.categories 0168 DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} 0169 ) 0170 0171 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)