Skip to content

Commit

Permalink
CMake: Allow rlottie to a be added using the target rlottie::rlottie,…
Browse files Browse the repository at this point in the history
… disable export when rmlui is a submodule (mikke89#397)

Signed-off-by: Longtao Zhang <DragonBillow@outlook.com>
  • Loading branch information
cathaysia authored and igorsegallafa committed Mar 12, 2023
1 parent f79ce2a commit a2bd542
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[CMakeLists.txt]
indent_style = tab
indent_size = 4
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,10 @@ if(BUILD_LUA_BINDINGS)
endif()

# rlottie
if( ENABLE_LOTTIE_PLUGIN )
if( ENABLE_LOTTIE_PLUGIN AND TARGET rlottie::rlottie )
list(APPEND CORE_LINK_LIBS rlottie::rlottie)
list(APPEND CORE_INCLUDE_DIRS rlottie::rlottie)
elseif( ENABLE_LOTTIE_PLUGIN )
# Try to find the rlottie library.
if(NOT DEFINED rlottie_DIR)
set(rlottie_DIR $ENV{RLOTTIE_DIR})
Expand Down Expand Up @@ -1008,6 +1011,7 @@ endif()
include(CMakePackageConfigHelpers OPTIONAL RESULT_VARIABLE PkgHelpers_AVAILABLE)

# guard against older versions of cmake which do not provide it
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
if(PkgHelpers_AVAILABLE)
set (INCLUDE_INSTALL_DIR "include")
set (LIB_INSTALL_DIR "lib")
Expand Down Expand Up @@ -1047,4 +1051,5 @@ else()
" please update cmake to version which provides CMakePackageConfighelpers module"
" or write generators for RmlUiConfig.cmake by yourself.")
endif()
endif()

0 comments on commit a2bd542

Please sign in to comment.