2019-04-23 08:17:34 +10:00
|
|
|
###############################################################################
|
|
|
|
cmake_minimum_required(VERSION 3.8.0)
|
|
|
|
project(emory CXX)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
|
|
|
|
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|
|
|
include (nc)
|
|
|
|
|
2020-12-06 07:59:56 +11:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
option (TESTS "enable unit testing" ON)
|
|
|
|
if (TESTS)
|
|
|
|
enable_testing ()
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
2019-04-23 08:17:34 +10:00
|
|
|
include_directories(.)
|
|
|
|
|
2020-12-06 07:59:56 +11:00
|
|
|
add_subdirectory(cruft/util)
|
|
|
|
add_subdirectory(cruft/crypto)
|
2019-04-23 08:17:34 +10:00
|
|
|
|
2019-04-25 14:19:55 +10:00
|
|
|
###############################################################################
|
2020-12-06 07:59:56 +11:00
|
|
|
list(APPEND libemory_sources
|
2019-04-26 11:10:07 +10:00
|
|
|
emory/chunk/fwd.cpp
|
|
|
|
emory/chunk/fwd.hpp
|
|
|
|
emory/chunk/map.cpp
|
|
|
|
emory/chunk/map.hpp
|
|
|
|
emory/chunk/match.cpp
|
|
|
|
emory/chunk/match.hpp
|
|
|
|
emory/chunk/ostream.cpp
|
|
|
|
emory/chunk/ostream.hpp
|
|
|
|
emory/chunk/params.cpp
|
|
|
|
emory/chunk/params.hpp
|
|
|
|
emory/chunk/region.cpp
|
|
|
|
emory/chunk/region.hpp
|
2019-04-26 12:47:04 +10:00
|
|
|
emory/fs/acl.cpp
|
|
|
|
emory/fs/acl.hpp
|
|
|
|
emory/fs/ostream.cpp
|
|
|
|
emory/fs/ostream.hpp
|
|
|
|
emory/fs/xattr.cpp
|
|
|
|
emory/fs/xattr.hpp
|
2020-10-04 10:54:18 +11:00
|
|
|
emory/store/bits.cpp
|
|
|
|
emory/store/bits.hpp
|
|
|
|
emory/store/repo.cpp
|
|
|
|
emory/store/repo.hpp
|
2019-04-25 14:19:55 +10:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-12-06 07:59:56 +11:00
|
|
|
if (NOT WIN32)
|
|
|
|
pkg_check_modules(ACL REQUIRED IMPORTED_TARGET libacl)
|
|
|
|
list (APPEND libemory_sources
|
|
|
|
acl.cpp
|
|
|
|
acl.hpp
|
|
|
|
)
|
|
|
|
list (APPEND libemory_libs PkgConfig::ACL)
|
2019-04-23 08:17:34 +10:00
|
|
|
endif ()
|
|
|
|
|
2020-12-06 07:59:56 +11:00
|
|
|
add_library(libemory ${libemory_sources})
|
2019-04-23 08:17:34 +10:00
|
|
|
|
2020-12-06 07:59:56 +11:00
|
|
|
target_link_libraries(libemory cruft ${libemory_libs})
|
|
|
|
set_target_properties(libemory PROPERTIES OUTPUT_NAME emory)
|
2019-04-23 08:17:34 +10:00
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
2019-04-24 13:26:21 +10:00
|
|
|
foreach (t analyse compare stat)
|
2019-04-24 07:46:42 +10:00
|
|
|
add_executable ("${t}" "tools/${t}.cpp")
|
2019-04-27 10:44:33 +10:00
|
|
|
target_link_libraries ("${t}" libemory cruft-crypto cruft)
|
|
|
|
set_target_properties ("${t}" PROPERTIES
|
|
|
|
OUTPUT_NAME "emory-${t}"
|
|
|
|
)
|
2019-04-27 10:44:50 +10:00
|
|
|
install (TARGETS "${t}")
|
2019-04-23 21:34:01 +10:00
|
|
|
endforeach()
|
2019-04-27 10:44:33 +10:00
|
|
|
|
|
|
|
add_executable (emory tools/emory.cpp)
|
|
|
|
target_link_libraries (emory libemory)
|
2019-04-27 10:44:50 +10:00
|
|
|
install (TARGETS emory)
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
set (CPACK_GENERATOR "TXZ")
|
|
|
|
set (CPACK_STRIP_FILES TRUE)
|
|
|
|
include (CPack)
|