CMakeLists.txt 763 字节
Newer Older
Z
zhangjinchao01 已提交
1 2 3
# The utilities for paddle
file(GLOB UTIL_HEADERS . *.h)
file(GLOB UTIL_SOURCES . *.cpp)
4
create_resources(${CMAKE_CURRENT_SOURCE_DIR}/enable_virtualenv.py
5 6
  ${CMAKE_CURRENT_BINARY_DIR}/enable_virtualenv.c)
set(UTIL_RES ${CMAKE_CURRENT_BINARY_DIR}/enable_virtualenv.c)
7

Y
Yu Yang 已提交
8 9 10 11 12
if(APPLE)
    file(GLOB UTIL_ARCH_SOURCES . arch/osx/*.cpp)
else()
    file(GLOB UTIL_ARCH_SOURCES . arch/linux/*.cpp)
endif()
Z
zhangjinchao01 已提交
13
add_library(paddle_utils STATIC
Y
Yu Yang 已提交
14
        ${UTIL_SOURCES}
15 16
        ${UTIL_ARCH_SOURCES}
        ${UTIL_RES})
Z
zhangjinchao01 已提交
17
add_style_check_target(paddle_utils ${UTIL_HEADERS})
Y
Yu Yang 已提交
18 19
add_style_check_target(paddle_utils ${UTIL_SOURCES}
    ${UTIL_ARCH_SOURCES})
Y
Yu Yang 已提交
20
add_dependencies(paddle_utils paddle_proto ${external_project_dependencies})
Z
zhangjinchao01 已提交
21 22
if(WITH_TESTING)
    add_subdirectory(tests)
Y
Yu Yang 已提交
23
endif()