From a2bd542a989306fe7b0071f753517494b07f5b4b Mon Sep 17 00:00:00 2001 From: DragonBillow <42114817+cathaysia@users.noreply.github.com> Date: Fri, 3 Mar 2023 04:45:46 +0800 Subject: [PATCH] CMake: Allow rlottie to a be added using the target rlottie::rlottie, disable export when rmlui is a submodule (#397) 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 043e69641..20c941730 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}) @@ -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") @@ -1047,4 +1051,5 @@ else() " please update cmake to version which provides CMakePackageConfighelpers module" " or write generators for RmlUiConfig.cmake by yourself.") endif() +endif()