-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
69 lines (56 loc) · 1.87 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
66
67
68
IF(BGPM)
INCLUDE_DIRECTORIES(${BGPM_LIB})
ENDIF(BGPM)
## ROSS
INCLUDE_DIRECTORIES(${ROSS_SOURCE_DIR} ${ROSS_BINARY_DIR})
## RIO
INCLUDE_DIRECTORIES(${RIO_SOURCE_DIR} ${RIO_BINARY_DIR})
## Print PHOLD-IO Hash
LIST(APPEND CMAKE_MODULE_PATH "${ROSS_SOURCE_DIR}/cmake/")
INCLUDE(GetGitRevisionDescription)
GET_GIT_HEAD_REVISION(GIT_RESPEC_PH GIT_SHA1_PH)
## Build Configuration File
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/pholdio-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/pholdio-config.h @ONLY)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/pholdio-config.h.in PROPERTIES GENERATED FALSE)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/pholdio-config.h PROPERTIES GENERATED TRUE)
## PHOLD-IO Model
## this model *requires* RIO to build
SET(pholdio_srcs
pholdio.c
pholdio.h
pholdio-config.h)
ADD_EXECUTABLE(pholdio ${pholdio_srcs})
IF(BGPM)
TARGET_LINK_LIBRARIES(pholdio ROSS RIO imp_bgpm m)
ELSE(NOT(BGPM))
TARGET_LINK_LIBRARIES(pholdio ROSS RIO m)
ENDIF(BGPM)
## Testing
MACRO(DO_TEST test_name)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/tests/${test_name}.sh ${CMAKE_CURRENT_BINARY_DIR}/${test_name}.sh COPYONLY)
ADD_TEST(RIO_${test_name} ./${test_name}.sh)
ENDMACRO(DO_TEST)
DO_TEST("NetEventTest")
DO_TEST("ParallelismTest")
DO_TEST("OptimisticTest")
## Delta-PHOLD-IO Model
## this model can be built with or without RIO
SET(dpholdio_srcs
dpholdio.c
dpholdio.h
pholdio-config.h)
ADD_EXECUTABLE(dpholdio ${dpholdio_srcs})
IF(BGPM)
IF(USE_RIO)
TARGET_LINK_LIBRARIES(dpholdio ROSS RIO imp_bgpm m)
ELSE(NOT(USE_RIO))
TARGET_LINK_LIBRARIES(dpholdio ROSS imp_bgpm m)
ENDIF(USE_RIO)
ELSE(NOT(BGPM))
IF(USE_RIO)
TARGET_LINK_LIBRARIES(dpholdio ROSS RIO m)
ELSE(NOT(USE_RIO))
TARGET_LINK_LIBRARIES(dpholdio ROSS m)
ENDIF(USE_RIO)
ENDIF(BGPM)