Skip to content

Commit

Permalink
Add git submodule init command
Browse files Browse the repository at this point in the history
Summary:
aaronmarkham
Closes facebookarchive#237

Differential Revision: D4808930

Pulled By: Yangqing

fbshipit-source-id: c598fac789e97280d12961b0be257607ebf82244
  • Loading branch information
Yangqing authored and facebook-github-bot committed Mar 31, 2017
1 parent 0055d28 commit db0499c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ project(Caffe2 CXX C)
# We want CMake to GLOB everything every time.
execute_process(COMMAND find "${PROJECT_SOURCE_DIR}" -name "CMakeLists.txt" -exec touch {} \;)

# We want to make sure that all submodules are being properly initialized, if
# one is building from a git checkout.
find_package(Git)
if (GIT_FOUND)
execute_process(COMMAND git submodule update --init)
endif()

# Useful functions.
function (exclude OUTPUT INPUT)
set(EXCLUDES ${ARGN})
Expand Down
14 changes: 3 additions & 11 deletions cmake/Summary.cmake
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# Prints accumulated Caffe2 configuration summary
function (Caffe2_print_configuration_summary)

find_package(Git)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
OUTPUT_VARIABLE Caffe_GIT_VERSION
OUTPUT_VARIABLE Caffe2_GIT_VERSION
RESULT_VARIABLE __git_result)
if(NOT ${__git_result} EQUAL 0)
set(Caffe_GIT_VERSION "unknown")
set(Caffe2_GIT_VERSION "unknown")
endif()
endif()

message(STATUS "")
message(STATUS "******** Summary ********")
message(STATUS "General:")
message(STATUS " Version : ${Caffe2_VERSION}")
message(STATUS " Git : ${Caffe2_GIT_VERSION}")
message(STATUS " Git version : ${Caffe2_GIT_VERSION}")
message(STATUS " System : ${CMAKE_SYSTEM_NAME}")
message(STATUS " C++ compiler : ${CMAKE_CXX_COMPILER}")
message(STATUS " Protobuf compiler : ${PROTOBUF_PROTOC_EXECUTABLE}")
Expand All @@ -43,14 +41,8 @@ function (Caffe2_print_configuration_summary)
endif()

message(STATUS " USE_GLOG : ${USE_GLOG}")
if(${USE_GLOG})
message(STATUS " glog version : ${GLOG_VERSION}")
endif()

message(STATUS " USE_GFLAGS : ${USE_GFLAGS}")
if(${USE_GFLAGS})
message(STATUS " gflags version : ${GFLAGS_VERSION}")
endif()

message(STATUS " USE_LMDB : ${USE_LMDB}")
if(${USE_LMDB})
Expand Down

0 comments on commit db0499c

Please sign in to comment.