Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-03-10 02:27:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-10 02:27:26 +0300
commit17564249bb4c4a517b5dce8ba193e2f60977272c (patch)
tree5717d44946ec448590c1df75657bada5deee1884 /CMakeLists.txt
parent239a6f9de703b28565315869a32dcb753d519b56 (diff)
better default python ABI flags for *nix, 'm' default, 'd' for debug.
give a CMake error if Python.h isn't found.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt26
1 files changed, 23 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a7985cf721..0f84d61361f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -267,13 +267,23 @@ if(UNIX AND NOT APPLE)
if(WITH_PYTHON)
# No way to set py31. remove for now.
# find_package(PythonLibs)
+ # set(PYTHON_BINARY python) # not used yet
+
set(PYTHON /usr)
+
+ # ABI can be any of these chars in this order 'dmu', debug/pymalloc/unicode
+ # TODO, detect available ABI's, may want to make this a module and detect this better
+ if(CMAKE_BUILD_TYPE STREQUAL Debug)
+ set(PYTHON_ABI_FLAGS "d")
+ else()
+ set(PYTHON_ABI_FLAGS "m")
+ endif()
+
set(PYTHON_VERSION 3.2 CACHE STRING "")
mark_as_advanced(PYTHON_VERSION)
- set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "")
+ set(PYTHON_INCLUDE_DIRS "${PYTHON}/include/python${PYTHON_VERSION}${PYTHON_ABI_FLAGS}" CACHE STRING "")
mark_as_advanced(PYTHON_INCLUDE_DIRS)
- # set(PYTHON_BINARY python) # not used yet
- set(PYTHON_LIBRARY python${PYTHON_VERSION} CACHE STRING "")
+ 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)
@@ -282,6 +292,16 @@ if(UNIX AND NOT APPLE)
set(PYTHON_LINKFLAGS "-Xlinker -export-dynamic")
mark_as_advanced(PYTHON_LINKFLAGS)
+
+ find_file(
+ _Found_PYTHON_H
+ Python.h
+ ${PYTHON_INCLUDE_DIRS}
+ )
+
+ if(NOT _Found_PYTHON_H)
+ message(FATAL_ERROR "Python.h not found in ${PYTHON_INCLUDE_DIRS}")
+ endif()
endif()
if(WITH_SDL)