CMakeLists.txt 794 字节
Newer Older
H
hedaoyuan 已提交
1 2
file(GLOB h_files . *Op.h)
file(GLOB cpp_files . *Op.cpp)
3 4 5 6 7

list(APPEND h_files Function.h)
list(APPEND cpp_files Function.cpp)

if(WITH_GPU)
H
hedaoyuan 已提交
8
    file(GLOB cu_files . *OpGpu.cu)
9
    cuda_compile(cu_objs ${cu_files})
H
hedaoyuan 已提交
10 11
endif()

12 13 14
add_library(paddle_function STATIC ${cpp_files} ${cu_objs})

if(WITH_GPU)
H
hedaoyuan 已提交
15
if(WITH_TESTING)
16
    # TODO:
H
hedaoyuan 已提交
17
    # file(GLOB test_files . *OpTest.cpp)
18
    # add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_files})
H
hedaoyuan 已提交
19
    add_simple_unittest(CrossMapNormalOpTest)
20 21 22
    add_unittest(ContextProjectionOpTest
        ContextProjectionOpTest.cpp
        ../gserver/tests/TestUtil.cpp)
23
endif()
H
hedaoyuan 已提交
24
endif()
25 26 27 28 29 30

add_style_check_target(paddle_function ${h_files})
add_style_check_target(paddle_function ${cpp_files})
if(WITH_GPU)
    add_style_check_target(paddle_function ${cu_files})
endif()