diff --git a/cmake/XRootDDefaults.cmake b/cmake/XRootDDefaults.cmake index b2d9d951838..bbee8a275b5 100644 --- a/cmake/XRootDDefaults.cmake +++ b/cmake/XRootDDefaults.cmake @@ -28,5 +28,7 @@ option( ENABLE_XRDEC "Enable erasure coding component." option( ENABLE_ASAN "Enable adress sanitizer." FALSE ) option( ENABLE_TSAN "Enable thread sanitizer." FALSE ) option( ENABLE_XRDCLHTTP "Enable xrdcl-http plugin." TRUE ) +option( ENABLE_SCITOKENS "Enable SciTokens plugin." TRUE ) +option( ENABLE_MACAROONS "Enable Macaroons plugin." TRUE ) option( FORCE_ENABLED "Fail build if enabled components cannot be built." FALSE ) define_default( XRD_PYTHON_REQ_VERSION 3 ) diff --git a/cmake/XRootDFindLibs.cmake b/cmake/XRootDFindLibs.cmake index 8a06ef7919e..333a5d06865 100644 --- a/cmake/XRootDFindLibs.cmake +++ b/cmake/XRootDFindLibs.cmake @@ -119,25 +119,41 @@ check_function_exists( curl_multi_wait HAVE_CURL_MULTI_WAIT ) compiler_define_if_found( HAVE_CURL_MULTI_WAIT HAVE_CURL_MULTI_WAIT ) endif() -find_package( Macaroons ) - -if( NOT MacOSX ) - include(FindPkgConfig REQUIRED) - pkg_check_modules(JSON json-c) - pkg_check_modules(UUID REQUIRED uuid) +if( ENABLE_MACAROONS ) + if( FORCE_ENABLED ) + find_package( Macaroons REQUIRED ) + else() + find_package( Macaroons ) + endif() + if( NOT MacOSX ) + include(FindPkgConfig REQUIRED) + if( FORCE_ENABLED ) + pkg_check_modules(JSON REQUIRED json-c) + pkg_check_modules(UUID REQUIRED uuid) + else() + pkg_check_modules(JSON json-c) + pkg_check_modules(UUID uuid) + endif() + endif() + if( MACAROONS_FOUND AND JSON_FOUND AND UUID_FOUND ) + set( BUILD_MACAROONS TRUE ) + else() + set( BUILD_MACAROONS FALSE ) + endif() endif() -if( MACAROONS_FOUND AND JSON_FOUND AND UUID_FOUND ) - set( BUILD_MACAROONS TRUE ) -else() - set( BUILD_MACAROONS FALSE ) -endif() -find_package( SciTokensCpp ) -if( SCITOKENSCPP_FOUND ) - set( BUILD_SCITOKENS TRUE ) -else() - set( BUILD_SCITOKENS FALSE ) +if( ENABLE_SCITOKENS ) + if( FORCE_ENABLED ) + find_package( SciTokensCpp REQUIRED ) + else() + find_package( SciTokensCpp ) + endif() + if( SCITOKENSCPP_FOUND ) + set( BUILD_SCITOKENS TRUE ) + else() + set( BUILD_SCITOKENS FALSE ) + endif() endif() if( ENABLE_XRDEC )