Verified Commit 0e69177b authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

CMake: Refactor targets

This commit enforces replaces the use of absolute paths for several
targets in favor of using target_sources(), which allows specifying
source files for the same target in CMakeLists.txt files.
parent c650d75c
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@
# SPDX-License-Identifier: GPL-3.0-or-later                                    #
################################################################################

cmake_minimum_required(VERSION 3.6)
# 3.13+ so that we have a sensible handling of relative paths
cmake_minimum_required(VERSION 3.13)

project(
    GekkoFS
@@ -306,12 +307,8 @@ include_directories(
    ${CMAKE_BINARY_DIR}/include
)

# Common components
add_subdirectory(src/common)
# Daemon
add_subdirectory(src/daemon)
# Client library
add_subdirectory(src/client)
add_subdirectory(src)
add_subdirectory(include)

### Mark any CMake variables imported from {fmt} and spdlog as advanced, so
### that they don't appear in cmake-gui or ccmake. Similarly for FETCHCONTENT
@@ -361,3 +358,7 @@ else()
    unset(GKFS_TESTS_INTERFACE CACHE)
endif()

################################################################################
## Print GekkoFS configuration summary
################################################################################
gkfs_feature_summary(DESCRIPTION "${PROJECT_NAME} configuration summary:")

include/CMakeLists.txt

0 → 100644
+40 −0
Original line number Diff line number Diff line
################################################################################
# Copyright 2018-2023, Barcelona Supercomputing Center (BSC), Spain            #
# Copyright 2015-2023, Johannes Gutenberg Universitaet Mainz, Germany          #
#                                                                              #
# This software was partially supported by the                                 #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).    #
#                                                                              #
# This software was partially supported by the                                 #
# ADA-FS project under the SPPEXA project funded by the DFG.                   #
#                                                                              #
# This file is part of GekkoFS.                                                #
#                                                                              #
# GekkoFS is free software: you can redistribute it and/or modify              #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation, either version 3 of the License, or            #
# (at your option) any later version.                                          #
#                                                                              #
# GekkoFS is distributed in the hope that it will be useful,                   #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with GekkoFS.  If not, see <https://www.gnu.org/licenses/>.            #
#                                                                              #
# SPDX-License-Identifier: GPL-3.0-or-later                                    #
################################################################################

# Common components
add_subdirectory(common)
# Daemon
add_subdirectory(daemon)
# Client library
add_subdirectory(client)

target_sources(gkfs_daemon PUBLIC config.hpp version.hpp.in)

if(GKFS_ENABLE_FORWARDING)
  target_sources(gkfwd_daemon PUBLIC config.hpp version.hpp.in)
endif()
+83 −0
Original line number Diff line number Diff line
################################################################################
# Copyright 2018-2023, Barcelona Supercomputing Center (BSC), Spain            #
# Copyright 2015-2023, Johannes Gutenberg Universitaet Mainz, Germany          #
#                                                                              #
# This software was partially supported by the                                 #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).    #
#                                                                              #
# This software was partially supported by the                                 #
# ADA-FS project under the SPPEXA project funded by the DFG.                   #
#                                                                              #
# This file is part of GekkoFS.                                                #
#                                                                              #
# GekkoFS is free software: you can redistribute it and/or modify              #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation, either version 3 of the License, or            #
# (at your option) any later version.                                          #
#                                                                              #
# GekkoFS is distributed in the hope that it will be useful,                   #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with GekkoFS.  If not, see <https://www.gnu.org/licenses/>.            #
#                                                                              #
# SPDX-License-Identifier: GPL-3.0-or-later                                    #
################################################################################

# common sources to both gkfs_intercept and gkfwd_intercept

target_sources(
  gkfs_intercept
  PUBLIC gkfs_functions.hpp
         env.hpp
         hooks.hpp
         intercept.hpp
         logging.hpp
         make_array.hpp
         open_file_map.hpp
         open_dir.hpp
         path.hpp
         preload.hpp
         preload_context.hpp
         preload_util.hpp
         rpc/rpc_types.hpp
         rpc/forward_management.hpp
         rpc/forward_metadata.hpp
         rpc/forward_data.hpp
         syscalls/args.hpp
         syscalls/decoder.hpp
         syscalls/errno.hpp
         syscalls/rets.hpp
         syscalls/syscall.hpp
         syscalls/detail/syscall_info.h
)

if(GKFS_ENABLE_FORWARDING)
  target_sources(
    gkfwd_intercept
    PUBLIC gkfs_functions.hpp
           env.hpp
           hooks.hpp
           intercept.hpp
           logging.hpp
           make_array.hpp
           open_file_map.hpp
           open_dir.hpp
           path.hpp
           preload.hpp
           preload_context.hpp
           preload_util.hpp
           rpc/rpc_types.hpp
           rpc/forward_management.hpp
           rpc/forward_metadata.hpp
           rpc/forward_data.hpp
           syscalls/args.hpp
           syscalls/decoder.hpp
           syscalls/errno.hpp
           syscalls/rets.hpp
           syscalls/syscall.hpp
           syscalls/detail/syscall_info.h
  )
endif()
+39 −0
Original line number Diff line number Diff line
################################################################################
# Copyright 2018-2023, Barcelona Supercomputing Center (BSC), Spain            #
# Copyright 2015-2023, Johannes Gutenberg Universitaet Mainz, Germany          #
#                                                                              #
# This software was partially supported by the                                 #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).    #
#                                                                              #
# This software was partially supported by the                                 #
# ADA-FS project under the SPPEXA project funded by the DFG.                   #
#                                                                              #
# This file is part of GekkoFS.                                                #
#                                                                              #
# GekkoFS is free software: you can redistribute it and/or modify              #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation, either version 3 of the License, or            #
# (at your option) any later version.                                          #
#                                                                              #
# GekkoFS is distributed in the hope that it will be useful,                   #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with GekkoFS.  If not, see <https://www.gnu.org/licenses/>.            #
#                                                                              #
# SPDX-License-Identifier: GPL-3.0-or-later                                    #
################################################################################

target_sources(
  gkfs_daemon PUBLIC cmake_configure.hpp.in common_defs.hpp rpc/rpc_types.hpp
                     rpc/rpc_util.hpp
)

if(GKFS_ENABLE_FORWARDING)
  target_sources(
    gkfwd_daemon PUBLIC cmake_configure.hpp.in common_defs.hpp
                        rpc/rpc_types.hpp rpc/rpc_util.hpp
  )
endif()
+58 −0
Original line number Diff line number Diff line
################################################################################
# Copyright 2018-2023, Barcelona Supercomputing Center (BSC), Spain            #
# Copyright 2015-2023, Johannes Gutenberg Universitaet Mainz, Germany          #
#                                                                              #
# This software was partially supported by the                                 #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).    #
#                                                                              #
# This software was partially supported by the                                 #
# ADA-FS project under the SPPEXA project funded by the DFG.                   #
#                                                                              #
# This file is part of GekkoFS.                                                #
#                                                                              #
# GekkoFS is free software: you can redistribute it and/or modify              #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation, either version 3 of the License, or            #
# (at your option) any later version.                                          #
#                                                                              #
# GekkoFS is distributed in the hope that it will be useful,                   #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with GekkoFS.  If not, see <https://www.gnu.org/licenses/>.            #
#                                                                              #
# SPDX-License-Identifier: GPL-3.0-or-later                                    #
################################################################################

target_sources(
  gkfs_daemon
  PUBLIC daemon.hpp
         util.hpp
         ops/data.hpp
         ops/metadentry.hpp
         classes/fs_data.hpp
         classes/rpc_data.hpp
         handler/rpc_defs.hpp
         handler/rpc_util.hpp
)

if(GKFS_ENABLE_FORWARDING)
  target_sources(
    gkfwd_daemon
    PUBLIC daemon.hpp
           util.hpp
           ops/data.hpp
           ops/metadentry.hpp
           classes/fs_data.hpp
           classes/rpc_data.hpp
           handler/rpc_defs.hpp
           handler/rpc_util.hpp
  )

  if(GKFS_ENABLE_AGIOS)
    target_sources(gkfwd_daemon PUBLIC scheduler/agios.hpp)
  endif()

endif()
Loading