You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by dk...@apache.org on 2020/05/26 12:35:39 UTC

[avro] branch master updated: cmake: Use GNUInstallDirs instead of hard-coded paths

This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 664c2fc  cmake: Use GNUInstallDirs instead of hard-coded paths
664c2fc is described below

commit 664c2fc7fba19709c1f974055f9cf4c8a799e108
Author: Khem Raj <ra...@gmail.com>
AuthorDate: Thu Dec 19 18:23:41 2019 -0800

    cmake: Use GNUInstallDirs instead of hard-coded paths
    
    This ensures that it can be built on platforms where libdir is not
    /usr/lib e.g. ppc64
    
    Signed-off-by: Khem Raj <ra...@gmail.com>
    Closes #749
---
 lang/c/CMakeLists.txt     |  4 ++--
 lang/c/src/CMakeLists.txt | 16 +++++++++-------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/lang/c/CMakeLists.txt b/lang/c/CMakeLists.txt
index b75418c..6c8d7aa 100644
--- a/lang/c/CMakeLists.txt
+++ b/lang/c/CMakeLists.txt
@@ -16,8 +16,8 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-cmake_minimum_required(VERSION 2.4)
-project(AvroC C)
+cmake_minimum_required(VERSION 3.1)
+project(AvroC)
 enable_testing()
 
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR})
diff --git a/lang/c/src/CMakeLists.txt b/lang/c/src/CMakeLists.txt
index 6f56597..c1761c8 100644
--- a/lang/c/src/CMakeLists.txt
+++ b/lang/c/src/CMakeLists.txt
@@ -106,17 +106,19 @@ install(DIRECTORY
         DESTINATION include
         FILES_MATCHING PATTERN "*.h")
 
+include(GNUInstallDirs)
+
 if (WIN32)
 install(TARGETS avro-static
-        RUNTIME DESTINATION bin
-        LIBRARY DESTINATION lib
-        ARCHIVE DESTINATION lib
+	RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
        )
 else(WIN32)
 install(TARGETS avro-static avro-shared
-        RUNTIME DESTINATION bin
-        LIBRARY DESTINATION lib
-        ARCHIVE DESTINATION lib
+	RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
        )
 endif(WIN32)
 
@@ -126,7 +128,7 @@ set(prefix ${CMAKE_INSTALL_PREFIX})
 set(VERSION ${AVRO_VERSION})
 configure_file(avro-c.pc.in avro-c.pc)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/avro-c.pc
-        DESTINATION lib/pkgconfig)
+        DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
 
 add_executable(avrocat avrocat.c)
 target_link_libraries(avrocat avro-static)