1 # Copyright (C) 2014-2019 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 find_package(SWIG REQUIRED)
21 include(${SWIG_USE_FILE})
23 #TODO(spo): is -threads necessary?
24 set(CMAKE_SWIG_FLAGS -threads -Wall)
27 # Add to ModuleName.i before any %inlcude:
28 # %include "doxyhelp.i"
29 # Add to CMakeLists.txt before SWIG_ADD_MODULE(...):
30 # SET(SWIG_MODULE_ModuleName_EXTRA_DEPS ${SWIG_MODULE_ModuleName_EXTRA_DEPS} doxyhelp.i)
32 #TODO(spo): why not use FindDoxygen.cmake module?
34 find_program(DOXYGEN_EXECUTABLE Doxygen)
36 find_program(DOXYGEN_EXECUTABLE doxygen)
39 set(EXCLUDE_DOC_DIR "*/Test/* */Mock/*")
41 configure_file(${PROJECT_SOURCE_DIR}/doc/swig/doxyfile.in doxyfile @ONLY)
44 foreach(it "*.h;*.cpp;*.hpp;*.cxx")
45 file(GLOB doc_source RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${it})
46 list(APPEND doc_sources ${doc_source})
48 #message(STATUS "${doc_sources}")
50 add_custom_command(OUTPUT doxyhelp.i
51 COMMAND "${DOXYGEN_EXECUTABLE}"
52 COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/doxy2swig.py xml/index.xml doxyhelp.i
53 DEPENDS ${doc_sources} ${PROJECT_SOURCE_DIR}/doc/swig/doxyfile.in