Skip to content

Instantly share code, notes, and snippets.

@TexAgg
Forked from Tacha-S/FindTensorflow.cmake
Last active May 13, 2018 22:09
Show Gist options
  • Save TexAgg/e45c1b27a9478ae915f26db8085eb3da to your computer and use it in GitHub Desktop.
Save TexAgg/e45c1b27a9478ae915f26db8085eb3da to your computer and use it in GitHub Desktop.
# Locates the tensorflow library and include dirs.
include(FindPackageHandleStandardArgs)
unset(TENSORFLOW_FOUND)
find_path(Tensorflow_INCLUDE_DIR
NAMES
tensorflow/core
tensorflow/cc
tensorflow/c
third_party
HINTS
/usr/include/tensorflow
/usr/local/include/tensorflow)
find_library(Tensorflow_LIBRARY NAMES tensorflow
HINTS
/usr/lib
/usr/local/lib)
# set Tensorflow_FOUND
find_package_handle_standard_args(Tensorflow DEFAULT_MSG Tensorflow_INCLUDE_DIR Tensorflow_LIBRARY)
# set external variables for usage in CMakeLists.txt
if(TENSORFLOW_FOUND)
set(Tensorflow_LIBRARIES ${Tensorflow_LIBRARY})
set(Tensorflow_INCLUDE_DIRS ${Tensorflow_INCLUDE_DIR})
endif()
# hide locals from GUI
mark_as_advanced(Tensorflow_INCLUDE_DIR Tensorflow_LIBRARY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment