lottie: add pc file for lottie player
[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 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
33 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
34
35 #install header
36 install(FILES inc/lottieplayer.h DESTINATION include)
37
38 #install lib
39 install( TARGETS lottie-player EXPORT lottie-player-targets
40          LIBRARY     DESTINATION    lib
41          ARCHIVE     DESTINATION    lib
42          INCLUDES    DESTINATION    include
43        )
44
45 #install config file.
46 install( EXPORT lottie-player-targets
47          FILE          lottie-player.cmake
48          NAMESPACE     lottie-player::
49          DESTINATION   lib/cmake/lottie-player
50        )
51
52
53 #Register package in user's package registry
54 export(PACKAGE lottie-player)