summaryrefslogtreecommitdiff
path: root/cmake/Targets.cmake
diff options
context:
space:
mode:
authorNuno Subtil <nsubtil@nvidia.com>2015-04-02 02:10:55 (GMT)
committerNuno Subtil <nsubtil@nvidia.com>2015-04-02 02:15:42 (GMT)
commit10ddfd32cb5ca4132902e9453fb05242ef52ec07 (patch)
tree14638a35bafb39f90a2b8507228d9c1d3abe3cb4 /cmake/Targets.cmake
parent2a7fe03b5d5d7e1d30a1eb0b0e894eb4f72d3701 (diff)
downloadcaffeonacl-10ddfd32cb5ca4132902e9453fb05242ef52ec07.zip
caffeonacl-10ddfd32cb5ca4132902e9453fb05242ef52ec07.tar.gz
caffeonacl-10ddfd32cb5ca4132902e9453fb05242ef52ec07.tar.bz2
Build gflags and glog through CMake if not found in the system
This adds functionality to fetch gflags and glog from GitHub and build them during the Caffe build. This happens only if a system-wide installed version is not found (i.e., when find_package() fails). If built as part of the Caffe build, gflags and glog are compiled as position-independent static libraries. This avoids doing a system-wide install of these libraries during the Caffe install target.
Diffstat (limited to 'cmake/Targets.cmake')
-rw-r--r--cmake/Targets.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/Targets.cmake b/cmake/Targets.cmake
index e3ad872..ed0ff96 100644
--- a/cmake/Targets.cmake
+++ b/cmake/Targets.cmake
@@ -110,6 +110,10 @@ function(caffe_default_properties target)
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
+ # make sure we build all external depepdencies first
+ if (DEFINED external_project_dependencies)
+ add_dependencies(${target} ${external_project_dependencies})
+ endif()
endfunction()
################################################################################################