any.cmake 907 字节
Newer Older
1 2 3 4
INCLUDE(ExternalProject)

SET(ANY_SOURCE_DIR ${THIRD_PARTY_PATH}/any)

L
liaogang 已提交
5
INCLUDE_DIRECTORIES(${ANY_SOURCE_DIR}/src/extern_lib_any)
6 7

ExternalProject_Add(
L
liaogang 已提交
8
    extern_lib_any
9
    ${EXTERNAL_PROJECT_LOG_ARGS}
Y
Yi Wang 已提交
10
    GIT_REPOSITORY  "https://github.com/PaddlePaddle/any.git"
Y
Yi Wang 已提交
11
    GIT_TAG         "15595d8324be9e8a9a80d9ae442fdd12bd66df5d"
12 13 14 15 16 17 18 19
    PREFIX          ${ANY_SOURCE_DIR}
    UPDATE_COMMAND  ""
    CONFIGURE_COMMAND ""
    BUILD_COMMAND     ""
    INSTALL_COMMAND   ""
    TEST_COMMAND      ""
)

L
liaogang 已提交
20 21 22 23 24 25 26 27 28
if (${CMAKE_VERSION} VERSION_LESS "3.3.0")
    set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/lib_any_dummy.c)
    file(WRITE ${dummyfile} "const char * dummy_any = \"${dummyfile}\";")
    add_library(lib_any STATIC ${dummyfile})
else()
    add_library(lib_any INTERFACE)
endif()

add_dependencies(lib_any extern_lib_any)
L
liaogang 已提交
29

30
add_definitions(-DANY_IMPL_ANY_CAST_MOVEABLE)
L
liaogang 已提交
31
LIST(APPEND external_project_dependencies lib_any)