ENH: only load the static modules in the LoadAll function
Alex
This commit is contained in:
parent
ad8efca061
commit
3d862c44f1
|
@ -94,11 +94,12 @@ MACRO(PYTHON_ADD_MODULE _NAME )
|
||||||
SET(PY_MODULE_TYPE MODULE)
|
SET(PY_MODULE_TYPE MODULE)
|
||||||
ELSE(PYTHON_MODULE_${_NAME}_SHARED)
|
ELSE(PYTHON_MODULE_${_NAME}_SHARED)
|
||||||
SET(PY_MODULE_TYPE STATIC)
|
SET(PY_MODULE_TYPE STATIC)
|
||||||
|
SET(PY_STATIC_MODULES_LIST ${PY_STATIC_MODULES_LIST} ${_NAME})
|
||||||
ENDIF(PYTHON_MODULE_${_NAME}_SHARED)
|
ENDIF(PYTHON_MODULE_${_NAME}_SHARED)
|
||||||
|
|
||||||
SET(PY_MODULES_LIST ${PY_MODULES_LIST} ${_NAME})
|
SET(PY_MODULES_LIST ${PY_MODULES_LIST} ${_NAME})
|
||||||
ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
|
ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
|
||||||
TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
|
# TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
|
||||||
ENDIF(PYTHON_ENABLE_MODULE_${_NAME})
|
ENDIF(PYTHON_ENABLE_MODULE_${_NAME})
|
||||||
ENDMACRO(PYTHON_ADD_MODULE)
|
ENDMACRO(PYTHON_ADD_MODULE)
|
||||||
|
|
||||||
|
@ -120,8 +121,8 @@ MACRO(PYTHON_WRITE_MODULES_HEADER _filename)
|
||||||
ENDFOREACH(_currentModule ${PY_MODULES_LIST})
|
ENDFOREACH(_currentModule ${PY_MODULES_LIST})
|
||||||
|
|
||||||
FILE(APPEND ${_filename} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n")
|
FILE(APPEND ${_filename} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n")
|
||||||
FOREACH(_currentModule ${PY_MODULES_LIST})
|
FOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
|
||||||
FILE(APPEND ${_filename} " CMakeLoadPythonModule_${_currentModule}();\n")
|
FILE(APPEND ${_filename} " CMakeLoadPythonModule_${_currentModule}();\n")
|
||||||
ENDFOREACH(_currentModule ${PY_MODULES_LIST})
|
ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
|
||||||
FILE(APPEND ${_filename} "}\n#endif\n\n#endif\n")
|
FILE(APPEND ${_filename} "}\n#endif\n\n#endif\n")
|
||||||
ENDMACRO(PYTHON_WRITE_MODULES_HEADER)
|
ENDMACRO(PYTHON_WRITE_MODULES_HEADER)
|
||||||
|
|
Loading…
Reference in New Issue