Permalink
Browse files

build: fix rpcgen problem on FreeBSD

rpcgen on FreeBSD and on Linux store the generated files in different
directories, either where the source file is stored or into the current
directory.

We now check both options to copy the generated files when being built
outside of the source tree.
  • Loading branch information...
pstorz committed Jul 6, 2018
1 parent 0b11093 commit 9e51eac4ca211be61ebf7c45def70854675dfd1d
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/src/ndmp/CMakeLists.txt
@@ -93,7 +93,8 @@ foreach(NDMP_VERSION 0 1 2 3 4 9)
PRE_BUILD
OUTPUT ndmp${NDMP_VERSION}.h ndmp${NDMP_VERSION}_xdr.c
COMMAND ${RPCGEN} ${RPCGEN_PARAMS} ${CMAKE_CURRENT_SOURCE_DIR}/ndmp${NDMP_VERSION}.x
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/ndmp${NDMP_VERSION}.h ${CMAKE_CURRENT_SOURCE_DIR}/ndmp${NDMP_VERSION}_xdr.c ${CMAKE_CURRENT_BINARY_DIR}
COMMAND cp ndmp${NDMP_VERSION}.h ndmp${NDMP_VERSION}_xdr.c ${CMAKE_CURRENT_SOURCE_DIR}
|| cp ${CMAKE_CURRENT_SOURCE_DIR}/ndmp${NDMP_VERSION}.h ${CMAKE_CURRENT_SOURCE_DIR}/ndmp${NDMP_VERSION}_xdr.c ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${RPCGEN} ${CMAKE_CURRENT_SOURCE_DIR}/ndmp${NDMP_VERSION}.x
)
ENDIF()

0 comments on commit 9e51eac

Please sign in to comment.