Salome HOME
Test1967: Update tolerance ratio for moving vs creating.
[modules/shaper.git] / CMakeCommon / PythonAPI.cmake
1 # Copyright (C) 2014-2023  CEA, EDF
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 find_package(SWIG REQUIRED)
21 include(${SWIG_USE_FILE})
22
23 #TODO(spo): is -threads necessary?
24 set(CMAKE_SWIG_FLAGS -threads -Wall)
25
26 # Using doxy2swig:
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)
31
32 #TODO(spo): why not use FindDoxygen.cmake module?
33 if(WIN32)
34   find_program(DOXYGEN_EXECUTABLE Doxygen)
35 else()
36   find_program(DOXYGEN_EXECUTABLE doxygen)
37 endif()
38
39 set(EXCLUDE_DOC_DIR "*/Test/* */Mock/*")
40
41 configure_file(${PROJECT_SOURCE_DIR}/doc/swig/doxyfile.in doxyfile @ONLY)
42
43 set(doc_sources)
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})
47 endforeach()
48 #message(STATUS "${doc_sources}")
49
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
54 )