Debian Codegraph @

src/python/PyImathNumpy/CMakeLists.txt

raw
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright Contributors to the OpenEXR Project.
3
4 if(TARGET Python2::Python AND
5 TARGET Boost::${PYIMATH_BOOST_PY_COMPONENT} AND
6 TARGET Python2::ImathNumPy)
7 set(moddeps_p2 PyImath)
8 list(TRANSFORM moddeps_p2 APPEND ${PYIMATH_LIB_PYTHONVER_ROOT}${Python2_VERSION_MAJOR}_${Python2_VERSION_MINOR})
9 Python2_add_library(imathnumpy_python2 MODULE
10 imathnumpymodule.cpp
11 )
12 target_link_libraries(imathnumpy_python2
13 PRIVATE
14 Imath
15 ${moddeps_p2}
16 Python2::Python
17 Boost::${PYIMATH_BOOST_PY_COMPONENT}
18 Python2::ImathNumPy
19 )
20 set_target_properties(imathnumpy_python2 PROPERTIES
21 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python${Python2_VERSION_MAJOR}_${Python2_VERSION_MINOR}/"
22 LIBRARY_OUTPUT_NAME "imathnumpy"
23 DEBUG_POSTFIX ""
24 )
25 install(TARGETS imathnumpy_python2 DESTINATION ${PyImath_Python2_SITEARCH_REL})
26 endif()
27
28 if(TARGET Python3::Python AND
29 TARGET Boost::${PYIMATH_BOOST_PY_COMPONENT} AND
30 TARGET Python3::ImathNumPy)
31
32 set(moddeps_p3 PyImath)
33 list(TRANSFORM moddeps_p3 APPEND ${PYIMATH_LIB_PYTHONVER_ROOT}${Python3_VERSION_MAJOR}_${Python3_VERSION_MINOR})
34
35 Python3_add_library(imathnumpy_python3 MODULE
36 imathnumpymodule.cpp
37 )
38 target_link_libraries(imathnumpy_python3
39 PRIVATE
40 Imath
41 ${moddeps_p3}
42 Python3::Python
43 Boost::${PYIMATH_BOOST_PY_COMPONENT}
44 Python3::ImathNumPy
45 )
46 set_target_properties(imathnumpy_python3 PROPERTIES
47 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python${Python3_VERSION_MAJOR}_${Python3_VERSION_MINOR}/"
48 LIBRARY_OUTPUT_NAME "imathnumpy"
49 DEBUG_POSTFIX ""
50 )
51 install(TARGETS imathnumpy_python3 DESTINATION ${PyImath_Python3_SITEARCH_REL})
52 endif()