Skip to content

Commit 5a21cd9

Browse files
authored
Merge pull request #245 from FloopCZ/bin-include
Add bazel-bin/bin to the list of include dirs
2 parents 589470f + 8224cc4 commit 5a21cd9

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

tensorflow_cc/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ include(TensorflowBase)
4040
add_library(tensorflow_cc INTERFACE)
4141
target_compile_features(tensorflow_cc INTERFACE ${TARGET_CXX_STANDARD})
4242

43+
# The include folders are sometimes contained under bazel-bin/bin/ and sometimes just bazel-bin.
4344
target_include_directories(
4445
tensorflow_cc INTERFACE
4546
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/bazel-bin/tensorflow/include"
4647
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/bazel-bin/tensorflow/include/src"
48+
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/bazel-bin/bin/tensorflow/include"
49+
"${CMAKE_INSTALL_PREFIX}/include/tensorflow/bazel-bin/bin/tensorflow/include/src"
4750
)
4851
target_link_libraries(
4952
tensorflow_cc INTERFACE

tensorflow_cc/cmake/TensorflowBase.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ ExternalProject_Add(
1313
CONFIGURE_COMMAND ""
1414
BUILD_COMMAND "${CMAKE_CURRENT_BINARY_DIR}/build_tensorflow.sh"
1515
INSTALL_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy_links.sh" bazel-bin
16+
# The include folders are sometimes contained under bazel-bin/bin/ and sometimes just bazel-bin.
17+
# Later, we include both so let's make sure they both exist so that CMake does not complain.
18+
COMMAND mkdir -p "${CMAKE_CURRENT_BINARY_DIR}/tensorflow/bazel-bin/tensorflow/include/src"
19+
COMMAND mkdir -p "${CMAKE_CURRENT_BINARY_DIR}/tensorflow/bazel-bin/bin/tensorflow/include/src"
20+
COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/tensorflow/bazel-bin/tensorflow/include/src/__placeholder__.h"
21+
COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/tensorflow/bazel-bin/bin/tensorflow/include/src/__placeholder__.h"
1622
)

0 commit comments

Comments
 (0)