forked from xrootd/xrootd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XrdCeph] Update CMake build system to be like other plugins
- Loading branch information
Showing
67 changed files
with
69 additions
and
4,407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,52 @@ | ||
#------------------------------------------------------------------------------- | ||
# Project description | ||
#------------------------------------------------------------------------------- | ||
cmake_minimum_required(VERSION 3.16...3.25) | ||
|
||
project( xrootd-ceph ) | ||
|
||
set( CMAKE_MODULE_PATH | ||
${PROJECT_SOURCE_DIR}/src | ||
${PROJECT_SOURCE_DIR}/cmake ) | ||
if(NOT ENABLE_CEPH) | ||
unset(BUILD_CEPH CACHE) | ||
return() | ||
endif() | ||
|
||
if( NOT XRDCEPH_SUBMODULE ) | ||
if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) | ||
cmake_policy(SET CMP0054 OLD) | ||
if(FORCE_ENABLED) | ||
find_package(ceph REQUIRED) | ||
else() | ||
find_package(ceph) | ||
if(NOT CEPH_FOUND) | ||
unset(BUILD_CEPH CACHE) | ||
return() | ||
endif() | ||
endif() | ||
|
||
include( XRootDUtils ) | ||
CheckBuildDirectory() | ||
|
||
include( XRootDOSDefs ) | ||
include( XRootDDefaults ) | ||
include( XRootDFindLibs ) | ||
|
||
add_definitions( -DXRDPLUGIN_SOVERSION="${PLUGIN_VERSION}" ) | ||
|
||
#------------------------------------------------------------------------------- | ||
# Generate the version header | ||
#------------------------------------------------------------------------------- | ||
if( NOT XRDCEPH_SUBMODULE ) | ||
execute_process( | ||
COMMAND ${CMAKE_SOURCE_DIR}/genversion.sh --print-only ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE XROOTD_VERSION | ||
OUTPUT_STRIP_TRAILING_WHITESPACE ) | ||
|
||
add_custom_target( | ||
XrdVersion.hh | ||
${CMAKE_SOURCE_DIR}/genversion.sh ${CMAKE_SOURCE_DIR} ) | ||
|
||
# sigh, yet another ugly hack :( | ||
macro( add_library _target ) | ||
_add_library( ${_target} ${ARGN} ) | ||
add_dependencies( ${_target} XrdVersion.hh ) | ||
endmacro() | ||
|
||
macro( add_executable _target ) | ||
_add_executable( ${_target} ${ARGN} ) | ||
add_dependencies( ${_target} XrdVersion.hh ) | ||
endmacro() | ||
endif() | ||
set(BUILD_CEPH TRUE CACHE BOOL INTERNAL FORCE) | ||
|
||
#------------------------------------------------------------------------------- | ||
# Build in subdirectories | ||
#------------------------------------------------------------------------------- | ||
add_subdirectory( src ) | ||
add_library(XrdCephPosix SHARED | ||
XrdCephPosix.cc XrdCephPosix.hh) | ||
|
||
if( BUILD_TESTS ) | ||
ENABLE_TESTING() | ||
add_subdirectory( tests ) | ||
endif() | ||
target_compile_options(XrdCephPosix | ||
PRIVATE -Wno-deprecated-declarations) | ||
|
||
target_link_libraries(XrdCephPosix | ||
PRIVATE XrdUtils ${RADOS_LIBS}) | ||
|
||
target_include_directories(XrdCephPosix | ||
PUBLIC ${RADOS_INCLUDE_DIR} $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>) | ||
|
||
set_target_properties(XrdCephPosix | ||
PROPERTIES VERSION 0.0.1 SOVERSION 0) | ||
|
||
set(LIB_XRD_CEPH XrdCeph-${PLUGIN_VERSION}) | ||
|
||
add_library(${LIB_XRD_CEPH} MODULE | ||
XrdCephOss.cc XrdCephOss.hh | ||
XrdCephOssFile.cc XrdCephOssFile.hh | ||
XrdCephOssDir.cc XrdCephOssDir.hh) | ||
|
||
target_link_libraries(${LIB_XRD_CEPH} | ||
PRIVATE ${XROOTD_LIBRARIES} XrdCephPosix) | ||
|
||
set(LIB_XRD_CEPH_XATTR XrdCephXattr-${PLUGIN_VERSION}) | ||
|
||
add_library(${LIB_XRD_CEPH_XATTR} MODULE | ||
XrdCephXAttr.cc XrdCephXAttr.hh) | ||
|
||
target_link_libraries(${LIB_XRD_CEPH_XATTR} | ||
PRIVATE ${XROOTD_LIBRARIES} XrdCephPosix) | ||
|
||
include( XRootDSummary ) | ||
install(TARGETS XrdCephPosix ${LIB_XRD_CEPH} ${LIB_XRD_CEPH_XATTR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
Oops, something went wrong.