summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2011-01-11 17:07:26 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-01-12 17:23:46 -0300
commit297151081ffae13c8dbb66ffde61f2c15eaae2a3 (patch)
tree802d1533c5749a50859e97beec19b4552839fb30 /CMakeLists.txt
parent498ba2f39e64129d6911cedfd1334032350543eb (diff)
downloadshiboken-297151081ffae13c8dbb66ffde61f2c15eaae2a3.tar.gz
shiboken-297151081ffae13c8dbb66ffde61f2c15eaae2a3.tar.xz
shiboken-297151081ffae13c8dbb66ffde61f2c15eaae2a3.zip
Append python name to libshiboken output file
libshiboken is strongly tied to the python it was compiled against. This commit adds the python name to the output file to make this connection explicit. The generator plugin, binary and includes are untouched as they don't depend on python. Also, Instead of installing the cmake info in a single file, ShibokenConfig.cmake will load the correct file (ShibokenConfig-<python name>.cmake) based on the value of PYTHON_BASENAME when cmake is called. The last shiboken installed will be the default as each install will overwrite ShibokenConfig.cmake. To select an specific python, call cmake with -DPYTHON_BASENAME=python2.6, for python2.6 release. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0891ce9..52aea434 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,16 @@ execute_process(
OUTPUT_VARIABLE PY_DEBUG
OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "import sys; \\
+ from distutils import sysconfig; \\
+ vr = sys.version_info; \\
+ suffix = '-dbg' if bool(sysconfig.get_config_var('Py_DEBUG')) else ''; \\
+ print 'python%d.%d%s' % (vr[0], vr[1], suffix)"
+ OUTPUT_VARIABLE PYTHON_BASENAME
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
set(SHIBOKEN_BUILD_TYPE "Release")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(NOT PYTHON_DEBUG_LIBRARIES)