PaddleConfig.cmake.in 992 Bytes
Newer Older
“yuguo”'s avatar
2.5  
“yuguo” committed
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
# Paddle CMake configuration file
# -------
#
# Finds the Paddle library
#
# This will define the following variables:
#
#   PADDLE_FOUND        -- True if the system has the Paddle library
#   PADDLE_INCLUDE_DIRS -- The include directories for Paddle
#   PADDLE_LIBRARIES    -- Libraries to link against

get_filename_component(PADDLE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}/../.." ABSOLUTE)

# include directories
set(PADDLE_INCLUDE_DIRS 
    ${PADDLE_INSTALL_PREFIX}/include
    ${PADDLE_INSTALL_PREFIX}/include/third_party
)

# Library dependencies.
set(PADDLE_LIBRARIES_DIRS ${PADDLE_INSTALL_PREFIX}/lib)
link_directories(${PADDLE_LIBRARIES_DIRS})

file(GLOB PADDLE_LIBRARIES ${PADDLE_LIBRARIES_DIRS}/lib*)

find_package(PythonLibs @PY_VERSION@ REQUIRED)
list(APPEND PADDLE_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
list(APPEND PADDLE_LIBRARIES ${PYTHON_LIBRARIES})

if(@WITH_GPU@)
    find_package(CUDA @CUDA_VERSION@ REQUIRED)
    list(APPEND PADDLE_LIBRARIES ${CUDA_LIBRARIES})
endif()