-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathCMakeLists.txt
51 lines (45 loc) · 1.92 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 2.8)
include_directories(
${PROJECT_SOURCE_DIR}/../tensorflow
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/gen/proto
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/gen/protobuf-host/include
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/downloads/eigen
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/downloads/nsync/public
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/downloads/googletest/googletest/include
${PROJECT_SOURCE_DIR}/include)
link_directories(
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/gen/lib
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/gen/protobuf-host/lib)
if(UNIX AND NOT APPLE)
set(LINUX TRUE)
endif()
if (LINUX)
link_directories(
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/downloads/nsync/builds/default.linux.c++11)
else()
link_directories(
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/downloads/nsync/builds/default.macos.c++11)
endif()
set(DEEP_CTR_LINKER_LIBS "")
list(APPEND DEEP_CTR_LINKER_LIBS
libtensorflow-core.a
libprotobuf.a
pthread m z)
if (LINUX)
list(APPEND DEEP_CTR_LINKER_LIBS
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/downloads/nsync/builds/default.linux.c++11/nsync.a
dl)
else()
list(APPEND DEEP_CTR_LINKER_LIBS
${PROJECT_SOURCE_DIR}/../tensorflow/tensorflow/contrib/makefile/downloads/nsync/builds/default.macos.c++11/nsync.a)
endif()
# executable
set(SIMPLE_MODEL "simple_model.bin")
add_executable(${SIMPLE_MODEL} "simple_model.cc")
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/bin")
target_link_libraries(${SIMPLE_MODEL} ${DEEP_CTR_LINKER_LIBS})
# executable
set(DEEP_MODEL "deep_model.bin")
add_executable(${DEEP_MODEL} "deep_model.cc")
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/bin")
target_link_libraries(${DEEP_MODEL} ${DEEP_CTR_LINKER_LIBS})