Warning, /sdk/pology/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 2.8.3)
0002 
0003 ###
0004 ### Set project.
0005 ###
0006 
0007 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
0008 
0009 set(PROJECT_NAME "pology")
0010 file(READ "VERSION" version)
0011 string(REPLACE "\n" "" version "${version}")
0012 set(PROJECT_VERSION "${version}")
0013 message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
0014 project(${PROJECT_NAME} NONE)
0015 
0016 if(NOT cmake_install_prefix_cached)
0017     if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
0018         message(STATUS
0019             "Installation prefix: ${CMAKE_INSTALL_PREFIX} "
0020             "(use -DCMAKE_INSTALL_PREFIX= to set manually)")
0021     else()
0022         message(STATUS "Installation prefix: ${CMAKE_INSTALL_PREFIX}")
0023     endif()
0024 endif()
0025 set(cmake_install_prefix_cached ${CMAKE_INSTALL_PREFIX}
0026     CACHE INTERNAL "Cache stamp for CMAKE_INSTALL_PREFIX.")
0027 
0028 find_package(Python3 3.7 REQUIRED)
0029 find_package(DocbookXSL 1.75.2)
0030 find_package(LibXml2)
0031 find_package(Xsltproc)
0032 find_package(Pygments 1.6)
0033 find_package(Epydoc 3.0)
0034 find_package(Msgfmt 0.17)
0035 find_package(Msgmerge 0.17)
0036 
0037 if(DOCBOOKXSL_FOUND AND LIBXML2_FOUND AND XSLTPROC_FOUND)
0038     set(CAN_BUILD_DOCBOOK yes)
0039     # Configure paths in style sheet extensions.
0040     set(CONFIG_DBXSLDIR ${DOCBOOK_XSL_DIR})
0041     file(GLOB_RECURSE xslfiles RELATIVE ${CMAKE_SOURCE_DIR} "util/*.xsl")
0042     foreach(xslfile ${xslfiles})
0043         configure_file(${CMAKE_SOURCE_DIR}/${xslfile}
0044                        ${CMAKE_BINARY_DIR}/${xslfile} @ONLY)
0045     endforeach()
0046 else()
0047     set(CAN_BUILD_DOCBOOK no)
0048 endif()
0049 
0050 if(PYGMENTS_FOUND)
0051     set(CAN_HIGHLIGHT yes)
0052 else()
0053     set(CAN_HIGHLIGHT no)
0054 endif()
0055 
0056 if(EPYDOC_FOUND)
0057     set(CAN_BUILD_EPYDOC yes)
0058 else()
0059     set(CAN_BUILD_EPYDOC no)
0060 endif()
0061 
0062 if(MSGFMT_FOUND AND MSGMERGE_FOUND)
0063     set(CAN_BUILD_PO yes)
0064 else()
0065     set(CAN_BUILD_PO no)
0066 endif()
0067 
0068 # Pology is needed to build itself, bootstrap it.
0069 set(ENV{PYTHON_PATH} "${CMAKE_SOURCE_DIR}:$ENV{PYTHON_PATH}")
0070 set(POLOGY_LIB_DIR "${CMAKE_SOURCE_DIR}/pology")
0071 
0072 # Set general installation paths.
0073 set(BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin)
0074 set(DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME})
0075 set(DOC_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME})
0076 set(MO_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/locale)
0077 
0078 # Include modules used by many subdirectories.
0079 include(DocbookTools)
0080 include(EpydocTools)
0081 include(GettextTools)
0082 include(PologyTools)
0083 include(ProjectTools)
0084 include(Python3Tools)
0085 
0086 # Include subdirectories.
0087 add_subdirectory(pology)
0088 add_subdirectory(scripts)
0089 add_subdirectory(sieve)
0090 add_subdirectory(lang)
0091 add_subdirectory(doc)
0092 add_subdirectory(spec)
0093 add_subdirectory(completion)
0094 add_subdirectory(syntax)
0095 add_subdirectory(po)
0096 
0097 # Report build problems.
0098 
0099 if(NOT CAN_BUILD_DOCBOOK)
0100     set(msg "WARNING:
0101     Docbook documentation (e.g. the Pology user manual) will not be built
0102     because the following dependencies are missing or too old:")
0103     if(NOT DOCBOOKXSL_FOUND)
0104         set(msg "${msg}
0105     - Docbook XSL stylesheets
0106         home page: http://wiki.docbook.org/DocBookXslStylesheets,
0107         possible package names: docbook-xsl")
0108     endif()
0109     if(NOT LIBXML2_FOUND)
0110         set(msg "${msg}
0111     - xmllint, XML validator
0112         home page: http://xmlsoft.org/
0113         possible package names: libxml2-utils")
0114     endif()
0115     if(NOT XSLTPROC_FOUND)
0116         set(msg "${msg}
0117     - xsltproc, XSLT processor
0118         home page: http://xmlsoft.org
0119         possible package names: xsltproc")
0120     endif()
0121     message(STATUS "${msg}")
0122 else()
0123     if(NOT CAN_HIGHLIGHT)
0124         set(msg "WARNING:
0125     Docbook documentation (e.g. the Pology user manual) will lack some features
0126     because the following dependencies are missing or too old:")
0127         set(msg "${msg}
0128     - Pygments, Python syntax highlighter
0129         home page: http://pygments.org
0130         possible package names: python-pygments, pygments")
0131     endif()
0132     message(STATUS "${msg}")
0133 endif()
0134 
0135 if(NOT CAN_BUILD_EPYDOC)
0136     set(msg "WARNING:
0137     API documentation for the Pology Python library will not be built
0138     because the following dependencies are missing or too old:")
0139     if(NOT EPYDOC_FOUND)
0140         set(msg "${msg}
0141     - Epydoc, Python doctring to HTML doc generator
0142         home page: http://epydoc.sourceforge.net
0143         possible package names: python-epydoc, epydoc")
0144     endif()
0145     message(STATUS "${msg}")
0146 endif()
0147 
0148 if(NOT CAN_BUILD_PO)
0149     set(msg "WARNING:
0150     Translations of Pology user interface and documentation will not be built
0151     because the following dependencies are missing or too old:")
0152     if(NOT MSGFMT_FOUND OR NOT MSGMERGE_FOUND)
0153         set(msg "${msg}
0154     - Gettext tools
0155         home page: http://www.gnu.org/software/gettext/
0156         possible package names: gettext")
0157     endif()
0158     message(STATUS "${msg}")
0159 endif()
0160