diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-14 04:24:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-14 04:24:50 +0400 |
commit | 1243992f27f8bb7fdcc817e7f6a60e7890e82e1d (patch) | |
tree | 5080d6cfab37746bdb27c2251687f285b0aeb7ac /build_files/cmake/FindPythonLibsUnix.cmake | |
parent | 519111514f39f994a9b0c729c385c44405ea5d1c (diff) |
cmake: correct uninitialized vars
Diffstat (limited to 'build_files/cmake/FindPythonLibsUnix.cmake')
-rw-r--r-- | build_files/cmake/FindPythonLibsUnix.cmake | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/build_files/cmake/FindPythonLibsUnix.cmake b/build_files/cmake/FindPythonLibsUnix.cmake index 2554b8a3585..90bd79a924a 100644 --- a/build_files/cmake/FindPythonLibsUnix.cmake +++ b/build_files/cmake/FindPythonLibsUnix.cmake @@ -18,10 +18,18 @@ set(_Python_ABI_FLAGS "m;mu;u; ") string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) + set(_Python_PATHS - "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}" "/opt/py${_PYTHON_VERSION_NO_DOTS}" "/usr" "/usr/local") + "$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}" + "/opt/py${_PYTHON_VERSION_NO_DOTS}" + "/usr" + "/usr/local" +) -if(NOT DEFINED PYTHON_INCLUDE_DIRS) +if(NOT DEFINED PYTHON_INCLUDE_DIRS OR + NOT DEFINED PYTHON_LIBRARY OR + NOT DEFINED PYTHON_LIBPATH) + message(STATUS "Looking for include Python.h") set(_Found_PYTHON_H OFF) @@ -58,7 +66,15 @@ if(NOT DEFINED PYTHON_INCLUDE_DIRS) unset(_Python_HEADER) unset(_CURRENT_ABI_FLAGS) unset(_CURRENT_PATH) - + + + set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "") + mark_as_advanced(PYTHON_INCLUDE_DIRS) + set(PYTHON_LIBRARY "python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "") + mark_as_advanced(PYTHON_LIBRARY) + set(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "") + mark_as_advanced(PYTHON_LIBPATH) + # set(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "") endif() unset(_Python_ABI_FLAGS) @@ -68,14 +84,6 @@ unset(_Python_PATHS) # now the python versions are found -set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "") -mark_as_advanced(PYTHON_INCLUDE_DIRS) -set(PYTHON_LIBRARY "python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "") -mark_as_advanced(PYTHON_LIBRARY) -set(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "") -mark_as_advanced(PYTHON_LIBPATH) -# set(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "") - if(NOT EXISTS "${PYTHON_INCLUDE_DIRS}/Python.h") message(FATAL_ERROR " Missing python header: ${PYTHON_INCLUDE_DIRS}/Python.h") endif() |