13ebfa6ffa6bb6aaebe170ecb71da083696b0cef
[platform/core/uifw/lottie-player.git] / CMakeLists.txt
1 cmake_minimum_required( VERSION 3.2 )
2
3 #declare project
4 project( lottie-player LANGUAGES C CXX )
5
6 #declare target
7 add_library( lottie-player SHARED  "" )
8
9 #declare alias so that library can be used inside the build tree, e.g. when testing
10 add_library(lottie-player::lottie-player ALIAS lottie-player)
11
12 #declare target compilation options
13 target_compile_options(lottie-player
14                     PUBLIC
15                         -std=c++11
16                     PRIVATE
17                         -Wall -fvisibility=hidden)
18
19 #declare dependancy
20 set( CMAKE_THREAD_PREFER_PTHREAD TRUE )
21 find_package( Threads )
22
23 target_link_libraries(lottie-player
24                     PUBLIC
25                         "${CMAKE_THREAD_LIBS_INIT}"
26                      )
27
28 #declare source and include files
29 add_subdirectory(inc)
30 add_subdirectory(src)
31
32 #install header
33 install(FILES inc/lottieplayer.h DESTINATION include)
34
35 #install lib
36 install( TARGETS lottie-player EXPORT lottie-player-targets
37          LIBRARY     DESTINATION    lib
38          ARCHIVE     DESTINATION    lib
39          INCLUDES    DESTINATION    include
40        )
41
42 #install config file.
43 install( EXPORT lottie-player-targets
44          FILE          lottie-player.cmake
45          NAMESPACE     lottie-player::
46          DESTINATION   lib/cmake/lottie-player
47        )
48
49
50 #Register package in user's package registry
51 export(PACKAGE lottie-player)