|
|
@@ -5,10 +5,12 @@ option(WITH_MKL "Compile demo with MKL/OpenBlas support,defaultuseMKL."
|
|
|
option(WITH_GPU "Compile demo with GPU/CPU, default use CPU." ON)
|
|
|
option(WITH_STATIC_LIB "Compile demo with static/shared library, default use static." OFF)
|
|
|
option(WITH_TENSORRT "Compile demo with TensorRT." OFF)
|
|
|
+option(WITH_ENCRYPTION "Compile demo with encryption tool." OFF)
|
|
|
|
|
|
-SET(TENSORRT_DIR "" CACHE PATH "Compile demo with TensorRT")
|
|
|
+SET(TENSORRT_DIR "" CACHE PATH "Location of libraries")
|
|
|
SET(PADDLE_DIR "" CACHE PATH "Location of libraries")
|
|
|
SET(OPENCV_DIR "" CACHE PATH "Location of libraries")
|
|
|
+SET(ENCRYPTION_DIR"" CACHE PATH "Location of libraries")
|
|
|
SET(CUDA_LIB "" CACHE PATH "Location of libraries")
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
@@ -29,6 +31,10 @@ macro(safe_set_static_flag)
|
|
|
endforeach(flag_var)
|
|
|
endmacro()
|
|
|
|
|
|
+if (WITH_ENCRYPTION)
|
|
|
+add_definitions( -DWITH_ENCRYPTION=${WITH_ENCRYPTION})
|
|
|
+endif()
|
|
|
+
|
|
|
if (WITH_MKL)
|
|
|
ADD_DEFINITIONS(-DUSE_MKL)
|
|
|
endif()
|
|
|
@@ -209,6 +215,16 @@ if(WITH_GPU)
|
|
|
endif()
|
|
|
endif()
|
|
|
|
|
|
+if(WITH_ENCRYPTION)
|
|
|
+ if(NOT WIN32)
|
|
|
+ include_directories("${ENCRYPTION_DIR}/include")
|
|
|
+ link_directories("${ENCRYPTION_DIR}/lib")
|
|
|
+ set(DEPS ${DEPS} ${ENCRYPTION_DIR}/lib/libpmodel-decrypt${CMAKE_SHARED_LIBRARY_SUFFIX})
|
|
|
+ else()
|
|
|
+ message(FATAL_ERROR "Encryption Tool don't support WINDOWS")
|
|
|
+ endif()
|
|
|
+endif()
|
|
|
+
|
|
|
if (NOT WIN32)
|
|
|
set(EXTERNAL_LIB "-ldl -lrt -lgomp -lz -lm -lpthread")
|
|
|
set(DEPS ${DEPS} ${EXTERNAL_LIB})
|