Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 20 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#
#
# CMake options
#
#

# CMake version
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
Expand Down Expand Up @@ -29,9 +29,9 @@ set_policy(CMP0042 NEW) # ENABLE CMP0042: MACOSX_RPATH is enabled by default.
set_policy(CMP0063 NEW) # ENABLE CMP0063: Honor visibility properties for all target types.


#
#
# Project description and (meta) information
#
#

# Get git revision
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
Expand All @@ -42,7 +42,7 @@ endif()

# Meta information about the project
set(META_PROJECT_NAME "cppfs")
set(META_PROJECT_DESCRIPTION "Cross-platform C++ file system library supporting multiple backends (Local-FS, SSH)")
set(META_PROJECT_DESCRIPTION "Cross-platform C++ file system library")
set(META_AUTHOR_ORGANIZATION "CG Internals GmbH")
set(META_AUTHOR_DOMAIN "https://github.com/cginternals/cppfs/")
set(META_AUTHOR_MAINTAINER "opensource@cginternals.com")
Expand All @@ -58,9 +58,9 @@ string(MAKE_C_IDENTIFIER ${META_PROJECT_NAME} META_PROJECT_ID)
string(TOUPPER ${META_PROJECT_ID} META_PROJECT_ID)


#
#
# Project configuration options
#
#

# Project options
option(BUILD_SHARED_LIBS "Build shared instead of static libraries." ON)
Expand All @@ -71,9 +71,9 @@ option(OPTION_BUILD_EXAMPLES "Build examples."
option(OPTION_FORCE_SYSTEM_DIR_INSTALL "Force system dir install" OFF)


#
#
# Declare project
#
#

# Generate folders for IDE targets (e.g., VisualStudio solutions)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand All @@ -82,33 +82,28 @@ set(IDE_FOLDER "")
# Declare project
project(${META_PROJECT_NAME} C CXX)

# Set output directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

# Create version file
file(WRITE "${PROJECT_BINARY_DIR}/VERSION" "${META_NAME_VERSION}")


#
#
# Compiler settings and options
#
#

include(cmake/CompileOptions.cmake)


#
#
# Project Health Check Setup
#
#

enable_cppcheck(On)
enable_clang_tidy(On)


#
#
# Deployment/installation setup
#
#

# Get project name
set(project ${META_PROJECT_NAME})
Expand Down Expand Up @@ -160,23 +155,23 @@ if(NOT SYSTEM_DIR_INSTALL)
if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../../../${INSTALL_LIB}")
else()
set(CMAKE_INSTALL_RPATH "$ORIGIN/${INSTALL_LIB}")
set(CMAKE_INSTALL_RPATH "$ORIGIN/${INSTALL_LIB}")
endif()
endif()


#
#
# Project modules
#
#

add_subdirectory(source)
add_subdirectory(docs)
add_subdirectory(deploy)


#
#
# Deployment (global project files)
#
#

# Install version file
install(FILES "${PROJECT_BINARY_DIR}/VERSION" DESTINATION ${INSTALL_ROOT} COMPONENT runtime)
Expand Down
28 changes: 0 additions & 28 deletions source/cppfs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
# External dependencies
#

find_package(LibSSH2 REQUIRED)
find_package(LibCrypto)
find_package(ZLIB)
find_package(OpenSSL)


#
Expand Down Expand Up @@ -62,12 +59,6 @@ set(headers
${include_path}/${localfs}/LocalFileSystem.h
${include_path}/${localfs}/LocalFileHandle.h
${include_path}/${localfs}/LocalFileIterator.h

${include_path}/ssh/SshFileSystem.h
${include_path}/ssh/SshFileHandle.h
${include_path}/ssh/SshFileIterator.h
${include_path}/ssh/SshInputStreamBuffer.h
${include_path}/ssh/SshOutputStreamBuffer.h
)

set(sources
Expand All @@ -92,12 +83,6 @@ set(sources
${source_path}/${localfs}/LocalFileSystem.cpp
${source_path}/${localfs}/LocalFileHandle.cpp
${source_path}/${localfs}/LocalFileIterator.cpp

${source_path}/ssh/SshFileSystem.cpp
${source_path}/ssh/SshFileHandle.cpp
${source_path}/ssh/SshFileIterator.cpp
${source_path}/ssh/SshInputStreamBuffer.cpp
${source_path}/ssh/SshOutputStreamBuffer.cpp
)

# Group source files
Expand Down Expand Up @@ -155,8 +140,6 @@ target_include_directories(${target}
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
${OPENSSL_INCLUDE_DIR}
${LIBSSH2_INCLUDE_DIR}

PUBLIC
${DEFAULT_INCLUDE_DIRECTORIES}
Expand All @@ -173,10 +156,6 @@ target_include_directories(${target}
#

target_link_libraries(${target}
PRIVATE
${OPENSSL_LIBRARIES}
${LIBSSH2_LIBRARY}

PUBLIC
${DEFAULT_LIBRARIES}

Expand All @@ -191,13 +170,6 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
)
endif()

if(LibCrypto_FOUND)
target_link_libraries(${target}
PRIVATE
${LIBCRYPTO_LIBRARY}
)
endif()

if(ZLIB_FOUND)
target_link_libraries(${target}
PRIVATE
Expand Down
Loading