1 Star 0 Fork 1

寒冰沁狐兰/SeetaGenderPredictor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 3.22 KB
一键复制 编辑 原始数据 按行查看 历史
bo.zhang 提交于 2020-08-21 14:41 . turn on model encrypt,remove bfd
cmake_minimum_required(VERSION 2.8)
set(SeetaGenderPredictor_NAME "SeetaGenderPredictor" CACHE STRING "The SeetaGenderPredictor library name")
set(SeetaGenderPredictor_VERSION_MAJOR "6")
set(SeetaGenderPredictor_VERSION_MINOR "0")
set(SeetaGenderPredictor_VERSION_SINOR "0")
set(SeetaGenderPredictor_VERSION "${SeetaGenderPredictor_VERSION_MAJOR}${SeetaGenderPredictor_VERSION_MINOR}${SeetaGenderPredictor_VERSION_SINOR}")
project(${SeetaGenderPredictor_NAME}${SeetaGenderPredictor_VERSION})
# set(CMAKE_VERBOSE_MAKEFILE on)
set(SOLUTION_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# option for shared or static
set(TARGET "SHARED" CACHE STRING "SHARED or STATIC" FORCE)
# option for SeetaAuthorize
option(SEETA_AUTHORIZE "Using seeta authorize" OFF)
option(SEETA_MODEL_ENCRYPT "Using model encrypt" ON)
# option for build android
option(BUILD_ANDROID "Buid android" OFF)
message(STATUS "Build android: " ${BUILD_ANDROID})
# gether moduls
list(APPEND CMAKE_MODULE_PATH ${SOLUTION_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${SOLUTION_DIR}/../build/cmake)
message(STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
# install dir
set(CMAKE_INSTALL_PREFIX ${SOLUTION_DIR}/../build CACHE STRING "set install prefix" FORCE)
set(SEETA_INSTALL_PATH "" CACHE STRING "seeta install path")
if(SEETA_INSTALL_PATH STREQUAL "")
else()
set(CMAKE_INSTALL_PREFIX ${SEETA_INSTALL_PATH} CACHE STRING "set install prefix" FORCE)
endif()
message(STATUS "cmake install prefix: ${CMAKE_INSTALL_PREFIX}")
# set base flags
set(CMAKE_CFLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -w")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -w -std=c++11")
# option for platform
set(PLATFORM "auto" CACHE STRING "auto, x86 or x64")
set(CONFIGURATION "Release" CACHE STRING "Debug or Release")
# env
include(LOCAL_ENV)
include(INC_ORZ)
if(SEETA_AUTHORIZE)
add_definitions(-DSEETA_AUTO_ENCRYPT)
set(SEETA_AUTO_ENCRYPT ON)
message(STATUS "Seeta Authorize: ON")
else()
message(STATUS "Seeta Authorize: OFF")
endif()
if(SEETA_MODEL_ENCRYPT)
add_definitions(-DSEETA_MODEL_ENCRYPT)
set(SEETA_MODEL_ENCRYPT ON)
message(STATUS "Seeta Model Encrypt: ON")
else()
message(STATUS "Seeta Model Encrypt: OFF")
endif()
if(SEETA_AUTHORIZE)
message(STATUS "SeetaAuthorize: " ${SEETA_AUTHORIZE})
elseif()
endif ()
if (SEETA_MODEL_ENCRYPT)
message(STATUS "SeetaModelEncrypt: " ${SEETA_MODEL_ENCRYPT})
endif ()
if ("${PLATFORM}" STREQUAL "x86")
message(STATUS "Platform: " ${PLATFORM})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
elseif ("${PLATFORM}" STREQUAL "x64")
message(STATUS "Platform: " ${PLATFORM})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
else()
message(STATUS "Platform: " ${PLATFORM})
endif()
if ("${CONFIGURATION}" STREQUAL "Debug")
message(STATUS "Configuration: " ${CONFIGURATION})
set(CMAKE_CX_FLAGS "${CMAKE_CX_FLAGS} -O0 -g -ggdb")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -ggdb")
else()
message(STATUS "Configuration: " ${CONFIGURATION})
set(CMAKE_CX_FLAGS "${CMAKE_CX_FLAGS} -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif()
add_subdirectory(${SOLUTION_DIR}/GenderPredictor)
if(NOT BUILD_ANDROID)
#add_subdirectory(${SOLUTION_DIR}/example)
endif()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/senhong/SeetaGenderPredictor.git
git@gitee.com:senhong/SeetaGenderPredictor.git
senhong
SeetaGenderPredictor
SeetaGenderPredictor
master

搜索帮助