ENH: only load the static modules in the LoadAll function

Alex
This commit is contained in:
Alexander Neundorf 2007-07-19 10:20:21 -04:00
parent ad8efca061
commit 3d862c44f1
1 changed files with 4 additions and 3 deletions

View File

@ -94,11 +94,12 @@ MACRO(PYTHON_ADD_MODULE _NAME )
SET(PY_MODULE_TYPE MODULE)
ELSE(PYTHON_MODULE_${_NAME}_SHARED)
SET(PY_MODULE_TYPE STATIC)
SET(PY_STATIC_MODULES_LIST ${PY_STATIC_MODULES_LIST} ${_NAME})
ENDIF(PYTHON_MODULE_${_NAME}_SHARED)
SET(PY_MODULES_LIST ${PY_MODULES_LIST} ${_NAME})
ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
# TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES})
ENDIF(PYTHON_ENABLE_MODULE_${_NAME})
ENDMACRO(PYTHON_ADD_MODULE)
@ -120,8 +121,8 @@ MACRO(PYTHON_WRITE_MODULES_HEADER _filename)
ENDFOREACH(_currentModule ${PY_MODULES_LIST})
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")
ENDFOREACH(_currentModule ${PY_MODULES_LIST})
ENDFOREACH(_currentModule ${PY_STATIC_MODULES_LIST})
FILE(APPEND ${_filename} "}\n#endif\n\n#endif\n")
ENDMACRO(PYTHON_WRITE_MODULES_HEADER)