Python library CMake variable names

cmake
python

(Jon Haitz Legarreta Gorroño) #1

Folks,
my CMake is showing the variables names PYTHON_DEBUG_LIBRARY and PYTHON_LIBRARY_DEBUG, which I find meaning pretty much the same thing or confusing at least.

As far as I understand, the former is used by the VNL third party library.

And the latter is the one ITK’s FindITKPythonLibs.cmake is supposed to use.

If an effect of the CMake cache, then it can be ignored. If not I’m wondering whether the same name could be used to avoid duplicates/confusion.

Thanks.


(Matt McCormick) #2

Hi Jon Haitz,

For the former, PYTHON_DEBUG_LIBRARY, is this variable marked as an advanced cache variable? If not, we could mark it as advanced to avoid confusion.

For the latter, considering the commit message when FindITKPythonLibs.cmake was added, it was only required for CMake < 3.7. Since we now require CMake 3.10, we could remove that file.

Thanks,
Matt


(Jon Haitz Legarreta Gorroño) #3

Hi Matt,
thanks for having a look at this.

Both are marked as advanced variables.

PR for removing the mentioned file: https://github.com/InsightSoftwareConsortium/ITK/pull/202


(Jon Haitz Legarreta Gorroño) #4

The PR has been merged.

However, I’ve checked locally that, building from master and after having deleted the cache, both variables are listed by CMake when configuring ITK with Python wrapping. I’m wondering whether it has to do with CMake itself rather than with ITK then.


(Matt McCormick) #5

Yes, I think this is a CMake consistency issue.


(Jon Haitz Legarreta Gorroño) #6

Just to wrap up, I checked the CMake sources and both variables dwell in the CMake source code. And as hypothesized, one is indeed a legacy variable following a former naming convention. Brad King said that the way things are currently is just fine.