forked from FR-GRE-BDS-HPC-SW-SAGE2-GMA/iocatcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
82 lines (71 loc) · 3.27 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
######################################################
# PROJECT : IO Catcher #
# LICENSE : Apache 2.0 #
# COPYRIGHT: 2020-2022 Bull SAS All rights reserved #
######################################################
######################################################
#Usage of OBJECT keyword in add_library require 2.8.8 (or something like that, need to check)
cmake_minimum_required(VERSION 2.8.8)
# TODO we can remove this when we do not use anymore centos7
if (CMAKE_VERSION VERSION_LESS 3.0)
project(iocatcher CXX C)
else (CMAKE_VERSION VERSION_LESS 3.0)
cmake_policy(SET CMP0048 NEW)
project(iocatcher VERSION 0.0.0 LANGUAGES CXX C)
endif (CMAKE_VERSION VERSION_LESS 3.0)
######################################################
#global setup
set(ENABLE_TESTS ON CACHE BOOL "Enable unit tests requiring build of googletest and googlmock")
if (ENABLE_TESTS)
enable_testing()
endif(ENABLE_TESTS)
######################################################
#Add internal search path for scripts
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/)
######################################################
#Delegate some cmake scripts
include(${CMAKE_SOURCE_DIR}/cmake/macros.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/unittest-macros.cmake)
######################################################
find_package(LibFabric REQUIRED)
find_package(Threads REQUIRED)
find_package(Libevent REQUIRED)
find_package(LibeventPthreads REQUIRED)
find_package(Mero QUIET)
find_package(Motr QUIET)
######################################################
setup_internal_gmock_and_gtest()
enable_cxx_11()
######################################################
# disable one warning on new gcc to avoid somes from 1.7.0 version of google mock.
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wno-deprecated-copy HAS_NO_DEPRECATED_COPY)
if (HAS_NO_DEPRECATED_COPY)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")
endif (HAS_NO_DEPRECATED_COPY)
######################################################
set(ENABLE_COVERAGE OFF CACHE BOOL "Enable coverage profiling.")
if (ENABLE_COVERAGE)
enable_gcc_coverage()
endif (ENABLE_COVERAGE)
######################################################
include_directories(${LIBFABRIC_INCLUDE_DIRS})
if (MOTR_FOUND)
include_directories(${MOTR_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/extern-deps/from-motr-sample-apps/)
add_definitions(-DHAVE_MOTR)
set(MOTR_COMPILE_FLAGS "-D_REENTRANT -D_GNU_SOURCE -DM0_INTERNAL='' -DM0_EXTERN=extern -fno-common -I${MERO_INCLUDE_DIRS}")
set(MOTR_COMPILE_FLAGS "${MOTR_COMPILE_FLAGS} -Wall -Wno-attributes -fno-strict-aliasing -rdynamic")
endif (MOTR_FOUND)
if (MERO_FOUND)
include_directories(${MERO_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/extern-deps/from-clovis-sample-apps/)
add_definitions(-DHAVE_MERO)
set(MERO_COMPILE_FLAGS "-D_REENTRANT -D_GNU_SOURCE -DM0_INTERNAL='' -DM0_EXTERN=extern -fno-common -I${MERO_INCLUDE_DIRS}")
set(MERO_COMPILE_FLAGS "${MERO_COMPILE_FLAGS} -Wall -Wno-attributes -fno-strict-aliasing -rdynamic")
endif(MERO_FOUND)
######################################################
add_definitions(-DENABLE_COLOR)
######################################################
add_subdirectory(extern-deps)
add_subdirectory(src)