Commit Graph

69 Commits

Author SHA1 Message Date
Ben Boeckel 4bdec581b3 Search for other ABIFLAGS builds of Python
Starting with Python3, standard Python installs may have additional ABI
flags attached to include directories and library names. As of 3.2, the
following flags are in the configure file:

    d -> --with-debug
    m -> --with-pymalloc
    u -> --with-wide-unicode

Python 3.3 seems to no longer have --with-wide-unicode. Hopefully Python
will ensure that the possible flags always show up in a stable order.
The 'd' flag is ignored since the debug library is considered separate.

There is still the problem where ABI flags cannot be specified in
find_package since the letters confuse the version comparator.
2012-03-27 16:37:50 -04:00
Ben Boeckel 6a46f5ce80 Don't put legacy variables back into the cache
If PYTHON_INCLUDE_PATH is put into the cache, then it will always
override whatever might be found and PYTHON_INCLUDE_DIR is never given a
chance to find something different. It being marked as INTERNAL also
means that it cannot be changed without editing CMakeCache.txt directly.

Basically, the scenario is that if the Python version is changed, then
deleting PYTHON_INCLUDE_DIR doesn't work because any cached
PYTHON_INCLUDE_PATH variable is set before find_path is even called. Any
build tree using a previous version will still need either manual
removal of PYTHON_INCLUDE_PATH or a complete reconfigure, but in the
future changing the Python version can be accomplished by deleting
PYTHON_INCLUDE_DIR and reconfiguring with the new version.
2012-03-27 16:21:06 -04:00
Rolf Eike Beer 53d02ea1ea FindPythonLibs: stop scanning when libraries are found 2012-02-23 18:49:06 +01:00
Rolf Eike Beer 91d5a2a386 FindPythonLibs: put debug libraries into PYTHON_LIBRARIES 2012-02-23 18:48:24 +01:00
Rolf Eike Beer c9c1a17609 FindPythonLibs: get the exact version of the found library (#3080) 2012-02-22 17:20:15 +01:00
Rolf Eike Beer f7723786e7 FindPythonLibs: make the version selection work as for PythonInterp 2012-02-22 17:20:15 +01:00
Rolf Eike Beer bbddaeef7e FindPython{Interp,Libs}: document Python_ADDITIONAL_VERSIONS as input
The current documentation could be read as if that variable is output from the
module, which is nonsense.
2012-02-22 17:20:15 +01:00
Christian Andersson a04ced3b38 FindPythonLibs: Search for single-user installs on Windows
When cmake searches for Python libs in Windows it searches in:

  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs

However, the information might not always reside there.  The information
could also reside in:

  [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs

when one installs Python for a single user and not for all users.
2012-01-10 09:58:43 -05:00
Brad King c4275592a8 Modules: Include builtin FindPackageHandleStandardArgs directly
The FindPackageHandleStandardArgs module was originally created outside
of CMake.  It was added for CMake 2.6.0 by commit e118a627 (add a macro
FIND_PACKAGE_HANDLE_STANDARD_ARGS..., 2007-07-18).  However, it also
proliferated into a number of other projects that at the time required
only CMake 2.4 and thus could not depend on CMake to provide the module.
CMake's own find modules started using the module in commit b5f656e0
(use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX
modules..., 2007-07-18).

Then commit d358cf5c (add 2nd, more powerful mode to
find_package_handle_standard_args, 2010-07-29) added a new feature to
the interface of the module that was fully optional and backward
compatible with all existing users of the module.  Later commit 5f183caa
(FindZLIB: use the FPHSA version mode, 2010-08-04) and others shortly
thereafter started using the new interface in CMake's own find modules.
This change was also backward compatible because it was only an
implementation detail within each module.

Unforutnately these changes introduced a problem for projects that still
have an old copy of FindPackageHandleStandardArgs in CMAKE_MODULE_PATH.
When any such project uses one of CMake's builtin find modules the line

  include(FindPackageHandleStandardArgs)

loads the copy from the project which does not have the new interface!
Then the including find module tries to use the new interface with the
old module and fails.

Whether this breakage can be considered a backward incompatible change
in CMake is debatable.  The situation is analagous to copying a standard
library header from one version of a compiler into a project and then
observing problems when the next version of the compiler reports errors
in its other headers that depend on its new version of the original
header.  Nevertheless it is a change to CMake that causes problems for
projects that worked with previous versions.

This problem was discovered during the 2.8.3 release candidate cycle.
It is an instance of a more general problem with projects that provide
their own versions of CMake modules when other CMake modules depend on
them.  At the time we resolved this instance of the problem with commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28) for the 2.8.3 release.

In order to address the more general problem we introduced policy
CMP0017 in commit db44848f (Prefer files from CMAKE_ROOT when including
from CMAKE_ROOT, 2010-11-17).  That change was followed by commit
ce28737c (Remove usage of CMAKE_CURRENT_LIST_DIR now that we have
CMP0017, 2010-12-20) which reverted the original workaround in favor of
using the policy.  However, existing project releases do not set the
policy behavior to NEW and therefore still exhibit the problem.

We introduced in commit a364daf1 (Allow users to specify defaults for
unset policies, 2011-01-03) an option for users to build existing
projects by adding -DCMAKE_POLICY_DEFAULT_CMP0017=NEW to the command
line.  Unfortunately this solution still does not allow such projects to
build out of the box, and there is no good way to suggest the use of the
new option.

The only remaining solution to keep existing projects that exhibit this
problem building is to restore the change originally made in commit
b0118402 (Use absolute path to FindPackageHandleStandardArgs.cmake
everywhere, 2010-09-28).  This also avoids policy CMP0017 warnings for
this particular instance of the problem the policy addresses.
2011-01-20 10:56:49 -05:00
Brad King a104712d41 Merge topic 'python-modules-header'
23635ff Bug #11715 - generate header in the build tree.
2011-01-19 14:02:57 -05:00
Marcus D. Hanwell 23635ff1a0 Bug #11715 - generate header in the build tree.
The module header was being placed in the source tree before. Thanks to
Marcel Loose for the patch, this ensures the file is written to the
build tree.
2011-01-17 15:29:01 -05:00
Brad King 784d5ce0f8 Merge branch 'policy-CMP0017' into resolve/python-versions/policy-CMP0017
Conflicts:
	Modules/FindPythonInterp.cmake
2011-01-11 15:56:59 -05:00
Marcus D. Hanwell 2d3594b1bb Python additional version support, bug #10279.
Introduced an additional variable, Python_ADDITIONAL_VERSIONS, to both
FindPythonLibs and FindPythonInterp. Changed FindPythonInterp to loop
over versions rather than hardcoding all versions (more like libs).
2011-01-10 13:44:45 -05:00
Alex Neundorf ce28737c93 Remove usage of CMAKE_CURRENT_LIST_DIR now that we have CMP0017
This puts the new search behaviour for included files in action, i.e.
now when a file from Modules/ include()s another file, it also gets the
one from Modules/ included, i.e. the one it expects.

Alex
2011-01-04 08:20:08 -05:00
David Cole 424ba550e5 Merge topic 'PythonLibs-2.7'
1f369a7 ENH: Added case for Python 2.7.
2010-10-28 14:09:17 -04:00
Marcus D. Hanwell 1f369a71c8 ENH: Added case for Python 2.7. 2010-10-19 14:53:33 -04:00
Alex Neundorf b01184022b Use absolute path to FindPackageHandleStandardArgs.cmake everywhere
This is to avoid getting an (older) copy of FPHSA.cmake which is
e.g. installed with KDE 4.5.0 and 4.5.1.

Alex
2010-09-28 22:30:31 +02:00
David Gobbi d36c16a760 Set the module prefix, updated Windows suffix.
Set the Python module prefix to PYTHON_MODULE_PREFIX, and changed the
suffix on Windows to .pyd as .dll is officially deprecated.
2010-09-24 15:04:24 -04:00
Marcus D. Hanwell 42fd9a596f Bug with default library type of Python modules.
The _TARGET_SUPPORTS_SHARED_LIBS variable was being altered outside of
the find module, moving it into the function fixes any of these scoping
issues. Fix tested and verified in VTK and Titan.
2010-08-13 14:49:29 -04:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Marcus Hanwell 1e43973741 A few small changed from Pat Marion (in VTK CVS too) 2010-02-17 14:36:17 -05:00
Marcus Hanwell f7a3db6403 Applied patch from Pat Marion - modules header macro.
This modifies the behavior of PYTHON_WRITE_MODULES_HEADER, should be backwards
compatible. Also marked a couple of the variables generated by adding Python
modules as advanced.
2010-02-17 11:37:37 -05:00
Marcus Hanwell 8d87d12ce6 Do not force frameworks on Mac OS X - never worked well. 2010-02-17 11:35:17 -05:00
Marcus Hanwell e4ebb49717 Added a second call to find_library to find the static library.
When there is no shared object to link to a second call to find library is
necessary to find the static Python library. Fixes an issue raised on the CMake
mailing list, and it should be included in the next CMake patch release.
2009-12-14 14:15:31 -05:00
Marcus Hanwell 180a681b53 Fixed bug 8319, search for the Python shared library in the standard locations. 2009-10-19 10:39:29 -04:00
Brad King c4bb9c9d42 Convert CMake find-modules to BSD License
This adds copyright/license notification blocks CMake's find-modules.
Many of the modules had no notices at all.  Some had notices referring
to the BSD license already.  This commit normalizes existing notices and
adds missing notices.
2009-09-28 11:45:50 -04:00
Bill Hoffman da29eb892b Change FindPythonLibs to use the standard _DIR instead of _PATH but stay backwards compatible 2009-09-14 09:34:57 -04:00
Alexander Neundorf a8f493686a STYLE: use global property instead of helper target to collect all python
modules from a source tree

Alex
2008-02-15 18:26:37 -05:00
Brad King 669db35aa4 ENH: Changed signature of GET_PROPERTY command to be more powerful and extendible. 2008-01-17 17:19:13 -05:00
Alexander Neundorf ec207513e4 BUG: make the string static, otherwise the contents are gone when we exit
the function (same fix as in VTK/CMake/)

Alex
2007-09-18 15:13:22 -04:00
Alexander Neundorf 52bf51b425 ENH: add support for the next python release, python 2.6
Alex
2007-08-30 13:35:54 -04:00
Alexander Neundorf fee42f6e68 STYLE: this wasn't intended to be committed
Alex
2007-08-16 15:03:31 -04:00
Alexander Neundorf 6b0e5745ab ENH: add -Wl,-relax to the default linker flags for BlueGene, otherwise you can get "relocation truncated to fit" errors
Alex
2007-08-16 15:02:14 -04:00
Alexander Neundorf f32aa8f296 ENH: make the python modules usable for C and C++ and only write the header
if it has changed

Alex
2007-08-02 15:48:51 -04:00
Alexander Neundorf d6a0c330bc ENH: deb generator can now generate deb packages
-remove the unscriptable commands also from the cpack cmake
-use CPACK_PACKAGE_CONTACT in CMakeCPack.cmake, it's used in the nsis and
the deb generator
-make set_properties() scriptable
-use a non-const char array for adding the python modules

Alex
2007-07-27 08:59:59 -04:00
Alexander Neundorf 7e9eed0230 COMP: same as in VTK, build modules by default as shared if the platform
supports this, don't include shared modules in the generated header

Alex
2007-07-25 15:08:37 -04:00
Alexander Neundorf 13db5b578b ENH: add second failure message parameter to
FIND_PACKAGE_HANDLE_STANDARD_ARGS(), so cmake modules can specify their own
better failure messages. If the default is ok use "DEFAULT_MSG".
Do this also for FindBoost.cmake (#5349)

Alex
2007-07-23 09:49:52 -04:00
Alexander Neundorf 3907d59445 BUG: fix typo
Alex
2007-07-19 11:59:04 -04:00
Alexander Neundorf f0b6f02746 ENH: make the list of modules global
Alex
2007-07-19 11:47:23 -04:00
Alexander Neundorf 3d862c44f1 ENH: only load the static modules in the LoadAll function
Alex
2007-07-19 10:20:21 -04:00
Alexander Neundorf c7770b8edb ENH: use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS() macro in most of the
not-too-complicated modules
-remove unnecessary default search paths used in the FIND_XXX() calls

Alex
2007-07-19 09:00:51 -04:00
Alexander Neundorf e118a62709 ENH: add a macro FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
which handles the required and QUIET arguments and sets <NAME>_FOUND

Alex
2007-07-18 13:26:02 -04:00
Alexander Neundorf 5d22d36c5d ENH: apply patch from Dirk Mueller to support Python 2.5
Alex
2006-09-27 13:30:18 -04:00
Brad King a18297e2ca ENH: Updated implementation to use new FIND_* command power. The correct library is now found on MinGW also. 2006-03-24 14:47:25 -05:00
Ken Martin 74eaecfc3e ENH: cleanups 2005-12-15 14:17:43 -05:00
Bill Hoffman b7fa820118 ENH: add documentation support for modules 2005-12-14 13:51:08 -05:00
Brad King 290ffc01b6 ENH: Removing extra 64-bit search paths. They are now constructed automatically from the paths listed. 2005-04-07 14:27:01 -04:00
Brad King 76f9050026 ENH: Adding support for 64-bit library paths. Contributed by Peter Vanroose. 2005-04-07 13:46:02 -04:00
Bill Hoffman e63bdf6245 ENH: bug fix 1574 2005-02-09 22:45:43 -05:00
Andy Cedilnik ad4f98f3cf ENH: Cleanup. Use relative path to modules 2004-08-26 22:52:53 -04:00