diff --git a/cmake/inference_lib.cmake b/cmake/inference_lib.cmake index 1334bf2f96494f82f0fe475d59adf1521525fcb3..355212280d40aef30c80cfc08d275af4a5657451 100644 --- a/cmake/inference_lib.cmake +++ b/cmake/inference_lib.cmake @@ -218,16 +218,16 @@ include_directories(${CMAKE_BINARY_DIR}/../paddle/fluid/framework/io) # copy api headers for pten & custom op copy(inference_lib_dist - SRCS ${PADDLE_SOURCE_DIR}/paddle/pten/api/ext/* + SRCS ${PADDLE_SOURCE_DIR}/paddle/pten/api/ext/*.h DSTS ${PADDLE_INFERENCE_INSTALL_DIR}/paddle/include/experimental/pten/api/ext/) copy(inference_lib_dist - SRCS ${PADDLE_SOURCE_DIR}/paddle/pten/api/include/* + SRCS ${PADDLE_SOURCE_DIR}/paddle/pten/api/include/*.h DSTS ${PADDLE_INFERENCE_INSTALL_DIR}/paddle/include/experimental/pten/api/include/) copy(inference_lib_dist SRCS ${PADDLE_SOURCE_DIR}/paddle/pten/api/all.h DSTS ${PADDLE_INFERENCE_INSTALL_DIR}/paddle/include/experimental/pten/api/) copy(inference_lib_dist - SRCS ${PADDLE_SOURCE_DIR}/paddle/pten/common/* + SRCS ${PADDLE_SOURCE_DIR}/paddle/pten/common/*.h ${PADDLE_SOURCE_DIR}/paddle/fluid/platform/bfloat16.h ${PADDLE_SOURCE_DIR}/paddle/fluid/platform/complex.h ${PADDLE_SOURCE_DIR}/paddle/fluid/platform/float16.h diff --git a/cmake/pten.cmake b/cmake/pten.cmake index 77d04a2570cab45cca0fe0ff557b1a5c93d2d541..3de122d1bd97665b067d3eced6cea7a904085f3f 100644 --- a/cmake/pten.cmake +++ b/cmake/pten.cmake @@ -20,8 +20,7 @@ string(FIND ${TARGET_PATH} "experimental" pos) if (pos GREATER 1) file(GLOB HEADERS "${TARGET_PATH}/*" "*.h") foreach(header ${HEADERS}) - string(FIND ${header} ".h" hpos) - if (hpos GREATER 1) + if (${header} MATCHES ".*.h$") file(READ ${header} HEADER_CONTENT) string(REPLACE "paddle/pten/" "paddle/include/experimental/pten/" HEADER_CONTENT "${HEADER_CONTENT}") string(REPLACE "paddle/utils/" "paddle/include/experimental/utils/" HEADER_CONTENT "${HEADER_CONTENT}")