| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Fixes: #18443
|
|
|
|
| |
Python 3.7 is about to be released, making the development version 3.8.
|
|
|
|
| |
Fixes: #16142
|
|
|
|
|
|
|
|
|
|
| |
Drop the `NO_SYSTEM_ENVIRONMENT_PATH` option from our `find_library`
calls. No other find modules do this. Also, since commit
v3.3.0-rc1~430^2 (Teach find_(library|file|path) to get prefixes from
PATH, 2015-02-18) we always search the `lib` directory of each prefix
before the `bin` directory and so should prefer the non-`.dll` name.
Issue: #17336
|
|
|
|
|
|
|
|
|
| |
Add `NAMES_PER_DIR` to all `find_library` invocations so that we
consider all possible names in each search directory before moving on to
the next directory. This helps find the package that appears earliest
in the search path regardless of how it names its libraries.
Fixes: #17336
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`PYTHON_LIBRARY` may contain a list because of `SelectLibraryConfigurations`.
If it is the case, the list can be:
optimized;<FILEPATH_TO_RELEASE_LIBRARY>;debug;<FILEPATH_TO_DEBUG_LIBRARY>
Instead of directly using the value of `PYTHON_LIBRARY` in the CMake
function `get_filename_component()`, we loop over the content of the
relevant parts of `PYTHON_LIBRARY` and `PYTHON_DEBUG_LIBRARY` whether
they are lists or not.
Suggested-by: Brad King <brad.king@kitware.com>
|
|
|
|
|
|
|
|
| |
The `PYTHON_EXECUTABLE` variable normally contains an absolute path, but
tolerate cases when it does not without calling `get_filename_component`
with an incorrect number of arguments.
Closes: #16452
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool. Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience. Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.
Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices. It also references version control
history for more precise information. Therefore we no longer need to spell
out the list of Contributors in each source file notice.
Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing". The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.
Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically. Manually fix up shebang lines and trailing
newlines in a few files. Manually update the notices in a few files that the
script does not handle.
|
| |
|
|
|
|
| |
Improve wording in our advice about how to call both of these modules.
|
|
|
|
| |
To avoid pollution, unset variables that are only meant for local use.
|
|
|
|
|
|
| |
If PYTHON_EXECUTABLE is set, then we should look for the libs in the
same prefix, e.g. /usr/local/python -> /usr/local/lib, and on Win32
/Python34/python.exe -> /Python34/libs.
|
|
|
|
|
|
| |
This commit ensures that FindPythonLibs has found the library before
before the search for the include dir begins. The library prefix and
version can then be used to find the matching include dir.
|
|
|
|
|
|
|
|
| |
We use PATH_SUFFIXES to append "python<v>" to each candidate path. Do
not append it to the constructed list of python framework include
directories. Otherwise the combined path will never exist. Note that
the code doesn't yet try to match the suffixes "m" and "u" between the
executable, library, and include directory.
|
|
|
|
|
|
| |
This cmake variable has been deprecated for over a decade, and using it
as an input could potentially cause unexpected results. We still need
to keep it as an output variable for compatibility though.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Address the test case
cmake_minimum_required(VERSION 2.8)
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6)
find_package(PythonLibs 3 REQUIRED)
with a Python 3.4.x .pkg installed from python.org on OSX.
Temporarily set CMAKE_FIND_FRAMEWORK to LAST to avoid finding the
system Python.h prematurely.
Add directories inside the frameworks to the search list for the library
as is done for the header.
|
|\
| |
| |
| |
| |
| | |
59220198 FindPython*: Document suggested find_package order (#13794)
a9e6de2a FindPythonInterp: Use consistent version with PythonLibs (#13794)
|
| |
| |
| |
| |
| | |
Document in both FindPythonInterp.cmake and FindPythonLibs.cmake that
find_package(PythonInterp) should be called before find_package(PythonLibs).
|
|\ \
| |/
|/|
| |
| | |
ab6201ab FindPython{Interp,Libs}: Search for Python 3.4.
|
| |
| |
| |
| | |
Python 3.4.0rnc1 was released on 2014-02-20.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The parent commit taught FindPythonLibs to try to find PythonInterp
unconditionally. Some projects may want the libraries of a specific
version even when the corresponding interpreter is not available. Drop
the internal use of FindPythonInterp and just use the versions from it
if it happens to have been found by the project first. That will allow
projects to get a consistent version when they want both but not
otherwise force them to find the interpreter.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
When possible, get consistent version of the Python interpreter, headers path,
and library.
Now find_package(PythonLibs) internally calls find_package(PythonInterp
QUIET) and uses the resulting PYTHON_VERSION_MAJOR and
PYTHON_VERSION_MINOR to prefer these versions when looking for the
header path and library. The Python_ADDITIONAL_VERSIONS variable has
priority over the interpreter version.
Co-Author: Adam Wolf
Co-Author: Gert Wollny <gw.fossdev@gmail.com>
|
|
|
|
|
|
|
|
| |
Run the convert-help.bash script to convert documentation:
./convert-help.bash "/path/to/CMake-build/bin"
Then remove it.
|
|
|
|
|
| |
CMake already provides the version components split into variables, no need to
split them again.
|
|
|
|
|
|
| |
This solves a lots of warnings, e.g. in the FindModulesExecuteAll test. If the
installed version on the system is rather old this may even lead to bugs, e.g.
https://bugs.gentoo.org/show_bug.cgi?id=436540
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block. This is no longer the preferred style.
Run the following shell code:
for c in else endif endforeach endfunction endmacro endwhile; do
echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code:
cmake --help-command-list |
grep -v "cmake version" |
while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
|
| |
|
|
|
|
|
| |
Add information on how to change which install of Python is found
by CMake.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The current documentation could be read as if that variable is output from the
module, which is nonsense.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| |
| |
| | |
23635ff 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.
|
|\ \
| |/
|/|
| |
| | |
Conflicts:
Modules/FindPythonInterp.cmake
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
| |
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).
|
|\
| |
| |
| |
| | |
1f369a7 ENH: Added case for Python 2.7.
|
| | |
|
|/
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Set the Python module prefix to PYTHON_MODULE_PREFIX, and changed the
suffix on Windows to .pyd as .dll is officially deprecated.
|
|
|
|
|
|
| |
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.
|