CMakeLists.txt 2.7 KB
Newer Older
朔-望's avatar
朔-望 已提交
1 2
cmake_minimum_required(VERSION 3.0)
project(paddle-mobile)
L
liuruilong 已提交
3
add_definitions(-DPADDLE_MOBILE_DEBUG)
W
wangliu 已提交
4
add_definitions(-DENABLE_EXCEPTION)
朔-望's avatar
朔-望 已提交
5

6 7 8 9 10 11 12 13
if(IS_MAC)
    add_definitions(-DX86)
elseif(IS_IOS)
    add_definitions(-DIOS)
elseif(V7)
    add_definitions(-DARMV7)
elseif(V8)
    add_definitions(-DARMV8)
14 15 16 17
else ()
    add_definitions(-DX86)
endif()

Z
zhaojiaying01 已提交
18

19
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
朔-望's avatar
朔-望 已提交
20
set(CMAKE_BUILD_TYPE RelWithDebInfo)
朔-望's avatar
朔-望 已提交
21 22
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
朔-望's avatar
朔-望 已提交
23 24 25 26
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY build)

L
liuruilong 已提交
27
file(GLOB_RECURSE PADDLE_MOBILE_CC src/*.cc src/*.cpp src/*.c)
朔-望's avatar
朔-望 已提交
28 29 30 31
file(GLOB_RECURSE PADDLE_MOBILE_H src/*.h)

include_directories(src/)

L
liuruilong 已提交
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
if (googlenet)
    add_definitions(-DCONCAT_OP)
    add_definitions(-DCONV_OP)
    add_definitions(-DLRN_OP)
    add_definitions(-DMUL_OP)
    add_definitions(-DELEMENTWISEADD_OP)
    add_definitions(-DFUSION_FC_OP)
    add_definitions(-DPOOL_OP)
    add_definitions(-DRELU_OP)
elseif (mobilenet)
    add_definitions(-DCONV_OP)
    add_definitions(-DELEMENTWISEADD_OP)
    add_definitions(-DRELU_OP)
    add_definitions(-DSOFTMAX_OP)
    add_definitions(-DSOFTMAX_OP)
    add_definitions(-DDEPTHWISECONV_OP)
    add_definitions(-DBATCHNORM_OP)
    add_definitions(-DPOOL_OP)
    add_definitions(-DRESHAPE_OP)
elseif (yolo)
    add_definitions(-DBATCHNORM_OP)
    add_definitions(-DCONV_OP)
    add_definitions(-DRELU_OP)
    add_definitions(-DELEMENTWISEADD_OP)
elseif (squeezenet)
    add_definitions(-DCONCAT_OP)
    add_definitions(-DCONV_OP)
    add_definitions(-DRELU_OP)
    add_definitions(-DELEMENTWISEADD_OP)
    add_definitions(-DPOOL_OP)
    add_definitions(-DRESHAPE_OP)
    add_definitions(-DSOFTMAX_OP)
elseif(resnet)
    add_definitions(-DCONV_OP)
    add_definitions(-DBATCHNORM_OP)
    add_definitions(-DELEMENTWISEADD_OP)
    add_definitions(-DSOFTMAX_OP)
    add_definitions(-DMUL_OP)
    add_definitions(-DPOOL_OP)
    add_definitions(-DRELU_OP)
else ()
    add_definitions(-DBATCHNORM_OP)
    add_definitions(-DBOXCODER_OP)
    add_definitions(-DCONCAT_OP)
    add_definitions(-DCONV_OP)
    add_definitions(-DDEPTHWISECONV_OP)
    add_definitions(-DELEMENTWISEADD_OP)
    add_definitions(-DFUSIONCONVADD_OP)
    add_definitions(-DCONVADDRELU_OP)
    add_definitions(-DFUSION_FC_OP)
    add_definitions(-DLRN_OP)
    add_definitions(-DMUL_OP)
    add_definitions(-DMULTICLASSNMS_OP)
    add_definitions(-DPOOL_OP)
    add_definitions(-DPRIORBOX_OP)
    add_definitions(-DRELU_OP)
    add_definitions(-DRESHAPE_OP)
    add_definitions(-DSIGMOID_OP)
    add_definitions(-DSOFTMAX_OP)
    add_definitions(-DTRANSPOSE_OP)
endif()

Y
Yi Wang 已提交
94
add_library(paddle-mobile SHARED ${PADDLE_MOBILE_CC} ${PADDLE_MOBILE_H})
朔-望's avatar
朔-望 已提交
95

L
liuruilong 已提交
96
add_subdirectory(test)