include(cmake/ConfigGen.cmake)
# ---[ Options
-caffe_option(CPU_ONLY "Build Caffe wihtout CUDA support" OFF) # TODO: rename to USE_CUDA
+caffe_option(CPU_ONLY "Build Caffe without CUDA support" OFF) # TODO: rename to USE_CUDA
caffe_option(USE_CUDNN "Build Caffe with cuDNN libary support" ON IF NOT CPU_ONLY)
caffe_option(BUILD_SHARED_LIBS "Build shared libraries" ON)
caffe_option(BUILD_python "Build Python wrapper" ON)
set(python_version "2" CACHE STRING "Specify which python version to use")
caffe_option(BUILD_matlab "Build Matlab wrapper" OFF IF UNIX OR APPLE)
caffe_option(BUILD_docs "Build documentation" ON IF UNIX OR APPLE)
-caffe_option(BUILD_python_layer "Build the caffe python layer" ON)
+caffe_option(BUILD_python_layer "Build the Caffe python layer" ON)
# ---[ Dependencies
include(cmake/Dependencies.cmake)
configure_file("cmake/Templates/CaffeConfig.cmake.in" "${PROJECT_BINARY_DIR}/cmake/CaffeConfig.cmake" @ONLY)
- # Install the CaffeConfig.cmake and export set to use wuth install-tree
+ # Install the CaffeConfig.cmake and export set to use with install-tree
install(FILES "${PROJECT_BINARY_DIR}/cmake/CaffeConfig.cmake" DESTINATION ${install_cmake_suffix})
install(EXPORT CaffeTargets DESTINATION ${install_cmake_suffix})
LOG_DOWNLOAD 1
LOG_INSTALL 1
)
-
+
set(GFLAGS_FOUND TRUE)
set(GFLAGS_INCLUDE_DIRS ${gflags_INSTALL}/include)
- set(GFLAGS_LIBRARIES ${gflags_INSTALL}/lib/libgflags.a ${CMAKE_THREAD_LIBS_INIT})
+ set(GFLAGS_LIBRARIES ${gflags_INSTALL}/lib/libgflags.a ${CMAKE_THREAD_LIBS_INIT})
set(GFLAGS_LIBRARY_DIRS ${gflags_INSTALL}/lib)
set(GFLAGS_EXTERNAL TRUE)
if (GFLAGS_EXTERNAL)
set(GLOG_DEPENDS gflags)
endif()
-
+
ExternalProject_Add(glog
DEPENDS ${GLOG_DEPENDS}
PREFIX ${glog_PREFIX}
-# ---[ Configurations types
+# ---[ Configuration types
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Possible configurations" FORCE)
mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
# Finds Google Protocol Buffers library and compilers and extends
-# the standart cmake script with version and python generation support
+# the standard cmake script with version and python generation support
find_package( Protobuf REQUIRED )
include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${PROTOBUF_LIBRARIES})
# As of Ubuntu 14.04 protoc is no longer a part of libprotobuf-dev package
-# and should be installed separately as in: sudo apt-get install protobuf-compiler
+# and should be installed separately as in: sudo apt-get install protobuf-compiler
if(EXISTS ${PROTOBUF_PROTOC_EXECUTABLE})
message(STATUS "Found PROTOBUF Compiler: ${PROTOBUF_PROTOC_EXECUTABLE}")
else()
################################################################################################
-# Prints accumulatd caffe configuration summary
+# Prints accumulated caffe configuration summary
# Usage:
# caffe_print_configuration_summary()
caffe_status(" BLAS : " APPLE THEN "Yes (vecLib)" ELSE "Yes (${BLAS})")
caffe_status(" Boost : Yes (ver. ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION})")
caffe_status(" glog : Yes")
- caffe_status(" gflags : Yes")
+ caffe_status(" gflags : Yes")
caffe_status(" protobuf : " PROTOBUF_FOUND THEN "Yes (ver. ${PROTOBUF_VERSION})" ELSE "No" )
caffe_status(" lmdb : " LMDB_FOUND THEN "Yes (ver. ${LMDB_VERSION})" ELSE "No")
caffe_status(" Snappy : " SNAPPY_FOUND THEN "Yes (ver. ${Snappy_VERSION})" ELSE "No" )
################################################################################################
# Collecting sources from globbing and appending to output list variable
# Usage:
-# caffe_source_group(<output_variable> GLOB[_RECURSE] <globbing_expression>)
+# caffe_collect_sources(<output_variable> GLOB[_RECURSE] <globbing_expression>)
function(caffe_collect_sources variable)
cmake_parse_arguments(CAFFE_COLLECT_SOURCES "" "" "GLOB;GLOB_RECURSE" ${ARGN})
if(CAFFE_COLLECT_SOURCES_GLOB)
set(result "")
foreach(line ${__lines})
set(result "${result}${PROJECT_SOURCE_DIR}/${line}\n")
- endforeach()
+ endforeach()
file(WRITE ${file}.gen.cmake ${result})
endfunction()
################################################################################################
-# Filter outs all files that are not inlcuded in selected list
+# Filter out all files that are not included in selected list
# Usage:
# caffe_leave_only_selected_tests(<filelist_variable> <selected_list>)
function(caffe_leave_only_selected_tests file_list)
# Caffe and this config file depends on opencv,
# so put `find_package(OpenCV)` before searching Caffe
# via `find_package(Caffe)`. All other lib/includes
-# dependencies are hard coded int the file
+# dependencies are hard coded in the file
#
# After successful configuration the following variables
# will be defined:
#
# Caffe_HAVE_CUDA - signals about CUDA support
# Caffe_HAVE_CUDNN - signals about cuDNN support
-
+
# OpenCV dependency
set(Caffe_INCLUDE_DIRS "@Caffe_INCLUDE_DIRS@")
@Caffe_INSTALL_INCLUDE_DIR_APPEND_COMMAND@
-
+
# Our library dependencies
if(NOT TARGET caffe AND NOT caffe_BINARY_DIR)
include("${Caffe_CMAKE_DIR}/CaffeTargets.cmake")
set(PACKAGE_VERSION "@Caffe_VERSION@")
-
+
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
################################################################################################
# Command alias for debugging messages
# Usage:
-# dmgs(<message>)
+# dmsg(<message>)
function(dmsg)
message(STATUS ${ARGN})
endfunction()
endmacro()
################################################################################################
-# Clears variables from lsit
+# Clears variables from list
# Usage:
-# caffe_list_unique(<variables_list>)
+# caffe_clear_vars(<variables_list>)
macro(caffe_clear_vars)
foreach(_var ${ARGN})
unset(${_var})
if(__add_cache)
set(${name} ${${name}} CACHE INTERNAL "${name} parsed from ${FILENAME}" FORCE)
elseif(__parnet_scope)
- set(${name} "${${name}}" PARENT_SCOPE)
+ set(${name} "${${name}}" PARENT_SCOPE)
endif()
else()
unset(${name} CACHE)
endfunction()
################################################################################################
-# Helper function to parse current linker libs into link directoris, libflags and osx frameworks
+# Helper function to parse current linker libs into link directories, libflags and osx frameworks
# Usage:
# caffe_parse_linker_libs(<Caffe_LINKER_LIBS_var> <directories_var> <libflags_var> <frameworks_var>)
function(caffe_parse_linker_libs Caffe_LINKER_LIBS_variable folders_var flags_var frameworks_var)
set(EXCLUDE_FILE_EXTENSTIONS pb.h pb.cc)
set(LINT_DIRS include src/caffe examples tools python matlab)
-cmake_policy(SET CMP0009 NEW) # supress cmake warning
+cmake_policy(SET CMP0009 NEW) # suppress cmake warning
# find all files of interest
foreach(ext ${SRC_FILE_EXTENSIONS})
execute_process(
COMMAND ${LINT_COMMAND} ${LINT_SOURCES}
- ERROR_VARIABLE LINT_OUTPUT
+ ERROR_VARIABLE LINT_OUTPUT
ERROR_STRIP_TRAILING_WHITESPACE
)