From d7084820c3fc3c84c578f88cf1b9ea392450560b Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Tue, 31 Jul 2018 14:57:12 +0900 Subject: [PATCH] lottie: remove hardcoding pathes in pkgconfig file. (.pc) Change-Id: I284cc1fc0af6f58e0da16ea8ab3d17de7f3b4286 --- CMakeLists.txt | 4 ++++ lottie-player.pc.in | 12 ++++++------ packaging/lottie-player.spec | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a04e59..453da55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,10 @@ target_link_libraries(lottie-player 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) diff --git a/lottie-player.pc.in b/lottie-player.pc.in index b56cc46..f7ea6f0 100644 --- a/lottie-player.pc.in +++ b/lottie-player.pc.in @@ -1,12 +1,12 @@ -prefix=/usr -exec_prefix=/usr -apiversion=0.0.1 -libdir=/usr/lib -includedir=/usr/include +prefix=@PREFIX@ +exec_prefix=@EXEC_DIR@ +apiversion=@player_version@ +libdir=@LIBDIR@ +includedir=@INCDIR@ Name: lottie-player Description: A lottie-player library -Version: @VERSION@ +Version: @player_version@ Requires: Libs: -L${libdir} -llottie-player Cflags: -I${includedir} -std=c++14 diff --git a/packaging/lottie-player.spec b/packaging/lottie-player.spec index b1e4acd..0f96d78 100644 --- a/packaging/lottie-player.spec +++ b/packaging/lottie-player.spec @@ -33,8 +33,8 @@ export CFLAGS+=" -fvisibility=hidden -fPIC -Wall -O2" export LDFLAGS+=" " -cmake \ - . -DCMAKE_INSTALL_PREFIX=/usr +cmake . -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_INSTALL_DIR:PATH=%{_libdir} make %{?jobs:-j%jobs} -- 2.7.4