@ -270,26 +270,25 @@ if(NOT (WIN32 OR APPLE OR USE_STATIC))
# S o m e s y s t e m s s u p p o r t $ O R I G I N i n R P A T H t o e n a b l e r e l o c a t a b l e
# b i n a r i e s . I n o t h e r c a s e s , o n l y a b s o l u t e p a t h s c a n b e u s e d .
# h t t p s : / / w w w . l e k e n s t e y n . n l / r p a t h . h t m l
#
# A l s o n o t e t h a t s o m e systems ( notably those using GNU libc )
# s i l e n t l y i g n o r e $ O R I G I N i n R P A T H f o r b i n a r i e s t h a t a r e
# s e t u i d r o o t o r u s e p r i v i l e g e d c a p a b i l i t i e s .
#
if ( CMAKE_SYSTEM_NAME MATCHES "^(Linux|SunOS|FreeBSD)$" )
set ( _enable_rpath_origin TRUE )
if ( BUILD_dumpcap AND ENABLE_PCAP )
# d u m p c a p w i l l m o s t l i k e l y b e i n s t a l l e d w i t h
# c a p a b i l i t i e s o r s e t u i d . R e l a t i v e R P A T H s t h a t
# r e s o l v e t o n o n - s t a n d a r d l i b r a r y d i r e c t o r i e s
# a r e i g n o r e d f o r s u c h b i n a r i e s a n d s i n c e w e
# c a n n o t a c h i e v e r e l o c a t a b l e b u i l d s , j u s t
# d i s a b l e i t b y d e f a u l t .
set ( _enable_rpath_origin FALSE )
endif ( )
# P r o v i d e a k n o b t o o p t i o n a l l y f o r c e a b s o l u t e r p a t h s ,
# t o s u p p o r t o l d / b u g g y s y s t e m s a n d a s a u s e r p r e f e r e n c e
# f o r h a r d e n i n g .
set ( ENABLE_RPATH_ORIGIN ${ _enable_rpath_origin } CACHE BOOL
" U s e $ O R I G I N w i t h I N S T A L L _ R P A T H " )
mark_as_advanced ( ENABLE_RPATH_ORIGIN )
else ( )
set ( ENABLE_RPATH_ORIGIN FALSE )
set ( _enable_rpath_origin FALSE )
endif ( )
# P r o v i d e a k n o b t o o p t i o n a l l y f o r c e a b s o l u t e r p a t h s ,
# t o s u p p o r t o l d / b u g g y s y s t e m s a n d a s a u s e r p r e f e r e n c e
# f o r h a r d e n i n g .
# X X X S h o u l d t h i s b e a C M a k e o p t i o n ?
set ( ENABLE_RPATH_ORIGIN ${ _enable_rpath_origin } CACHE BOOL
" U s e $ O R I G I N w i t h I N S T A L L _ R P A T H " )
mark_as_advanced ( ENABLE_RPATH_ORIGIN )
if ( ENABLE_RPATH_ORIGIN )
set ( LIBRARY_INSTALL_RPATH "$ORIGIN" )
set ( EXECUTABLE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}" )
@ -3120,28 +3119,47 @@ endif()
if ( BUILD_dumpcap AND PCAP_FOUND )
set ( dumpcap_LIBS
w r i t e c a p
w s u t i l
c a p u t i l s
i f a c e _ m o n i t o r
w s u t i l _ s t a t i c
p c a p : : p c a p
$ { C A P _ L I B R A R I E S }
$ { Z L I B _ L I B R A R I E S }
$ { N L _ L I B R A R I E S }
$ { A P P L E _ C O R E _ F O U N D A T I O N _ L I B R A R Y }
$ { A P P L E _ S Y S T E M _ C O N F I G U R A T I O N _ L I B R A R Y }
$ { W I N _ W S 2 _ 3 2 _ L I B R A R Y }
)
if ( UNIX )
list ( APPEND CAPUTILS_SRC
c a p t u r e / c a p t u r e - p c a p - u t i l - u n i x . c )
endif ( )
if ( WIN32 )
list ( APPEND CAPUTILS_SRC
c a p t u r e / c a p t u r e _ w i n _ i f n a m e s . c
c a p t u r e / c a p t u r e - w p c a p . c
)
endif ( )
list ( APPEND CAPUTILS_SRC
c a p t u r e / c a p t u r e - p c a p - u t i l . c
)
if ( AIRPCAP_FOUND )
list ( APPEND CAPUTILS_SRC capture/airpcap_loader.c )
endif ( )
set ( dumpcap_FILES
$ < T A R G E T _ O B J E C T S : c a p t u r e _ o p t s >
$ < T A R G E T _ O B J E C T S : c l i _ m a i n >
ca p t u r e _ o p t s .c
cl i _ m a i n .c
d u m p c a p . c
r i n g b u f f e r . c
s y n c _ p i p e _ w r i t e . c
c a p t u r e / i f a c e _ m o n i t o r . c
c a p t u r e / w s 8 0 2 1 1 _ u t i l s . c
$ { C A P U T I L S _ S R C }
)
set_executable_resources ( dumpcap "Dumpcap" UNIQUE_RC )
add_executable ( dumpcap ${ dumpcap_FILES } )
set_extra_executable_properties ( dumpcap "Executables" )
target_link_libraries ( dumpcap ${ dumpcap_LIBS } )
target_include_directories ( dumpcap SYSTEM PRIVATE ${ ZLIB_INCLUDE_DIRS } )
target_include_directories ( dumpcap SYSTEM PRIVATE ${ ZLIB_INCLUDE_DIRS } ${ NL_INCLUDE_DIRS } )
target_compile_definitions ( dumpcap PRIVATE ENABLE_STATIC )
executable_link_mingw_unicode ( dumpcap )
install ( TARGETS dumpcap
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }