[Cmake-commits] CMake branch, next, updated. v2.8.4-1696-g3f18b6c

Philip Lowman philip at yhbt.com
Tue Jun 7 01:11:37 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  3f18b6c49ac0809e88e54e2a9981cbbfb0a17261 (commit)
       via  51c786058989be0fb83f4f54c92ce8ea9856ae8d (commit)
       via  c7c2c4cc987a9290f08602fada86bf053ab9c867 (commit)
       via  44310e95d63edd71974ad223a4f39e6ca74bf630 (commit)
       via  08b109a87f43406f70a125552a2e0aaf54d3b782 (commit)
      from  6e076e9413ff2c66088894def809d248880d432e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f18b6c49ac0809e88e54e2a9981cbbfb0a17261
commit 3f18b6c49ac0809e88e54e2a9981cbbfb0a17261
Merge: 6e076e9 51c7860
Author:     Philip Lowman <philip at yhbt.com>
AuthorDate: Tue Jun 7 01:11:34 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jun 7 01:11:34 2011 -0400

    Merge topic '10997_PROTOBDUF_GENERATE_CPP_returns_wrong_path' into next
    
    51c7860 10997: PROTOBUF_GENERATE_CPP now supports proto files outside current dir
    c7c2c4c Revert previous patch to 10997, doesn't work for include directive
    44310e9 Merge branch 'master' of git://public.kitware.com/cmake into 10997_PROTOBDUF_GENERATE_CPP_returns_wrong_path
    08b109a KWSys Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51c786058989be0fb83f4f54c92ce8ea9856ae8d
commit 51c786058989be0fb83f4f54c92ce8ea9856ae8d
Author:     Philip Lowman <philip at yhbt.com>
AuthorDate: Tue Jun 7 01:07:41 2011 -0400
Commit:     Philip Lowman <philip at yhbt.com>
CommitDate: Tue Jun 7 01:07:41 2011 -0400

    10997: PROTOBUF_GENERATE_CPP now supports proto files outside current dir

diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index de1e569..b8929ad 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -73,6 +73,20 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
     return()
   endif(NOT ARGN)
 
+  if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
+    # Create an include path for each file specified
+    foreach(FIL ${ARGN})
+      get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
+      get_filename_component(ABS_PATH ${ABS_FIL} PATH)
+      list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
+      if(${_contains_already} EQUAL -1)
+          list(APPEND _protobuf_include_path -I ${ABS_PATH})
+      endif()
+    endforeach()
+  else()
+    set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
+  endif()
+
   set(${SRCS})
   set(${HDRS})
   foreach(FIL ${ARGN})
@@ -86,7 +100,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
       OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
              "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
       COMMAND  ${PROTOBUF_PROTOC_EXECUTABLE}
-      ARGS --cpp_out  ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} ${ABS_FIL}
+      ARGS --cpp_out  ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
       DEPENDS ${ABS_FIL}
       COMMENT "Running C++ protocol buffer compiler on ${FIL}"
       VERBATIM )
@@ -125,11 +139,17 @@ function(_protobuf_find_libraries name filename)
    endif()
 endfunction()
 
-
 #
 # Main.
 #
 
+# By default have PROTOBUF_GENERATE_CPP macro pass -I to protoc
+# for each directory where a proto file is referenced.
+if(NOT DEFINED PROTOBUF_GENERATE_CPP_APPEND_PATH)
+  set(PROTOBUF_GENERATE_CPP_APPEND_PATH TRUE)
+endif()
+
+
 # Google's provided vcproj files generate libraries with a "lib"
 # prefix on Windows
 if(MSVC)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7c2c4cc987a9290f08602fada86bf053ab9c867
commit c7c2c4cc987a9290f08602fada86bf053ab9c867
Author:     Philip Lowman <philip at yhbt.com>
AuthorDate: Tue Jun 7 00:54:09 2011 -0400
Commit:     Philip Lowman <philip at yhbt.com>
CommitDate: Tue Jun 7 00:54:09 2011 -0400

    Revert previous patch to 10997, doesn't work for include directive

diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 07110c9..de1e569 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -77,8 +77,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
   set(${HDRS})
   foreach(FIL ${ARGN})
     get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
-    file(RELATIVE_PATH REL_FIL ${CMAKE_CURRENT_SOURCE_DIR} ${ABS_FIL})
-    string(REGEX REPLACE ".proto$" "" FIL_WE ${REL_FIL})
+    get_filename_component(FIL_WE ${FIL} NAME_WE)
 
     list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
     list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44310e95d63edd71974ad223a4f39e6ca74bf630
commit 44310e95d63edd71974ad223a4f39e6ca74bf630
Merge: abd9327 08b109a
Author:     Philip Lowman <philip at yhbt.com>
AuthorDate: Tue Jun 7 00:48:21 2011 -0400
Commit:     Philip Lowman <philip at yhbt.com>
CommitDate: Tue Jun 7 00:48:21 2011 -0400

    Merge branch 'master' of git://public.kitware.com/cmake into 10997_PROTOBDUF_GENERATE_CPP_returns_wrong_path


-----------------------------------------------------------------------

Summary of changes:
 Modules/FindProtobuf.cmake        |   27 +++++++++++++++++++++++----
 Source/kwsys/kwsysDateStamp.cmake |    2 +-
 2 files changed, 24 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list