-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (39 loc) · 2.22 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
PROJECT(VEDATensorFlow VERSION 7 LANGUAGES C CXX)
FIND_PACKAGE(Illyrian 0.3.0 REQUIRED)
ILLYRIAN_FIND_PACKAGE (Tungl VERSION 0.1.1 REQUIRED PYTHON "tungl/cmake" PATHS "/usr/local/nle/tungl/cmake")
ILLYRIAN_FIND_PACKAGE (VEDA VERSION 2.0.1 REQUIRED PYTHON "veda/cmake" PATHS "/usr/local/ve/veda/cmake")
ILLYRIAN_FIND_PACKAGE (VEDATensors VERSION 0.1.4 REQUIRED PYTHON "veda/tensors/cmake" PATHS "/usr/local/ve/veda-tensors/cmake")
ILLYRIAN_FIND_PYTHON_FILE (TENSORFLOW_LIBRARY tensorflow "libtensorflow_framework.so.2" REQUIRED)
MARK_AS_ADVANCED(TENSORFLOW_LIBRARY)
GET_FILENAME_COMPONENT(TENSORFLOW_DIR ${TENSORFLOW_LIBRARY} DIRECTORY)
SET(TENSORFLOW_INCLUDE_DIRS ${TENSORFLOW_DIR}/include)
FILE(READ ${TENSORFLOW_DIR}/include/tensorflow/core/public/version.h TENSORFLOW_VERSION)
STRING(REGEX MATCH "TF_MAJOR_VERSION ([0-9]+)" TENSORFLOW_VERSION_MAJOR ${TENSORFLOW_VERSION})
SET(TENSORFLOW_VERSION_MAJOR ${CMAKE_MATCH_1})
STRING(REGEX MATCH "TF_MINOR_VERSION ([0-9]+)" TENSORFLOW_VERSION_MINOR ${TENSORFLOW_VERSION})
SET(TENSORFLOW_VERSION_MINOR ${CMAKE_MATCH_1})
STRING(REGEX MATCH "TF_PATCH_VERSION ([0-9]+)" TENSORFLOW_VERSION_PATCH ${TENSORFLOW_VERSION})
SET(TENSORFLOW_VERSION_PATCH ${CMAKE_MATCH_1})
SET(TENSORFLOW_VERSION "${TENSORFLOW_VERSION_MAJOR}.${TENSORFLOW_VERSION_MINOR}.${TENSORFLOW_VERSION_PATCH}")
IF(TENSORFLOW_VERSION VERSION_LESS "2.7.0")
SET(VEDATensorFlow_C_STANDARD 11)
ELSEIF(TENSORFLOW_VERSION VERSION_LESS "2.10.0")
SET(VEDATensorFlow_C_STANDARD 14)
ELSE()
SET(VEDATensorFlow_C_STANDARD 17)
ENDIF()
ILLYRIAN_PROJECT(
C_STANDARD ${VEDATensorFlow_C_STANDARD}
CXX_STANDARD ${VEDATensorFlow_C_STANDARD}
INSTALL_PREFIX "/usr/local/ve/"
)
SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/dist" CACHE STRING "" FORCE)
INCLUDE_DIRECTORIES(${Tungl_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${VEDA_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${VEDATensors_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${TENSORFLOW_INCLUDE_DIRS})
SET(VEDATensorFlow_INSTALL_PATH "tensorflow-plugins")
ADD_SUBDIRECTORY(src)
INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${VEDATensorFlow_INSTALL_PATH} RENAME VEDA-TENSORFLOW-LICENSE)
INSTALL(FILES ${CMAKE_CURRENT_LIST_DIR}/README.md DESTINATION ${VEDATensorFlow_INSTALL_PATH})