@@ -15,56 +15,25 @@ macro (ot_add_python_module MODULENAME SOURCEFILE)
1515 endif ()
1616
1717 set (swig_other_sources)
18- set (docstring_sources)
1918 foreach (it ${ARGN} )
2019 if (${it} MATCHES ".*\\ .i$" )
2120 ot_install_swig_file (${it} )
22- elseif (${it} MATCHES ".*_doc\\ .i\\ .in$" )
23- list (APPEND docstring_sources ${it} )
24-
25- get_filename_component (DOCSTRING_FILE_BASENAME ${it} NAME_WE )
26- ot_install_swig_file (${CMAKE_CURRENT_BINARY_DIR} /${DOCSTRING_FILE_BASENAME} .i)
2721 else ()
2822 list (APPEND swig_other_sources "${it} " )
2923 endif ()
3024 endforeach ()
3125
32- # https://github.com/swig/swig/issues/1273
33- option (SWIG_FORCE_DOUBLE_ESCAPE_BACKSLASH "Force double escaping of backslashes" OFF )
34- mark_as_advanced (SWIG_FORCE_DOUBLE_ESCAPE_BACKSLASH)
35- set (TIMES x1)
36- if ((SWIG_VERSION VERSION_LESS 4) OR SWIG_FORCE_DOUBLE_ESCAPE_BACKSLASH)
37- set (TIMES x2)
38- endif ()
39-
40- # handle docstring generation
41- add_custom_target (generate_${MODULENAME} _docstrings
42- COMMAND ${CMAKE_COMMAND} -DDOCSTRING_SOURCES="${docstring_sources} "
43- -DCURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DTIMES=${TIMES}
44- -P ${CMAKE_SOURCE_DIR} /cmake/escape_backslash.cmake
45- DEPENDS ${docstring_sources} )
46- list (APPEND SWIG_MODULE_${MODULENAME} _python_EXTRA_DEPS generate_${MODULENAME} _docstrings)
47-
4826 set (module_target ${MODULENAME} _python)
4927
5028 swig_add_library (${module_target} LANGUAGE python SOURCES ${SOURCEFILE} ${swig_other_sources} )
5129
52- # UseSWIG generates now standard target names
53-
5430 target_include_directories (${module_target} PRIVATE ${INTERNAL_INCLUDE_DIRS} )
55- swig_link_libraries (${module_target} otvine)
5631
57- if (TARGET Python::Module)
58- target_link_libraries (${module_target} Python::Module)
59- else ()
60- target_include_directories (${module_target} PRIVATE ${Python_INCLUDE_DIRS} )
61- target_link_libraries_with_dynamic_lookup (${module_target} ${Python_LIBRARIES} )
62- endif ()
32+ target_link_libraries (${module_target} otvine)
33+ target_link_libraries (${module_target} Python::Module)
6334
6435 set_target_properties (${module_target} PROPERTIES OUTPUT_NAME ${MODULENAME} )
65-
6636 set_target_properties (${module_target} PROPERTIES COMPILE_FLAGS "${SWIG_COMPILE_FLAGS} " )
67-
6837 set_target_properties (${module_target} PROPERTIES UNITY_BUILD OFF )
6938
7039 install (FILES ${CMAKE_CURRENT_BINARY_DIR} /${MODULENAME} .py
@@ -78,8 +47,8 @@ endmacro ()
7847
7948
8049ot_add_python_module( ${PACKAGE_NAME} ${PACKAGE_NAME} _module.i
81- VineCopula.i VineCopula_doc.i.in
82- VineCopulaFactory.i VineCopulaFactory_doc.i.in
50+ VineCopula.i VineCopula_doc.i
51+ VineCopulaFactory.i VineCopulaFactory_doc.i
8352 )
8453
8554
0 commit comments