File: FindITKPythonLibs.cmake

package info (click to toggle)
insighttoolkit4 4.13.3withdata-dfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 489,260 kB
  • sloc: cpp: 557,342; ansic: 146,850; fortran: 34,788; python: 16,572; sh: 2,187; lisp: 2,070; tcl: 993; java: 362; perl: 200; makefile: 129; csh: 81; pascal: 69; xml: 19; ruby: 10
file content (34 lines) | stat: -rw-r--r-- 1,202 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#.rst:
# FindITKPythonLibs
# -----------------
#
# FindITKPythonLibs is a work around to avoid a bug in FindPythonLibs.cmake .
# This module should always be used in place of FindPythonLibs. The code
# contained in this file will be directly integrated in FindPythonLibs.cmake in
# CMake (version more recent than 3.7.1).
#
# 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>
#
# In this case, we need to set PYTHON_LIBRARY to one value, otherwise
# get_filename_component will crash (too many arguments).
# If SelectLibraryConfigurations was run, then the individual
# PYTHON_LIBRARY_<CONFIG> values have been populated.

if(CMAKE_VERSION VERSION_GREATER 3.7.1)
  # Do nothing, the bug has been fixed
else()
  if(PYTHON_LIBRARY_RELEASE)
    set(PYTHON_LIBRARY ${PYTHON_LIBRARY_RELEASE})
  elseif(PYTHON_LIBRARY_DEBUG)
    set(PYTHON_LIBRARY ${PYTHON_LIBRARY_DEBUG})
  endif()
endif()
find_package(PythonLibs)