1 cmake_minimum_required( VERSION 3.2 )
4 project( lottie-player LANGUAGES C CXX )
7 add_library( lottie-player SHARED "" )
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)
12 #declare target compilation options
13 target_compile_options(lottie-player
17 -Wall -fvisibility=hidden)
20 set( CMAKE_THREAD_PREFER_PTHREAD TRUE )
21 find_package( Threads )
23 target_link_libraries(lottie-player
25 "${CMAKE_THREAD_LIBS_INIT}"
28 #declare source and include files
33 install(FILES inc/lottieplayer.h DESTINATION include)
36 install( TARGETS lottie-player EXPORT lottie-player-targets
37 LIBRARY DESTINATION lib
38 ARCHIVE DESTINATION lib
39 INCLUDES DESTINATION include
43 install( EXPORT lottie-player-targets
44 FILE lottie-player.cmake
45 NAMESPACE lottie-player::
46 DESTINATION lib/cmake/lottie-player
50 #Register package in user's package registry
51 export(PACKAGE lottie-player)