@ -220,6 +220,8 @@ add_custom_target(restore-installed-headers)
file ( GLOB_RECURSE _local_hdrs
file ( GLOB_RECURSE _local_hdrs
" $ { P R O J E C T _ S O U R C E _ D I R } / s r c / * . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / s r c / * . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / s r c / * . i n c "
" $ { P R O J E C T _ S O U R C E _ D I R } / s r c / * . i n c "
)
file ( GLOB_RECURSE _local_upb_hdrs
" $ { P R O J E C T _ S O U R C E _ D I R } / u p b / * . h "
" $ { P R O J E C T _ S O U R C E _ D I R } / u p b / * . h "
)
)
@ -235,6 +237,7 @@ list(APPEND _exclude_hdrs ${test_util_hdrs} ${lite_test_util_hdrs} ${common_test
$ { c o m p i l e r _ t e s t _ u t i l s _ h d r s } $ { u p b _ t e s t _ u t i l _ f i l e s } )
$ { c o m p i l e r _ t e s t _ u t i l s _ h d r s } $ { u p b _ t e s t _ u t i l _ f i l e s } )
foreach ( _hdr ${ _exclude_hdrs } )
foreach ( _hdr ${ _exclude_hdrs } )
list ( REMOVE_ITEM _local_hdrs ${ _hdr } )
list ( REMOVE_ITEM _local_hdrs ${ _hdr } )
list ( REMOVE_ITEM _local_upb_hdrs ${ _hdr } )
endforeach ( )
endforeach ( )
foreach ( _hdr ${ _local_hdrs } )
foreach ( _hdr ${ _local_hdrs } )
@ -250,6 +253,19 @@ foreach(_hdr ${_local_hdrs})
c o p y " $ { _ t m p _ f i l e } " " $ { _ h d r } " )
c o p y " $ { _ t m p _ f i l e } " " $ { _ h d r } " )
endforeach ( )
endforeach ( )
foreach ( _hdr ${ _local_upb_hdrs } )
string ( REPLACE "${protobuf_SOURCE_DIR}/upb" "" _file ${ _hdr } )
set ( _tmp_file "${CMAKE_BINARY_DIR}/tmp-install-test/${_file}" )
add_custom_command ( TARGET remove-installed-headers PRE_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e - f " $ { _ h d r } " )
add_custom_command ( TARGET save-installed-headers PRE_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E
c o p y " $ { _ h d r } " " $ { _ t m p _ f i l e } " | | t r u e )
add_custom_command ( TARGET restore-installed-headers PRE_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E
c o p y " $ { _ t m p _ f i l e } " " $ { _ h d r } " )
endforeach ( )
add_dependencies ( remove-installed-headers save-installed-headers )
add_dependencies ( remove-installed-headers save-installed-headers )
if ( protobuf_REMOVE_INSTALLED_HEADERS )
if ( protobuf_REMOVE_INSTALLED_HEADERS )
# M a k e s u r e w e r e m o v e a l l t h e h e a d e r s * b e f o r e * a n y c o d e g e n o c c u r s .
# M a k e s u r e w e r e m o v e a l l t h e h e a d e r s * b e f o r e * a n y c o d e g e n o c c u r s .