[meta-oe] glog: fix installation path

Submitted by Vyacheslav Yurkov on Dec. 5, 2018, 12:13 p.m. | Patch ID: 156922

Details

Message ID 20181205121357.116604-1-uvv.mail@gmail.com
State Accepted
Commit f2e848c23efff76110d0083b575ea30fc59e9c12
Headers show

Commit Message

Vyacheslav Yurkov Dec. 5, 2018, 12:13 p.m.
From: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>

When glog is compiled with multilib support, it shouldn't use hardcoded paths.
Paths substitued by CMake should be used instead.

Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
Tested-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 .../glog/0003-installation-path-fix.patch     | 65 +++++++++++++++++++
 meta-oe/recipes-support/glog/glog_0.3.5.bb    |  1 +
 2 files changed, 66 insertions(+)
 create mode 100644 meta-oe/recipes-support/glog/glog/0003-installation-path-fix.patch

Patch hide | download patch | download mbox

diff --git a/meta-oe/recipes-support/glog/glog/0003-installation-path-fix.patch b/meta-oe/recipes-support/glog/glog/0003-installation-path-fix.patch
new file mode 100644
index 000000000..641f70cb2
--- /dev/null
+++ b/meta-oe/recipes-support/glog/glog/0003-installation-path-fix.patch
@@ -0,0 +1,65 @@ 
+diff -uNr a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt	2018-12-05 12:55:59.630792054 +0100
++++ b/CMakeLists.txt	2018-12-05 13:00:22.922269200 +0100
+@@ -403,10 +403,15 @@
+ 
+ set_target_properties (glog PROPERTIES PUBLIC_HEADER "${GLOG_PUBLIC_H}")
+ 
++set (_glog_CMake_BINDIR ${CMAKE_INSTALL_BINDIR})
++set (_glog_CMake_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR})
++set (_glog_CMake_LIBDIR ${CMAKE_INSTALL_LIBDIR})
++set (_glog_CMake_INSTALLDIR ${_glog_CMake_LIBDIR}/cmake/glog)
++
+ target_include_directories (glog BEFORE PUBLIC
+   "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
+   "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
+-  "$<INSTALL_INTERFACE:include>"
++  "$<INSTALL_INTERFACE:${_glog_CMake_INCLUDE_DIR}>"
+   PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
+   PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
+ 
+@@ -543,10 +548,10 @@
+ 
+ install (TARGETS glog
+   EXPORT glog-targets
+-  RUNTIME DESTINATION bin
+-  PUBLIC_HEADER DESTINATION include/glog
+-  LIBRARY DESTINATION lib
+-  ARCHIVE DESTINATION lib)
++  RUNTIME DESTINATION ${_glog_CMake_BINDIR}
++  PUBLIC_HEADER DESTINATION ${_glog_CMake_INCLUDE_DIR}/glog
++  LIBRARY DESTINATION ${_glog_CMake_LIBDIR}
++  ARCHIVE DESTINATION ${_glog_CMake_LIBDIR})
+ 
+ if (gflags_FOUND)
+   set (gflags_DEPENDENCY "find_dependency (gflags ${gflags_VERSION})")
+@@ -554,7 +559,7 @@
+ 
+ configure_package_config_file (glog-config.cmake.in
+   ${CMAKE_CURRENT_BINARY_DIR}/glog-config.cmake
+-  INSTALL_DESTINATION lib/cmake/glog
++  INSTALL_DESTINATION ${_glog_CMake_INSTALLDIR}
+   NO_CHECK_REQUIRED_COMPONENTS_MACRO)
+ 
+ write_basic_package_version_file (glog-config-version.cmake VERSION
+@@ -567,6 +572,7 @@
+   ${CMAKE_CURRENT_BINARY_DIR}/glog-config.cmake
+   ${CMAKE_CURRENT_BINARY_DIR}/glog-config-version.cmake
+   ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLibunwind.cmake
+-  DESTINATION lib/cmake/glog)
++  DESTINATION ${_glog_CMake_INSTALLDIR})
+ 
+-install (EXPORT glog-targets NAMESPACE glog:: DESTINATION lib/cmake/glog)
++install (EXPORT glog-targets NAMESPACE glog:: DESTINATION
++  ${_glog_CMake_INSTALLDIR})
+diff -uNr a/glog-config.cmake.in b/glog-config.cmake.in
+--- a/glog-config.cmake.in	2018-12-05 12:55:59.630792054 +0100
++++ b/glog-config.cmake.in	2018-12-05 13:05:19.547196843 +0100
+@@ -4,6 +4,7 @@
+ 
+ @gflags_DEPENDENCY@
+ 
++list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
+ find_dependency (Libunwind)
+ 
+ include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake")
diff --git a/meta-oe/recipes-support/glog/glog_0.3.5.bb b/meta-oe/recipes-support/glog/glog_0.3.5.bb
index 5e58450c2..3de01ef5b 100644
--- a/meta-oe/recipes-support/glog/glog_0.3.5.bb
+++ b/meta-oe/recipes-support/glog/glog_0.3.5.bb
@@ -12,6 +12,7 @@  SRC_URI = " \
     git://github.com/google/glog.git;branch=v035 \
     file://0001-Rework-CMake-glog-VERSION-management.patch \
     file://0002-Find-Libunwind-during-configure.patch \
+    file://0003-installation-path-fix.patch \
 "
 
 SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26"