-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
65 lines (51 loc) · 2.19 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
cmake_minimum_required(VERSION 3.18)
project(alock LANGUAGES CXX VERSION 0.0.0)
# Options
option(DOCS "Set to build documentation" OFF)
# Flags
set(CXX_STANDARD 20 CACHE STRING "Uses C++20 or 23")
set(LOG_LEVEL CACHE STRING "Log level options include TRACE, DEBUG, INFO, WARN, ERROR, CRITICAL, and OFF")
set(LOCK "RdmaSpinLock") #default
#######################################################################################################################
# Setup
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message(STATUS "Using standard ${CXX_STANDARD}")
# Ensure the LOG_LEVEL is correct
set(LOG_LEVELS "TRACE;DEBUG;INFO;WARN;ERROR;CRITICAL;OFF")
foreach(L ${LOG_LEVELS})
if("${LOG_LEVEL}" STREQUAL "${L}")
set(CORRECT_LOG_LEVEL TRUE)
endif()
endforeach()
if(NOT DEFINED CORRECT_LOG_LEVEL)
message(FATAL_ERROR "LOG_LEVEL must be one of ${LOG_LEVELS}")
endif()
message(STATUS "Using LOG_LEVEL=${LOG_LEVEL}")
set(CMAKE_CXX_STANDARD ${CXX_STANDARD})
enable_testing()
#######################################################################################################################
## Libraries
find_package(remus REQUIRED)
#######################################################################################################################
## Install
# Include directories for your current project
add_executable(main main.cc)
target_include_directories(main PRIVATE include)
target_link_libraries(main PUBLIC remus::rdma remus::workload remus::util)
# Set up the logging level
target_compile_definitions(main PUBLIC REMUS_LOG_LEVEL=${LOG_LEVEL})
target_compile_definitions(main PUBLIC LOCK_TYPE=${LOCK} LOCK_HANDLE=${LOCK}Handle)
#######################################################################################################################
## DEB Package
set(CPACK_PACKAGE_VENDOR "Scalable Systems and Software Lab")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Scalable Systems and Software Lab")
set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set(CPACK_SOURCE_IGNORE_FILES
/.git
/dist
/.*build.*
/\\\\.DS_Store
)
include(CPack)
#######################################################################################################################