Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
fix cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
neverchanje committed Feb 22, 2021
1 parent 15ebd14 commit 097f6b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions bin/thrift_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 097f6b9

Please sign in to comment.