diff --git a/CMakeLists.txt b/CMakeLists.txt index cfe9b17039..14c8ac04ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,12 @@ message (STATUS "dsn Installation directory: CMAKE_INSTALL_PREFIX = " ${CMAKE_IN # install rdsn/include to ${CMAKE_INCLUDE_PREFIX}/include install(DIRECTORY include/ DESTINATION include) +# NOTE: dsn_types.h is not actually a thrift-generated file. As pegasus may reference it, +# we should copy also this file to the path the same as other thrift-generated files. +install(FILES include/dsn/cpp/serialization_helper/dsn_types.h DESTINATION include) +# TODO(wutao1): remove this line after dsn.layer2_types.h is removed from repo. +install(FILES include/dsn/cpp/serialization_helper/dsn.layer2_types.h DESTINATION include) + include_directories(${DSN_PROJECT_DIR}/include) include_directories(${DSN_PROJECT_DIR}/include/dsn/cpp/serialization_helper) include_directories(${DSN_PROJECT_DIR}/src) diff --git a/bin/thrift_utils.cmake b/bin/thrift_utils.cmake index 4d3735e1ce..058108f5c0 100644 --- a/bin/thrift_utils.cmake +++ b/bin/thrift_utils.cmake @@ -66,11 +66,14 @@ function(THRIFT_GENERATE_CPP SRCS HDRS thrift_file) set(${SRCS}) set(${HDRS}) - file(GLOB_RECURSE __result_src "${THRIFT_GENERATED_FILE_PATH}/${__thrift_name}*.cpp") - file(GLOB_RECURSE __result_hdr "${THRIFT_GENERATED_FILE_PATH}/${__thrift_name}*.h") + file(GLOB __result_src "${THRIFT_GENERATED_FILE_PATH}/${__thrift_name}_types.cpp") + file(GLOB __result_hdr "${THRIFT_GENERATED_FILE_PATH}/${__thrift_name}_types.h") list(APPEND ${SRCS} ${__result_src}) list(APPEND ${HDRS} ${__result_hdr}) # Sets the variables in global scope. set(${SRCS} ${${SRCS}} PARENT_SCOPE) set(${HDRS} ${${HDRS}} PARENT_SCOPE) + + # install the thrift generated headers to include/ + install(FILES ${__result_hdr} DESTINATION include) endfunction()