Skip to content

Commit 17c1363

Browse files
committed
[Python] Fixup to Python library restructuring
This follows up on 85e74b8, where I accidentally used the `CMAKE_INSTALL_INCLUDEDIR` in the context of copying files to the build directory. This breaks cases where the `CMAKE_INSTALL_INCLUDEDIR` is not equal to `include` (like for `gnuinstall=ON`). The include directory in the build tree is always just called `include`. Also, remove some dead code that was left over from copy pasting CMake code when splitting up `libcppyy` into a regular C++ library and a CPython extension.
1 parent 06735e7 commit 17c1363

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -135,26 +135,6 @@ endif()
135135
set_property(GLOBAL APPEND PROPERTY ROOT_EXPORTED_TARGETS CPyCppyy)
136136
set_property(GLOBAL APPEND PROPERTY ROOT_EXPORTED_TARGETS cppyy)
137137

138-
if(NOT MSVC)
139-
# Make sure that relative RUNPATH to main ROOT libraries is always correct.
140-
141-
file(RELATIVE_PATH pymoduledir_to_libdir_build ${localruntimedir} "${localruntimedir}")
142-
file(RELATIVE_PATH pymoduledir_to_libdir_install ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_PYTHONDIR} "${CMAKE_INSTALL_FULL_LIBDIR}")
143-
144-
if(APPLE)
145-
set_target_properties(${libname} PROPERTIES
146-
BUILD_RPATH "@loader_path/${pymoduledir_to_libdir_build}"
147-
INSTALL_RPATH "@loader_path/${pymoduledir_to_libdir_install}"
148-
)
149-
else()
150-
set_target_properties(${libname} PROPERTIES
151-
BUILD_RPATH "$ORIGIN/${pymoduledir_to_libdir_build}"
152-
INSTALL_RPATH "$ORIGIN/${pymoduledir_to_libdir_install}"
153-
)
154-
endif()
155-
156-
endif()
157-
158138
# Install library
159139
install(TARGETS CPyCppyy EXPORT ${CMAKE_PROJECT_NAME}Exports
160140
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
@@ -166,7 +146,8 @@ install(TARGETS cppyy EXPORT ${CMAKE_PROJECT_NAME}Exports
166146
LIBRARY DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries
167147
ARCHIVE DESTINATION ${CMAKE_INSTALL_PYTHONDIR} COMPONENT libraries)
168148

169-
file(COPY ${headers} DESTINATION ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/CPyCppyy)
149+
file(COPY ${headers} DESTINATION ${CMAKE_BINARY_DIR}/include/CPyCppyy)
150+
170151
install(FILES ${headers}
171152
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/CPyCppyy
172153
COMPONENT headers)

0 commit comments

Comments
 (0)