1
1
cmake_minimum_required ( VERSION 3.2 )
2
2
3
3
#declare project
4
- project ( lottie-player VERSION 0.0.1 LANGUAGES C CXX ASM)
4
+ project ( rlottie VERSION 0.0.1 LANGUAGES C CXX ASM)
5
5
6
6
#declare target
7
- add_library ( lottie-player SHARED "" )
7
+ add_library ( rlottie SHARED "" )
8
8
9
9
#declare version of the target
10
10
set (player_version_major 0)
11
11
set (player_version_minor 0)
12
12
set (player_version_patch 1)
13
13
set (player_version ${player_version_major} .${player_version_minor} .${player_version_patch} )
14
- set_target_properties (lottie-player PROPERTIES
14
+ set_target_properties (rlottie PROPERTIES
15
15
VERSION ${player_version}
16
16
SOVERSION ${player_version_major}
17
17
)
18
18
19
19
#declare alias so that library can be used inside the build tree, e.g. when testing
20
- add_library (lottie-player::lottie-player ALIAS lottie-player )
20
+ add_library (rlottie::rlottie ALIAS rlottie )
21
21
22
22
#declare target compilation options
23
- target_compile_options (lottie-player
23
+ target_compile_options (rlottie
24
24
PUBLIC
25
25
-std=c++14
26
26
PRIVATE
@@ -30,17 +30,17 @@ target_compile_options(lottie-player
30
30
set ( CMAKE_THREAD_PREFER_PTHREAD TRUE )
31
31
find_package ( Threads )
32
32
33
- target_link_libraries (lottie-player
33
+ target_link_libraries (rlottie
34
34
PUBLIC
35
35
"${CMAKE_THREAD_LIBS_INIT} "
36
36
)
37
37
38
38
# for dlopen, dlsym and dlclose dependancy
39
- target_link_libraries (lottie-player
39
+ target_link_libraries (rlottie
40
40
PRIVATE
41
41
${CMAKE_DL_LIBS} )
42
42
43
- target_link_libraries (lottie-player
43
+ target_link_libraries (rlottie
44
44
PUBLIC
45
45
"-Wl,--no-undefined"
46
46
)
@@ -53,9 +53,14 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
53
53
SET (EXEC_DIR ${PREFIX} )
54
54
SET (LIBDIR ${LIB_INSTALL_DIR} )
55
55
SET (INCDIR ${PREFIX} /include )
56
- CONFIGURE_FILE (${PROJECT_NAME} .pc.in ${PROJECT_NAME} .pc @ONLY )
56
+ CONFIGURE_FILE (${PROJECT_NAME} .pc.in ${PROJECT_NAME} .pc)
57
57
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR} /${PROJECT_NAME} .pc DESTINATION ${LIB_INSTALL_DIR} /pkgconfig)
58
58
59
+ #temporary for lottie-player dependency.
60
+ CONFIGURE_FILE (${PROJECT_NAME} .pc.in lottie-player.pc)
61
+ INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR} /lottie-player.pc DESTINATION ${LIB_INSTALL_DIR} /pkgconfig)
62
+
63
+
59
64
#install header
60
65
install (FILES
61
66
inc/rlottie.h
@@ -65,44 +70,44 @@ install(FILES
65
70
DESTINATION include )
66
71
67
72
#install lib
68
- install ( TARGETS lottie-player EXPORT lottie-player -targets
73
+ install ( TARGETS rlottie EXPORT rlottie -targets
69
74
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
70
75
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
71
76
INCLUDES DESTINATION include
72
77
)
73
78
74
79
#install config file.
75
80
76
- install ( EXPORT lottie-player -targets
77
- FILE lottie-playerTargets .cmake
78
- NAMESPACE lottie-player ::
79
- DESTINATION ${LIB_INSTALL_DIR} /cmake/lottie-player
81
+ install ( EXPORT rlottie -targets
82
+ FILE rlottieTargets .cmake
83
+ NAMESPACE rlottie ::
84
+ DESTINATION ${LIB_INSTALL_DIR} /cmake/rlottie
80
85
)
81
86
82
87
83
88
#Create a ConfigVersion.cmake file
84
89
include (CMakePackageConfigHelpers)
85
90
write_basic_package_version_file(
86
- ${CMAKE_CURRENT_BINARY_DIR} /lottie-playerConfigVersion .cmake
91
+ ${CMAKE_CURRENT_BINARY_DIR} /rlottieConfigVersion .cmake
87
92
VERSION ${PROJECT_VERSION}
88
93
COMPATIBILITY AnyNewerVersion
89
94
)
90
95
91
- configure_package_config_file(${CMAKE_CURRENT_LIST_DIR} /cmake/lottie-playerConfig .cmake.in
92
- ${CMAKE_CURRENT_BINARY_DIR} /lottie-playerConfig .cmake
93
- INSTALL_DESTINATION ${LIB_INSTALL_DIR} /cmake/lottie-player
96
+ configure_package_config_file(${CMAKE_CURRENT_LIST_DIR} /cmake/rlottieConfig .cmake.in
97
+ ${CMAKE_CURRENT_BINARY_DIR} /rlottieConfig .cmake
98
+ INSTALL_DESTINATION ${LIB_INSTALL_DIR} /cmake/rlottie
94
99
)
95
100
96
101
#Install the config, configversion and custom find modules
97
102
install (FILES
98
- ${CMAKE_CURRENT_BINARY_DIR} /lottie-playerConfig .cmake
99
- ${CMAKE_CURRENT_BINARY_DIR} /lottie-playerConfigVersion .cmake
100
- DESTINATION ${LIB_INSTALL_DIR} /cmake/lottie-player
103
+ ${CMAKE_CURRENT_BINARY_DIR} /rlottieConfig .cmake
104
+ ${CMAKE_CURRENT_BINARY_DIR} /rlottieConfigVersion .cmake
105
+ DESTINATION ${LIB_INSTALL_DIR} /cmake/rlottie
101
106
)
102
107
103
108
104
- export (EXPORT lottie-player- targets FILE ${CMAKE_CURRENT_BINARY_DIR} /lottie-playerTargets .cmake NAMESPACE lottie-player ::)
109
+ export (EXPORT rlottie- targets FILE ${CMAKE_CURRENT_BINARY_DIR} /rlottieTargets .cmake NAMESPACE rlottie ::)
105
110
106
111
#Register package in user's package registry
107
- export (PACKAGE lottie-player )
112
+ export (PACKAGE rlottie )
108
113
0 commit comments