parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject parquet-cpp git commit: PARQUET-1070 Add CPack support to the build
Date Thu, 12 Oct 2017 18:16:57 GMT
Repository: parquet-cpp
Updated Branches:
  refs/heads/master 2a4fab5a2 -> a1c950d88


PARQUET-1070 Add CPack support to the build

Author: Mike Trinkala <trink@acm.org>

Closes #409 from trink/PARQUET-1070 and squashes the following commits:

dafee2c [Mike Trinkala] PARQUET-1070: Add CPack support to the build


Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/a1c950d8
Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/a1c950d8
Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/a1c950d8

Branch: refs/heads/master
Commit: a1c950d889a22b267ecddaa3436d3494fcca3ae7
Parents: 2a4fab5
Author: Mike Trinkala <trink@acm.org>
Authored: Thu Oct 12 14:16:51 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Thu Oct 12 14:16:51 2017 -0400

----------------------------------------------------------------------
 CMakeLists.txt                           | 41 ++++++++++++++++++++++++---
 cmake_modules/parquet-cppConfig.cmake.in | 15 ++++++++++
 2 files changed, 52 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/a1c950d8/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6989fa..5aa8b93 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,10 +18,25 @@
 # Require cmake that supports BYPRODUCTS in add_custom_command, ExternalProject_Add [1].
 cmake_minimum_required(VERSION 3.2.0)
 
-project(parquet-cpp)
-
 file(READ "${CMAKE_CURRENT_SOURCE_DIR}/.parquetcppversion" PARQUET_VERSION)
 string(REPLACE "\n" "" PARQUET_VERSION "${PARQUET_VERSION}")
+string(REGEX MATCH "^([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?)" VERSION ${PARQUET_VERSION})
+if(NOT VERSION)
+  message(FATAL_ERROR "invalid .parquetcppversion")
+endif()
+
+project(parquet-cpp VERSION ${VERSION})
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ library to read and write the Apache Parquet columnar
data format")
+set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
+set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
+set(CPACK_PACKAGE_VENDOR        "Apache Software Foundation")
+set(CPACK_PACKAGE_CONTACT       "Apache Parquet Development <dev@parquet.apache.org>")
+set(CPACK_STRIP_FILES           TRUE)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
+set(CPACK_DEBIAN_FILE_NAME      "DEB-DEFAULT")
+set(CPACK_RPM_FILE_NAME         "RPM-DEFAULT")
+set(CPACK_RPM_PACKAGE_LICENSE   "Apache v2.0")
 
 include(ExternalProject)
 include(FindPkgConfig)
@@ -34,8 +49,26 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
 include(GNUInstallDirs)
 
-set(PARQUET_SO_VERSION "1")
-set(PARQUET_ABI_VERSION "${PARQUET_SO_VERSION}.0.0")
+set(PARQUET_SO_VERSION ${PROJECT_VERSION_MAJOR})
+set(PARQUET_ABI_VERSION ${PROJECT_VERSION})
+if(WIN32)
+  set(INSTALL_CMAKE_DIR cmake)
+else()
+  set(INSTALL_CMAKE_DIR "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake")
+endif()
+set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+include(CPack)
+
+include(CMakePackageConfigHelpers)
+configure_package_config_file(cmake_modules/${PROJECT_NAME}Config.cmake.in
+                              ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+                              INSTALL_DESTINATION ${INSTALL_CMAKE_DIR}
+                              PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR)
+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+                                 COMPATIBILITY SameMajorVersion)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+              ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+DESTINATION ${INSTALL_CMAKE_DIR})
 
 if (NOT "$ENV{PARQUET_GCC_ROOT}" STREQUAL "")
   set(GCC_ROOT $ENV{PARQUET_GCC_ROOT})

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/a1c950d8/cmake_modules/parquet-cppConfig.cmake.in
----------------------------------------------------------------------
diff --git a/cmake_modules/parquet-cppConfig.cmake.in b/cmake_modules/parquet-cppConfig.cmake.in
new file mode 100644
index 0000000..02e0d23
--- /dev/null
+++ b/cmake_modules/parquet-cppConfig.cmake.in
@@ -0,0 +1,15 @@
+set(PARQUET-CPP_VERSION x.y.z)
+
+@PACKAGE_INIT@
+
+set_and_check(PARQUET-CPP_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
+set_and_check(PARQUET-CPP_LIB_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
+
+set(_TMP_SUFFIX ${CMAKE_FIND_LIBRARY_SUFFIXES})
+FIND_LIBRARY(PARQUET_LIBRARY NAMES parquet PATHS ${PARQUET-CPP_LIB_DIR})
+set(PARQUET-CPP_LIBRARIES ${PARQUET_LIBRARY})
+
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+FIND_LIBRARY(PARQUET_STATIC_LIBRARY NAMES parquet PATHS ${PARQUET-CPP_LIB_DIR})
+set(PARQUET-CPP_STATIC_LIBRARIES ${PARQUET_STATIC_LIBRARY})
+set(CMAKE_FIND_LIBRARY_SUFFIXES ${_TMP_SUFFIX})


Mime
View raw message