From 99187dda1a4d2c40f0a53b68d4e176cd8b173deb Mon Sep 17 00:00:00 2001 From: Adrian Sevcenco Date: Wed, 30 Oct 2019 22:45:10 +0200 Subject: [PATCH] py : build only libraries --- cmake/XRootDDefaults.cmake | 1 + packaging/wheel/install.sh | 2 +- src/CMakeLists.txt | 8 ++++++++ src/XrdCl/CMakeLists.txt | 22 ++++++++++++++++++---- src/XrdSec.cmake | 11 +++++++++++ src/XrdSecgsi.cmake | 11 +++++++++++ src/api_test/CMakeLists.txt | 4 +++- 7 files changed, 53 insertions(+), 6 deletions(-) diff --git a/cmake/XRootDDefaults.cmake b/cmake/XRootDDefaults.cmake index bb099884a45..72d5e40d7b6 100644 --- a/cmake/XRootDDefaults.cmake +++ b/cmake/XRootDDefaults.cmake @@ -19,4 +19,5 @@ option( ENABLE_TESTS "Enable unit tests." option( ENABLE_HTTP "Enable HTTP component." TRUE ) option( ENABLE_PYTHON "Enable python bindings." TRUE ) option( XRDCL_ONLY "Build only the client and necessary dependencies" FALSE ) +option( XRDCL_LIB_ONLY "Build only the client libraries and necessary dependencies" FALSE ) define_default( XRD_PYTHON_REQ_VERSION 2.4 ) diff --git a/packaging/wheel/install.sh b/packaging/wheel/install.sh index 580c63cdd0a..2b196916dbf 100755 --- a/packaging/wheel/install.sh +++ b/packaging/wheel/install.sh @@ -10,7 +10,7 @@ cd xrootdbuild # set the respective version of python # replace the default BINDIR with a custom one that can be easily removed afterwards # (for the python bindings we don't want to install the binaries) -CMAKE_ARGS="-DXRDCL_ONLY=TRUE -DENABLE_PYTHON=TRUE -DCMAKE_INSTALL_PREFIX=$1 -DXRD_PYTHON_REQ_VERSION=$2 -DCMAKE_INSTALL_BINDIR=$startdir/xrootdbuild/bin" +CMAKE_ARGS="-DXRDCL_LIB_ONLY=TRUE -DENABLE_PYTHON=TRUE -DCMAKE_INSTALL_PREFIX=$1 -DXRD_PYTHON_REQ_VERSION=$2 -DCMAKE_INSTALL_BINDIR=$startdir/xrootdbuild/bin" cmake .. $CMAKE_ARGS diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 47afc331e1b..11572ed8418 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,10 @@ #------------------------------------------------------------------------------- # Include the subcomponents #------------------------------------------------------------------------------- +if( XRDCL_LIB_ONLY ) + set ( XRDCL_ONLY TRUE ) +endif() + include( XrdUtils ) include( XrdApps ) include( XrdCrypto ) @@ -55,6 +59,7 @@ endif() #------------------------------------------------------------------------------- # Install the utility scripts #------------------------------------------------------------------------------- +if( NOT XRDCL_ONLY ) install( FILES ${CMAKE_SOURCE_DIR}/utils/XrdCmsNotify.pm @@ -66,7 +71,9 @@ install( OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ ) +endif() +if( NOT XRDCL_LIB_ONLY ) #------------------------------------------------------------------------------- # Install xrootd-config #------------------------------------------------------------------------------- @@ -100,3 +107,4 @@ install( COMMAND mv -f \${MANPAGE}.new \${MANPAGE} ) ENDFOREACH()" ) +endif() diff --git a/src/XrdCl/CMakeLists.txt b/src/XrdCl/CMakeLists.txt index 45b3f3e9601..0e222e9a4a9 100644 --- a/src/XrdCl/CMakeLists.txt +++ b/src/XrdCl/CMakeLists.txt @@ -113,6 +113,7 @@ set_target_properties( #------------------------------------------------------------------------------- # xrdfs #------------------------------------------------------------------------------- +if( NOT XRDCL_LIB_ONLY ) add_executable( xrdfs XrdClFS.cc @@ -125,10 +126,12 @@ target_link_libraries( XrdUtils ${READLINE_LIBRARY} ${NCURSES_LIBRARY} ) +endif() #------------------------------------------------------------------------------- # xrdcopy #------------------------------------------------------------------------------- +if( NOT XRDCL_LIB_ONLY ) add_executable( xrdcp XrdClCopy.cc ) @@ -137,15 +140,23 @@ target_link_libraries( xrdcp XrdCl XrdAppUtils ) +endif() #------------------------------------------------------------------------------- # Install #------------------------------------------------------------------------------- install( - TARGETS XrdCl xrdfs xrdcp + TARGETS XrdCl RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +if( NOT XRDCL_LIB_ONLY ) +install( + TARGETS xrdfs xrdcp + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +endif() + install( FILES XrdClAnyObject.hh @@ -177,11 +188,12 @@ install( XrdClOperationHandlers.hh XrdClArg.hh XrdClFwd.hh - XrdClParallelOperation.hh - XrdClFileOperations.hh - XrdClFileSystemOperations.hh + XrdClParallelOperation.hh + XrdClFileOperations.hh + XrdClFileSystemOperations.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xrootd/private ) +if( NOT XRDCL_LIB_ONLY ) install( FILES ${PROJECT_SOURCE_DIR}/docs/man/xrdfs.1 @@ -216,3 +228,5 @@ install( WORKING_DIRECTORY \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_MANDIR}/man1 ) ENDFOREACH()" ) + +endif() diff --git a/src/XrdSec.cmake b/src/XrdSec.cmake index cb8134e7a9f..8bc83eaba2c 100644 --- a/src/XrdSec.cmake +++ b/src/XrdSec.cmake @@ -87,6 +87,7 @@ set_target_properties( INTERFACE_LINK_LIBRARIES "" LINK_INTERFACE_LIBRARIES "" ) +if( NOT XRDCL_LIB_ONLY ) #------------------------------------------------------------------------------- # xrdpwdadmin #------------------------------------------------------------------------------- @@ -98,6 +99,7 @@ target_link_libraries( xrdpwdadmin XrdCrypto XrdUtils ) +endif() #------------------------------------------------------------------------------- # The XrdSecsss module @@ -119,6 +121,7 @@ set_target_properties( INTERFACE_LINK_LIBRARIES "" LINK_INTERFACE_LIBRARIES "" ) +if( NOT XRDCL_LIB_ONLY ) #------------------------------------------------------------------------------- # xrdsssadmin #------------------------------------------------------------------------------- @@ -129,6 +132,7 @@ add_executable( target_link_libraries( xrdsssadmin XrdUtils ) +endif() #------------------------------------------------------------------------------- # The XrdSecunix module @@ -154,6 +158,12 @@ set_target_properties( install( TARGETS ${LIB_XRD_SEC} ${LIB_XRD_SEC_PWD} ${LIB_XRD_SEC_SSS} ${LIB_XRD_SEC_UNIX} ${LIB_XRD_SEC_PROT} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) + +if( NOT XRDCL_LIB_ONLY ) +install( + TARGETS xrdsssadmin xrdpwdadmin RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) @@ -163,3 +173,4 @@ install( ${PROJECT_SOURCE_DIR}/docs/man/xrdsssadmin.8 ${PROJECT_SOURCE_DIR}/docs/man/xrdpwdadmin.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8 ) +endif() diff --git a/src/XrdSecgsi.cmake b/src/XrdSecgsi.cmake index 1d5890513e1..3c7ce427f60 100644 --- a/src/XrdSecgsi.cmake +++ b/src/XrdSecgsi.cmake @@ -65,6 +65,7 @@ set_target_properties( INTERFACE_LINK_LIBRARIES "" LINK_INTERFACE_LIBRARIES "" ) +if( NOT XRDCL_LIB_ONLY ) #------------------------------------------------------------------------------- # xrdgsiproxy #------------------------------------------------------------------------------- @@ -90,6 +91,7 @@ target_link_libraries( XrdCrypto XrdUtils ${OPENSSL_CRYPTO_LIBRARY} ) +endif() #------------------------------------------------------------------------------- # Install @@ -99,6 +101,12 @@ install( ${LIB_XRD_SEC_GSI} ${LIB_XRD_SEC_GSI_AUTHZVO} ${LIB_XRD_SEC_GSI_GMAPDN} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) + +if( NOT XRDCL_LIB_ONLY ) +install( + TARGETS xrdgsiproxy xrdgsitest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -109,3 +117,6 @@ install( ${PROJECT_SOURCE_DIR}/docs/man/xrdgsiproxy.1 ${PROJECT_SOURCE_DIR}/docs/man/xrdgsitest.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 ) + +endif() + diff --git a/src/api_test/CMakeLists.txt b/src/api_test/CMakeLists.txt index 076a739ca36..8b37c431c4d 100644 --- a/src/api_test/CMakeLists.txt +++ b/src/api_test/CMakeLists.txt @@ -6,6 +6,8 @@ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x" ) #------------------------------------------------------------------------------- # xrdcopy #------------------------------------------------------------------------------- +if( NOT XRDCL_ONLY ) + add_executable( xrd_api_test xrd_api_test.cc ) @@ -31,4 +33,4 @@ target_link_libraries( crypto pthread ) - +endif()