lottie: added cmake build system for lottie 14/185014/1
authorsubhransu mohanty <sub.mohanty@samsung.com>
Wed, 25 Jul 2018 07:55:40 +0000 (16:55 +0900)
committersubhransu mohanty <sub.mohanty@samsung.com>
Wed, 25 Jul 2018 07:55:40 +0000 (16:55 +0900)
Change-Id: I8e03709ae668bc221c4ec936317cf579d326876f

CMakeLists.txt [new file with mode: 0644]
inc/CMakeLists.txt [new file with mode: 0644]
src/CMakeLists.txt [new file with mode: 0644]
src/lottie/CMakeLists.txt [new file with mode: 0644]
src/vector/CMakeLists.txt [new file with mode: 0644]
src/vector/freetype/CMakeLists.txt [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..13ebfa6
--- /dev/null
@@ -0,0 +1,51 @@
+cmake_minimum_required( VERSION 3.2 )
+
+#declare project
+project( lottie-player LANGUAGES C CXX )
+
+#declare target
+add_library( lottie-player SHARED  "" )
+
+#declare alias so that library can be used inside the build tree, e.g. when testing
+add_library(lottie-player::lottie-player ALIAS lottie-player)
+
+#declare target compilation options
+target_compile_options(lottie-player
+                    PUBLIC
+                        -std=c++11
+                    PRIVATE
+                        -Wall -fvisibility=hidden)
+
+#declare dependancy
+set( CMAKE_THREAD_PREFER_PTHREAD TRUE )
+find_package( Threads )
+
+target_link_libraries(lottie-player
+                    PUBLIC
+                        "${CMAKE_THREAD_LIBS_INIT}"
+                     )
+
+#declare source and include files
+add_subdirectory(inc)
+add_subdirectory(src)
+
+#install header
+install(FILES inc/lottieplayer.h DESTINATION include)
+
+#install lib
+install( TARGETS lottie-player EXPORT lottie-player-targets
+         LIBRARY     DESTINATION    lib
+         ARCHIVE     DESTINATION    lib
+         INCLUDES    DESTINATION    include
+       )
+
+#install config file.
+install( EXPORT lottie-player-targets
+         FILE          lottie-player.cmake
+         NAMESPACE     lottie-player::
+         DESTINATION   lib/cmake/lottie-player
+       )
+
+
+#Register package in user's package registry
+export(PACKAGE lottie-player)
\ No newline at end of file
diff --git a/inc/CMakeLists.txt b/inc/CMakeLists.txt
new file mode 100644 (file)
index 0000000..adc3dc0
--- /dev/null
@@ -0,0 +1,4 @@
+target_include_directories(lottie-player
+    PRIVATE
+        "${CMAKE_CURRENT_LIST_DIR}"
+    )
\ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..fce73db
--- /dev/null
@@ -0,0 +1,4 @@
+
+add_subdirectory(vector)
+
+add_subdirectory(lottie)
\ No newline at end of file
diff --git a/src/lottie/CMakeLists.txt b/src/lottie/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d6c006d
--- /dev/null
@@ -0,0 +1,14 @@
+
+target_sources(lottie-player
+    PRIVATE
+        "${CMAKE_CURRENT_LIST_DIR}/lottieitem.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/lottieloader.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/lottiemodel.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/lottieparser.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/lottieplayer.cpp"
+    )
+
+target_include_directories(lottie-player
+    PRIVATE
+        "${CMAKE_CURRENT_LIST_DIR}"
+    )
\ No newline at end of file
diff --git a/src/vector/CMakeLists.txt b/src/vector/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e52b019
--- /dev/null
@@ -0,0 +1,28 @@
+
+add_subdirectory(freetype)
+
+target_sources(lottie-player
+    PRIVATE
+        "${CMAKE_CURRENT_LIST_DIR}/vdasher.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vbrush.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vbitmap.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vpainter.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vcompositionfunctions.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vdrawhelper.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vdrawhelper_sse2.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vregion.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vrle.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vpath.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vpathmesure.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vmatrix.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/velapsedtimer.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vdebug.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vinterpolator.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vbezier.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/vraster.cpp"
+    )
+
+target_include_directories(lottie-player
+    PRIVATE
+        "${CMAKE_CURRENT_LIST_DIR}"
+    )
diff --git a/src/vector/freetype/CMakeLists.txt b/src/vector/freetype/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0ce7e69
--- /dev/null
@@ -0,0 +1,11 @@
+target_sources(lottie-player
+    PRIVATE
+        "${CMAKE_CURRENT_LIST_DIR}/v_ft_math.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/v_ft_raster.cpp"
+        "${CMAKE_CURRENT_LIST_DIR}/v_ft_stroker.cpp"
+    )
+
+target_include_directories(lottie-player
+    PRIVATE
+        "${CMAKE_CURRENT_LIST_DIR}"
+    )
\ No newline at end of file