Skip to content

Commit

Permalink
Only export RmlUi targets when it is the root project
Browse files Browse the repository at this point in the history
  • Loading branch information
mikke89 committed Apr 6, 2024
1 parent 9f5d3c7 commit bf4f758
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,16 @@ endif()
set_target_properties(rmlui PROPERTIES EXPORT_NAME "RmlUi")
install(TARGETS rmlui EXPORT RmlUiTargets)

install(EXPORT RmlUiTargets
DESTINATION "${RMLUI_INSTALL_TARGETS_DIR}"
NAMESPACE RmlUi::
FILE RmlUiTargets.cmake
)
if(RMLUI_IS_ROOT_PROJECT)
# Skip installing any targets when RmlUi is included using `add_subdirectory`. Otherwise, if any of RmlUi's linked
# dependencies are not exported, then this results in errors about the dependency not being in any export set.
install(EXPORT RmlUiTargets
DESTINATION "${RMLUI_INSTALL_TARGETS_DIR}"
NAMESPACE RmlUi::
FILE RmlUiTargets.cmake
)
endif()

install(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/Include/RmlUi"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
Expand Down

0 comments on commit bf4f758

Please sign in to comment.