build: move higher level CMake directives to top of file

This commit is contained in:
Danny Robson 2020-12-06 06:59:56 +10:00
parent 6766c75243
commit c1f19faba4
2 changed files with 26 additions and 15 deletions

View File

@ -7,13 +7,24 @@ set(CMAKE_CXX_STANDARD 20)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include (nc)
include_directories(.)
find_package(PkgConfig REQUIRED)
###############################################################################
add_library(libemory
acl.cpp
acl.hpp
option (TESTS "enable unit testing" ON)
if (TESTS)
enable_testing ()
endif ()
###############################################################################
include_directories(.)
add_subdirectory(cruft/util)
add_subdirectory(cruft/crypto)
###############################################################################
list(APPEND libemory_sources
emory/chunk/fwd.cpp
emory/chunk/fwd.hpp
emory/chunk/map.cpp
@ -38,20 +49,20 @@ add_library(libemory
emory/store/repo.hpp
)
target_link_libraries(libemory cruft acl)
set_target_properties(libemory PROPERTIES OUTPUT_NAME emory)
###############################################################################
option (TESTS "enable unit testing" ON)
if (TESTS)
enable_testing ()
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)
endif ()
add_library(libemory ${libemory_sources})
###############################################################################
add_subdirectory(cruft/util)
add_subdirectory(cruft/crypto)
target_link_libraries(libemory cruft ${libemory_libs})
set_target_properties(libemory PROPERTIES OUTPUT_NAME emory)
###############################################################################

2
cmake

@ -1 +1 @@
Subproject commit bf694b3085fa97c2f7f94473b652f84f28048d52
Subproject commit 60a1dc65ef41e1d18e283dba48c993aeee629c00