Skip to content
Snippets Groups Projects
Commit da3b8ef0 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

SWIG runtime code is generated together with other bindings.

parent 493d9160
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,7 @@ if(BORNAGAIN_PYTHON)
set(swig_dependencies ${swig_dependencies} ${AUTO_DIR}/doxygen_core.i)
set(SWIG_FLAGS "-c++;-python;-o;${AUTO_DIR}/libBornAgainCore_wrap.cpp;-outdir;${TMP_DIR}")
set(SWIG_RUNTIME_FLAGS "-c++;-python;-external-runtime;${AUTO_DIR}/swig_runtime.h")
foreach(dir ${include_dirs})
list(APPEND SWIG_FLAGS "-I${dir}")
endforeach(dir)
......@@ -84,6 +85,12 @@ if(BORNAGAIN_PYTHON)
DEPENDS ${swig_dependencies} ${include_files}
)
add_custom_command (
OUTPUT ${AUTO_DIR}/swig_runtime.h
COMMAND ${SWIG_EXECUTABLE} ${SWIG_RUNTIME_FLAGS}
DEPENDS ${swig_dependencies} ${include_files}
)
endif(BORNAGAIN_GENERATE_BINDINGS)
add_custom_target (
......@@ -93,7 +100,10 @@ if(BORNAGAIN_PYTHON)
DEPENDS ${AUTO_DIR}/libBornAgainCore.py
)
add_custom_target(${library_name}_runtime DEPENDS ${AUTO_DIR}/swig_runtime.h)
list(APPEND source_files "${AUTO_DIR}/libBornAgainCore_wrap.cpp")
list(APPEND include_files "${AUTO_DIR}/swig_runtime.h")
configure_file(${WRAP_DIR}/python/plot_utils.py
${CMAKE_BINARY_DIR}/lib/bornagain/plot_utils.py COPYONLY)
......@@ -123,7 +133,7 @@ set(${library_name}_LIBRARY_TYPE SHARED)
if(BORNAGAIN_PYTHON)
add_dependencies(${library_name} ${library_name}_python)
add_dependencies(${library_name} ${library_name}_python ${library_name}_runtime)
endif()
# exposing library name and list of include directories outside
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment