Commit 2797ccb4 authored by François Grisez's avatar François Grisez

Reworking of CMake scripts around documentation generation

+ Merging of ENABLE_SPHINX_DOC and ENABLE_DOC options. Only ENABLE_DOC remains.
+ Switching default value of ENABLE_DOC option to NO.
+ Adding tests for checking the presence of Python modules needed
  for documentation and wrappers generation.
parent bfd8965a
......@@ -35,6 +35,7 @@ string(REGEX REPLACE "([a-zA-Z_]+)\\.po" "\\1" LINPHONE_ALL_LANGS_LIST "${LINPHO
string(REPLACE ";" " " LINPHONE_ALL_LANGS "${LINPHONE_ALL_LANGS_LIST}")
include(CMakeDependentOption)
include(cmake/Tools.cmake)
option(ENABLE_SHARED "Build shared library." YES)
option(ENABLE_STATIC "Build static library." YES)
......@@ -46,8 +47,7 @@ option(ENABLE_CXX_WRAPPER "Build the C++ wrapper for Liblinphone." YES)
option(ENABLE_DAEMON "Enable the linphone daemon interface." YES)
option(ENABLE_DATE "Use build date in internal version number." NO)
option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO)
option(ENABLE_DOC "Enable documentation generation with Doxygen." YES)
option(ENABLE_SPHINX_DOC "Enable sphinx documentation generation." NO)
option(ENABLE_DOC "Enable API documentation generation." NO)
option(ENABLE_JAVADOC "Add a target to generate documentation for Java API" NO)
option(ENABLE_LDAP "Enable LDAP support." NO)
option(ENABLE_RELATIVE_PREFIX "Find resources relatively to the installation directory." NO)
......@@ -173,8 +173,15 @@ if(ENABLE_LIME)
endif()
set(HAVE_LIME 1)
endif()
if(ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRAPPER OR ENABLE_SPHINX_DOC)
if(ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRAPPER OR ENABLE_DOC)
find_package(PythonInterp REQUIRED)
check_python_module(pystache)
check_python_module(six)
if(ENABLE_DOC)
check_python_module(sphinx)
check_python_module(javasphinx)
check_python_module(sphinx_csharp)
endif()
endif()
if(UNIX AND NOT APPLE)
......
############################################################################
# LinphoneUtils.cmake
# Copyright (C) 2018 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
function(check_python_module module_name)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import ${module_name}"
RESULT_VARIABLE result
OUTPUT_QUIET
ERROR_QUIET)
if(result EQUAL 0)
message(STATUS "'${module_name}' python module found")
else()
message(FATAL_ERROR "'${module_name}' python module not found")
endif()
endfunction()
......@@ -20,7 +20,7 @@
#
############################################################################
if (ENABLE_SPHINX_DOC)
if (ENABLE_DOC)
set(doc_source_dir ${CMAKE_CURRENT_BINARY_DIR}/source)
set(doc_output_dir ${CMAKE_CURRENT_BINARY_DIR}/build)
set(reference_doc_source_dir ${doc_source_dir}/reference)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment