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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9c65bc1  ORC-640: [C++] Support consumption as CMake submodule
9c65bc1 is described below

commit 9c65bc116a2208d5d729687b7744b2ffbd72fea0
Author: Thomas Bodner <[email protected]>
AuthorDate: Wed Jun 10 06:25:36 2020 +0200

    ORC-640: [C++] Support consumption as CMake submodule
    
    * Support consumption as CMake submodule
    * Fix path for Protobuf
    
    This fixes #510
---
 CMakeLists.txt         | 5 ++++-
 c++/src/CMakeLists.txt | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e67b2d..45aba03 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,9 @@
 # limitations under the License.
 
 cmake_minimum_required (VERSION 2.6)
+if (POLICY CMP0048)
+    cmake_policy(SET CMP0048 NEW)
+endif ()
 
 project(ORC C CXX)
 
@@ -19,7 +22,7 @@ SET(CPACK_PACKAGE_VERSION_MAJOR "1")
 SET(CPACK_PACKAGE_VERSION_MINOR "7")
 SET(CPACK_PACKAGE_VERSION_PATCH "0-SNAPSHOT")
 SET(ORC_VERSION 
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} 
"${PROJECT_SOURCE_DIR}/cmake_modules")
 
 option (BUILD_JAVA
     "Include ORC Java library in the build process"
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 12a51e8..7ff543d 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -184,9 +184,9 @@ include_directories (
 
 add_custom_command(OUTPUT orc_proto.pb.h orc_proto.pb.cc
    COMMAND ${PROTOBUF_EXECUTABLE}
-        -I ${CMAKE_SOURCE_DIR}/proto
+        -I ${PROJECT_SOURCE_DIR}/proto
         --cpp_out="${CMAKE_CURRENT_BINARY_DIR}"
-        "${CMAKE_SOURCE_DIR}/proto/orc_proto.proto"
+        "${PROJECT_SOURCE_DIR}/proto/orc_proto.proto"
 )
 
 set(SOURCE_FILES

Reply via email to