40 lines
1.4 KiB
Diff
40 lines
1.4 KiB
Diff
--- a/config/ImathConfig.cmake.in
|
|
+++ b/config/ImathConfig.cmake.in
|
|
@@ -4,4 +4,7 @@
|
|
@PACKAGE_INIT@
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
|
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/PyImathTargets.cmake")
|
|
+ include("${CMAKE_CURRENT_LIST_DIR}/PyImathTargets.cmake")
|
|
+endif()
|
|
check_required_components("@PROJECT_NAME@")
|
|
--- a/src/python/config/ModuleDefine.cmake
|
|
+++ b/src/python/config/ModuleDefine.cmake
|
|
@@ -52,7 +52,7 @@ function(PYIMATH_ADD_LIBRARY_PRIV libnam
|
|
add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})
|
|
|
|
install(TARGETS ${libname}
|
|
- EXPORT ${PROJECT_NAME}
|
|
+ EXPORT PyImath
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
--- a/src/python/config/CMakeLists.txt
|
|
+++ b/src/python/config/CMakeLists.txt
|
|
@@ -7,8 +7,14 @@
|
|
add_library(PyImathConfig INTERFACE)
|
|
target_include_directories(PyImathConfig INTERFACE
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
|
-install(TARGETS PyImathConfig EXPORT ${PROJECT_NAME})
|
|
+install(TARGETS PyImathConfig EXPORT PyImath)
|
|
add_library(PyImath::Config ALIAS PyImathConfig)
|
|
+install(EXPORT PyImath
|
|
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/PyImath
|
|
+ FILE PyImathTargets.cmake
|
|
+ NAMESPACE Imath::
|
|
+ EXPORT_LINK_INTERFACE_LIBRARIES
|
|
+)
|
|
|
|
if(IMATH_INSTALL_PKG_CONFIG)
|
|
# use a helper function to avoid variable pollution, but pretty simple
|