From 7ce4c903fe8415c2d433b8bdd101f4301763febe Mon Sep 17 00:00:00 2001 From: Longtao Zhang Date: Thu, 2 Mar 2023 15:12:05 +0800 Subject: [PATCH] feat(cmake): add probe rlottie by rlottie::rlottie, disable export when rmlui is a submodule Signed-off-by: Longtao Zhang --- .editorconfig | 5 +++++ CMakeLists.txt | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..65e690fff --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[CMakeLists.txt] +indent_style = tab +indent_size = 4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6adaaab61..052ee5c1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) @@ -1000,6 +1003,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") @@ -1039,4 +1043,5 @@ else() " please update cmake to version which provides CMakePackageConfighelpers module" " or write generators for RmlUiConfig.cmake by yourself.") endif() +endif()