diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-07-19 15:47:23 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-07-19 15:47:23 (GMT) |
commit | f0b6f02746d2ef0a02eaf9ce4560d20c81ab8b87 (patch) | |
tree | de3fb4744d2864a8652b99f642a88cf37eebe480 /Modules/FindPythonLibs.cmake | |
parent | 8c77fe55dcdbb7c75b963f39444d9e939e6b66f3 (diff) | |
download | CMake-f0b6f02746d2ef0a02eaf9ce4560d20c81ab8b87.zip CMake-f0b6f02746d2ef0a02eaf9ce4560d20c81ab8b87.tar.gz CMake-f0b6f02746d2ef0a02eaf9ce4560d20c81ab8b87.tar.bz2 |
ENH: make the list of modules global
Alex
Diffstat (limited to 'Modules/FindPythonLibs.cmake')
-rw-r--r-- | Modules/FindPythonLibs.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index b3edd92..b7c7a69 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -85,6 +85,14 @@ SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}") INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs PYTHON_LIBRARIES PYTHON_INCLUDE_PATH) + +GET_TARGET_PROPERTIES(_FIND_PYTHONLIBS_ALREADY_INCLUDED __FindPythonLibsHelper TYPE) +IF(NOT _FIND_PYTHONLIBS_ALREADY_INCLUDED) + ADD_CUSTOM_TARGET(__FindPythonLibsHelper) # so if this file is included several times the next time GET_TARGET_PROPERTIES() will work + SET(PY_STATIC_MODULES_LIST "" CACHE STRING "Collect a list of all added static python modules" FORCE) + SET(PY_MODULES_LIST "" CACHE STRING "Collect a list of all added python modules" FORCE) +ENDIF(NOT _FIND_PYTHONLIBS_ALREADY_INCLUDED) + MACRO(PYTHON_ADD_MODULE _NAME ) OPTION(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE) @@ -94,10 +102,10 @@ 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}) + SET(PY_STATIC_MODULES_LIST ${PY_STATIC_MODULES_LIST} ${_NAME} CACHE STRING "Collect a list of all added static python modules" FORCE) ENDIF(PYTHON_MODULE_${_NAME}_SHARED) - SET(PY_MODULES_LIST ${PY_MODULES_LIST} ${_NAME}) + SET(PY_MODULES_LIST ${PY_MODULES_LIST} ${_NAME} CACHE STRING "Collect a list of all added python modules" FORCE) ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN}) # TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES}) ENDIF(PYTHON_ENABLE_MODULE_${_NAME}) |