|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set(CAFFE2_VERSION_MAJOR 1) |
|
set(CAFFE2_VERSION_MINOR 13) |
|
set(CAFFE2_VERSION_PATCH 1) |
|
set(CAFFE2_VERSION "1.13.1") |
|
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/public/utils.cmake") |
|
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/public/threads.cmake") |
|
|
|
|
|
|
|
if(OFF) |
|
include("${CMAKE_CURRENT_LIST_DIR}/public/gflags.cmake") |
|
if(NOT TARGET gflags) |
|
message(FATAL_ERROR |
|
"Your installed Caffe2 version uses gflags but the gflags library " |
|
"cannot be found. Did you accidentally remove it, or have you set " |
|
"the right CMAKE_PREFIX_PATH and/or GFLAGS_ROOT_DIR? If you do not " |
|
"have gflags, you will need to install gflags and set the library " |
|
"path accordingly.") |
|
endif() |
|
endif() |
|
|
|
|
|
|
|
if(OFF) |
|
include("${CMAKE_CURRENT_LIST_DIR}/public/glog.cmake") |
|
if(NOT TARGET glog::glog) |
|
message(FATAL_ERROR |
|
"Your installed Caffe2 version uses glog but the glog library " |
|
"cannot be found. Did you accidentally remove it, or have you set " |
|
"the right CMAKE_PREFIX_PATH and/or GFLAGS_ROOT_DIR? If you do not " |
|
"have glog, you will need to install glog and set the library " |
|
"path accordingly.") |
|
endif() |
|
endif() |
|
|
|
|
|
if(ON) |
|
if(NOT TARGET protobuf::libprotobuf) |
|
|
|
|
|
add_library(dummy INTERFACE) |
|
add_library(protobuf::libprotobuf ALIAS dummy) |
|
endif() |
|
else() |
|
include("${CMAKE_CURRENT_LIST_DIR}/public/protobuf.cmake") |
|
if(NOT TARGET protobuf::libprotobuf) |
|
message(FATAL_ERROR |
|
"Your installed Caffe2 version uses protobuf but the protobuf library " |
|
"cannot be found. Did you accidentally remove it, or have you set " |
|
"the right CMAKE_PREFIX_PATH? If you do not have protobuf, you will " |
|
"need to install protobuf and set the library path accordingly.") |
|
endif() |
|
message(STATUS "Caffe2: Protobuf version " ${Protobuf_VERSION}) |
|
|
|
|
|
|
|
if(FALSE) |
|
if(NOT (${Protobuf_VERSION} VERSION_EQUAL Protobuf_VERSION_NOTFOUND)) |
|
message(FATAL_ERROR |
|
"Your installed Caffe2 is built with protobuf " |
|
"Protobuf_VERSION_NOTFOUND" |
|
", while your current cmake setting discovers protobuf version " |
|
${Protobuf_VERSION} |
|
". Please specify a protobuf version that is the same as the built " |
|
"version.") |
|
endif() |
|
endif() |
|
endif() |
|
|
|
if (OFF) |
|
include("${CMAKE_CURRENT_LIST_DIR}/public/LoadHIP.cmake") |
|
endif() |
|
|
|
if(0) |
|
|
|
|
|
|
|
set(CAFFE2_USE_CUDA 0) |
|
set(CAFFE2_USE_CUDNN OFF) |
|
set(CAFFE2_USE_TENSORRT OFF) |
|
include("${CMAKE_CURRENT_LIST_DIR}/public/cuda.cmake") |
|
if( AND NOT CAFFE2_USE_CUDA) |
|
message(FATAL_ERROR |
|
"Your installed Caffe2 version uses CUDA but I cannot find the CUDA " |
|
"libraries. Please set the proper CUDA prefixes and / or install " |
|
"CUDA.") |
|
endif() |
|
if( AND NOT CAFFE2_USE_CUDNN) |
|
message(FATAL_ERROR |
|
"Your installed Caffe2 version uses cuDNN but I cannot find the cuDNN " |
|
"libraries. Please set the proper cuDNN prefixes and / or install " |
|
"cuDNN.") |
|
endif() |
|
if( AND NOT CAFFE2_USE_TENSORRT) |
|
message(FATAL_ERROR |
|
"Your installed Caffe2 version uses TensorRT but I cannot find the TensorRT " |
|
"libraries. Please set the proper TensorRT prefixes and / or install " |
|
"TensorRT.") |
|
endif() |
|
endif() |
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/public/mkl.cmake") |
|
|
|
if(ON) |
|
include("${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake") |
|
endif() |
|
|
|
|
|
include ("${CMAKE_CURRENT_LIST_DIR}/Caffe2Targets.cmake") |
|
|
|
|
|
|
|
|
|
set(Caffe2_MAIN_LIBS torch_library) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get_filename_component( |
|
CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) |
|
|
|
get_filename_component( |
|
_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) |
|
set(CAFFE2_INCLUDE_DIRS "${_INSTALL_PREFIX}/include") |
|
|