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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
From ca68d34843ce4ef4b03d2b50d20f83329e3d0933 Mon Sep 17 00:00:00 2001
From: Bernd Waibel <waebbl-gentoo@posteo.net>
Date: Tue, 25 Jan 2022 06:25:51 +0100
Subject: [PATCH] [Gentoo specific] changes needed for slotting
Patches some cases to set the path according to the install
locations, which are different than upstream default to
respect slotted installations.
Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -60,7 +60,7 @@ include(CMakePackageConfigHelpers)
configure_package_config_file(ImathConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${IMATH_OUTPUT_SUBDIR}
)
write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake"
@@ -70,11 +70,11 @@ write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake"
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${IMATH_OUTPUT_SUBDIR}
)
install(EXPORT ${PROJECT_NAME}
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${IMATH_OUTPUT_SUBDIR}
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
EXPORT_LINK_INTERFACE_LIBRARIES
--- a/config/Imath.pc.in
+++ b/config/Imath.pc.in
@@ -5,7 +5,7 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
-libdir=@libdir@
+libdir=@libdir@/@IMATH_OUTPUT_SUBDIR@
includedir=@includedir@
libsuffix=@LIB_SUFFIX_DASH@
Name: Imath
@@ -14,4 +14,4 @@ Version: @IMATH_VERSION@
Requires:
Conflicts:
Libs: -L${libdir} -lImath${libsuffix}
-Cflags: -I${includedir} -I${includedir}/Imath
+Cflags: -I${includedir} -I${includedir}/@IMATH_OUTPUT_SUBDIR@
--- a/config/LibraryDefine.cmake
+++ b/config/LibraryDefine.cmake
@@ -87,8 +87,8 @@ function(IMATH_DEFINE_LIBRARY libname)
install(TARGETS ${libname}
EXPORT ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${IMATH_OUTPUT_SUBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${IMATH_OUTPUT_SUBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${IMATH_OUTPUT_SUBDIR}
@@ -101,8 +101,8 @@ function(IMATH_DEFINE_LIBRARY libname)
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_BINDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})")
install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_BINDIR}/${baselibname} -> ${verlibname}\")")
else()
- install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})")
- install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_LIBDIR}/${baselibname} -> ${verlibname}\")")
+ install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}/${IMATH_OUTPUT_SUBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})")
+ install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_LIBDIR}/${IMATH_OUTPUT_SUBDIR}/${baselibname} -> ${verlibname}\")")
endif()
set(verlibname)
set(baselibname)
--- a/src/python/PyImath.pc.in
+++ b/src/python/PyImath.pc.in
@@ -13,4 +13,4 @@ Name: PyImath
Description: Python bindings for the Imath libraries
Version: @IMATH_VERSION@
Libs: -L${libdir} -lImath${libsuffix} -lPyImath@PYIMATH_LIB_PYTHONVER_ROOT@@Python_VERSION_MAJOR@_@Python_VERSION_MINOR@${libsuffix}
-Cflags: -I${includedir} -I${includedir}/Imath
+Cflags: -I${includedir} -I${includedir}/@IMATH_OUTPUT_SUBDIR@
--- a/src/python/PyImathNumpy/CMakeLists.txt
+++ b/src/python/PyImathNumpy/CMakeLists.txt
@@ -48,5 +48,5 @@ if(TARGET Python3::Python AND
LIBRARY_OUTPUT_NAME "imathnumpy"
DEBUG_POSTFIX ""
)
- install(TARGETS imathnumpy_python3 DESTINATION ${PyImath_Python3_SITEARCH_REL})
+ install(TARGETS imathnumpy_python3 DESTINATION ${PyImath_Python3_SITEARCH_REL}/${IMATH_OUTPUT_SUBDIR})
endif()
--- a/src/python/config/CMakeLists.txt
+++ b/src/python/config/CMakeLists.txt
@@ -15,7 +15,7 @@ if(IMATH_INSTALL_PKG_CONFIG)
function(pyimath_pkg_config_help pcinfile)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
- set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
+ set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}/${IMATH_OUTPUT_SUBDIR}")
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
set(LIB_SUFFIX_DASH ${IMATH_LIB_SUFFIX}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX})
--- a/src/python/config/ModuleDefine.cmake
+++ b/src/python/config/ModuleDefine.cmake
@@ -54,8 +54,8 @@ function(PYIMATH_ADD_LIBRARY_PRIV libname)
install(TARGETS ${libname}
EXPORT ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${IMATH_OUTPUT_SUBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${IMATH_OUTPUT_SUBDIR}
)
endfunction()
@@ -154,7 +154,7 @@ function(PYIMATH_DEFINE_MODULE modname)
LIBRARY_OUTPUT_NAME "${modname}"
DEBUG_POSTFIX ""
)
- install(TARGETS ${modname}_python3 DESTINATION ${PyImath_Python3_SITEARCH_REL})
+ install(TARGETS ${modname}_python3 DESTINATION ${PyImath_Python3_SITEARCH_REL}/${IMATH_OUTPUT_SUBDIR})
endif()
endif()
endfunction()
--
2.34.1
|