X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=CMakeLists.txt;h=1e9b01d454aaf565cd3acb6f38c14d7969628f56;hb=27a774b0e5cbfa9f60c382f2755ffb3845084bdc;hp=a42fbc20a3d51f3fec2474d6ca44ea37482a3956;hpb=970dd837359bb7c5fe47ef17ffef65912c6b86e4;p=platform%2Fcore%2Fuifw%2Flottie-player.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a42fbc2..1e9b01d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,20 +1,30 @@ cmake_minimum_required( VERSION 3.2 ) #declare project -project( lottie-player LANGUAGES C CXX ) +project( lottie-player VERSION 0.0.1 LANGUAGES C CXX ASM) #declare target add_library( lottie-player SHARED "" ) +#declare version of the target +set(player_version_major 0) +set(player_version_minor 0) +set(player_version_patch 1) +set(player_version ${player_version_major}.${player_version_minor}.${player_version_patch} ) +set_target_properties(lottie-player PROPERTIES + VERSION ${player_version} + SOVERSION ${player_version_major} + ) + #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 + -std=c++14 PRIVATE - -Wall -fvisibility=hidden) + -Wall -fvisibility=hidden -O2) #declare dependancy set( CMAKE_THREAD_PREFER_PTHREAD TRUE ) @@ -25,30 +35,64 @@ target_link_libraries(lottie-player "${CMAKE_THREAD_LIBS_INIT}" ) +target_link_libraries(lottie-player + PUBLIC + "-Wl,--no-undefined" + ) + #declare source and include files add_subdirectory(inc) add_subdirectory(src) +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(EXEC_DIR ${PREFIX}) +SET(LIBDIR ${LIB_INSTALL_DIR}) +SET(INCDIR ${PREFIX}/include) CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) #install header -install(FILES inc/lottieplayer.h DESTINATION include) +install(FILES inc/lottieanimation.h inc/lottieanimation_capi.h inc/lottiecommon.h DESTINATION include) #install lib install( TARGETS lottie-player EXPORT lottie-player-targets - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} INCLUDES DESTINATION include ) #install config file. + install( EXPORT lottie-player-targets - FILE lottie-player.cmake + FILE lottie-playerTargets.cmake NAMESPACE lottie-player:: - DESTINATION lib/cmake/lottie-player + DESTINATION ${LIB_INSTALL_DIR}/cmake/lottie-player ) +#Create a ConfigVersion.cmake file +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/lottie-playerConfigVersion.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion +) + +configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/cmake/lottie-playerConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/lottie-playerConfig.cmake + INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/lottie-player +) + +#Install the config, configversion and custom find modules +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/lottie-playerConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/lottie-playerConfigVersion.cmake + DESTINATION ${LIB_INSTALL_DIR}/cmake/lottie-player +) + + +export(EXPORT lottie-player-targets FILE ${CMAKE_CURRENT_BINARY_DIR}/lottie-playerTargets.cmake NAMESPACE lottie-player::) + #Register package in user's package registry export(PACKAGE lottie-player) +