Package: cmake
Version: 2.8.8-3
Severity: important
If you play with the attached CMakeLists.txt file on a debian/sid system you'll
notice that PythonInterp find python 2.7 while PythonLibs always find 3.2.
$ cmake .
2.7.3
-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is exact version "2.7")
CMake Error at CMakeLists.txt:10 (message):
message called with incorrect number of arguments
-- Configuring incomplete, errors occurred!
When building python module, it is important to python2 for python 2.x modules,
and use python3 with python 3.x modules, otherwise in case of mismatch one get:
Traceback (most recent call last):
File
"/home/ctest/Dashboards/MyTests/gdcm-release/Testing/Source/DataDictionary/Python/TestDict.py",
line 15, in <module>
import gdcm
File "/home/ctest/Dashboards/MyTests/gdcm-nightly-release/bin/gdcm.py", line
62, in <module>
from gdcmswig import *
File "/home/ctest/Dashboards/MyTests/gdcm-nightly-release/bin/gdcmswig.py",
line 30, in <module>
_gdcmswig = swig_import_helper()
File "/home/ctest/Dashboards/MyTests/gdcm-nightly-release/bin/gdcmswig.py",
line 26, in swig_import_helper
_mod = imp.load_module('_gdcmswig', fp, pathname, description)
So please make sure the following works:
find_package(PythonInterp REQUIRED)
message(${PYTHON_VERSION_STRING})
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT)
Thanks
-- System Information:
Debian Release: 6.0.5
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable'), (200, 'testing'), (100,
'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-0.bpo.2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages cmake depends on:
ii cmake-data 2.8.7-4~bpo60+1 CMake data files (modules, templat
ii libarchive1 2.8.4.forreal-1+squeeze2 Single library to read/write tar,
ii libc6 2.11.3-3 Embedded GNU C Library: Shared lib
ii libcurl3-gnutls 7.21.0-2.1+squeeze2 Multi-protocol file transfer libra
ii libexpat1 2.0.1-7 XML parsing C library - runtime li
ii libgcc1 1:4.4.5-8 GCC support library
ii libstdc++6 4.4.5-8 The GNU Standard C++ Library v3
ii libxmlrpc-c3 1.06.27-1.1 A lightweight RPC library based on
ii procps 1:3.2.8-9squeeze1 /proc file system utilities
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime
cmake recommends no packages.
Versions of packages cmake suggests:
ii gcc 4:4.4.5-1 The GNU C compiler
ii make 3.81-8 An utility for Directing compilati
-- no debconf information
cmake_minimum_required(VERSION 2.8)
project(p)
find_package(PythonInterp REQUIRED)
#find_package(PythonLibs ${PYTHON_MAJOR}.${PYTHON_MINOR} EXACT REQUIRED)
#message(${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
message(${PYTHON_VERSION_STRING})
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT)
#find_package(PythonLibs REQUIRED)
message(${PYTHONLIBS_VERSION_STRING})