CMakeLists.txt 771 字节
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

L
liuruilong 已提交
6
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
朔-望's avatar
朔-望 已提交
7
set(CMAKE_BUILD_TYPE RelWithDebInfo)
朔-望's avatar
朔-望 已提交
8 9
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
朔-望's avatar
朔-望 已提交
10 11 12 13
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY build)

L
liuruilong 已提交
14
file(GLOB_RECURSE PADDLE_MOBILE_CC src/*.cc src/*.cpp src/*.c)
朔-望's avatar
朔-望 已提交
15 16 17 18
file(GLOB_RECURSE PADDLE_MOBILE_H src/*.h)

include_directories(src/)

H
Haipeng Wang 已提交
19 20 21 22 23
option(USE_OPENMP "openmp support" ON)
if(USE_OPENMP)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
endif()

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

L
liuruilong 已提交
26
add_subdirectory(test)