Skip to content

Commit

Permalink
fix bad export of Eigen3::Eigen target
Browse files Browse the repository at this point in the history
  • Loading branch information
schornakj committed Jun 2, 2020
1 parent 6fcb10a commit 64d3b69
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions rct_image_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ find_package(rct_optimizations REQUIRED)
find_package(Eigen3 REQUIRED NO_MODULE)
if(NOT TARGET Eigen3::Eigen)
find_package(Threads REQUIRED)
add_library(Eigen3::Eigen IMPORTED INTERFACE)
set_property(TARGET Eigen3::Eigen
PROPERTY INTERFACE_COMPILE_DEFINITIONS ${EIGEN3_DEFINITIONS})
set_property(TARGET Eigen3::Eigen
PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${EIGEN3_INCLUDE_DIRS})
install(TARGETS Eigen3::Eigen
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
add_library(eigen IMPORTED INTERFACE)
set_target_properties (eigen PROPERTIES
EXPORT_NAME Eigen
INTERFACE_COMPILE_DEFINITIONS ${EIGEN3_DEFINITIONS}
INTERFACE_INCLUDE_DIRECTORIES ${EIGEN3_INCLUDE_DIRS}
)

install(TARGETS eigen EXPORT Eigen3Targets)
export(TARGETS eigen NAMESPACE Eigen3:: FILE Eigen3Targets.cmake)
install(EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})

endif()

add_library(${PROJECT_NAME} SHARED
Expand Down

0 comments on commit 64d3b69

Please sign in to comment.