Skip to content

Commit 50930c6

Browse files
authored
Merge pull request #25 from dhiegomaga/master
Fix tensorflow path on cmake files
2 parents 2b1cae9 + a5c6422 commit 50930c6

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ CppFlow uses Tensorflow C API to run the models, meaning you can use it without
2929
Since it uses TensorFlow C API you just have to [download it](https://www.tensorflow.org/install/lang_c).
3030
3131
You can either install the library system wide by following the tutorial on the Tensorflow page or you can place the contents of the archive
32-
in a folder called `libtensorflow` in the root directory of the repo.
32+
in a folder called `libtensorflow` in the home directory.
3333
3434
Afterwards, you can run the examples:
3535
@@ -39,7 +39,7 @@ cd cppflow/examples/load_model
3939
mkdir build
4040
cd build
4141
cmake ..
42-
make .
42+
make
4343
./example
4444
```
4545

examples/coco/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
cmake_minimum_required(VERSION 3.10)
22
project(example)
33

4+
find_library(TENSORFLOW_LIB tensorflow HINT $ENV{HOME}/libtensorflow/lib)
5+
46
set(CMAKE_CXX_STANDARD 17)
7+
58
add_executable(example main.cpp ../../src/Model.cpp ../../src/Tensor.cpp)
69
find_package( OpenCV REQUIRED )
7-
target_include_directories(example PRIVATE ../../include)
8-
target_link_libraries (example -ltensorflow ${OpenCV_LIBS})
10+
target_include_directories(example PRIVATE ../../include $ENV{HOME}/libtensorflow/include)
11+
target_link_libraries (example "${TENSORFLOW_LIB}" ${OpenCV_LIBS})

examples/load_model/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
cmake_minimum_required(VERSION 3.10)
22
project(example)
33

4+
find_library(TENSORFLOW_LIB tensorflow HINT $ENV{HOME}/libtensorflow/lib)
5+
46
set(CMAKE_CXX_STANDARD 17)
57
add_executable(example main.cpp ../../src/Model.cpp ../../src/Tensor.cpp)
6-
target_include_directories(example PRIVATE ../../include)
7-
target_link_libraries (example -ltensorflow)
8+
target_include_directories(example PRIVATE ../../include $ENV{HOME}/libtensorflow/include)
9+
target_link_libraries (example "${TENSORFLOW_LIB}")

examples/mnist/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
cmake_minimum_required(VERSION 3.10)
22
project(example)
33

4+
find_library(TENSORFLOW_LIB tensorflow HINT $ENV{HOME}/libtensorflow/lib)
5+
46
set(CMAKE_CXX_STANDARD 17)
57
find_package( OpenCV REQUIRED )
68
add_executable(example main.cpp ../../src/Model.cpp ../../src/Tensor.cpp)
7-
target_include_directories(example PRIVATE ../../include)
8-
target_link_libraries (example -ltensorflow ${OpenCV_LIBS})
9+
target_include_directories(example PRIVATE ../../include $ENV{HOME}/libtensorflow/include)
10+
target_link_libraries (example "${TENSORFLOW_LIB}" ${OpenCV_LIBS})

0 commit comments

Comments
 (0)