Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
98 lines (76 sloc) 2.54 KB
PROJECT(MFU)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
IF(POLICY CMP0042)
CMAKE_POLICY(SET CMP0042 NEW)
ENDIF(POLICY CMP0042)
SET(CMAKE_MACOSX_RPATH ON)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Configuration Options
OPTION(ENABLE_XATTRS "Enable code for extended attributes" ON)
IF(ENABLE_XATTRS)
ADD_DEFINITIONS(-DDCOPY_USE_XATTRS)
ENDIF(ENABLE_XATTRS)
OPTION(ENABLE_LUSTRE "Enable optimization and features for Lustre" OFF)
IF(ENABLE_LUSTRE)
ADD_DEFINITIONS(-DLUSTRE_SUPPORT)
# todo investigate usage of other lustre #defs
# - LUSTRE_STAT
# - HAVE_LUSTRE_LUSTREAPI_H
# - HAVE_LUSTRE_LUSTRE_USER_H
ENDIF(ENABLE_LUSTRE)
OPTION(ENABLE_GPFS "Enable GFPS/Spectrum Scale support")
IF(ENABLE_GPFS)
FIND_PACKAGE(GPFS REQUIRED)
INCLUDE_DIRECTORIES(${GPFS_INCLUDE_DIRS})
LIST(APPEND MFU_EXTERNAL_LIBS ${GPFS_LIBRARIES})
ADD_DEFINITIONS(-DGPFS_SUPPORT)
ENDIF(ENABLE_GPFS)
OPTION(ENABLE_EXPERIMENTAL "Build experimental tools" OFF)
## HEADERS
INCLUDE(CheckIncludeFile)
CHECK_INCLUDE_FILE(byteswap.h HAVE_BYTESWAP_H)
if(HAVE_BYTESWAP_H)
ADD_DEFINITIONS(-DHAVE_BYTESWAP_H)
ELSE(HAVE_BYTESWAP_H)
MESSAGE(SEND_ERROR "byteswap.h is required")
ENDIF(HAVE_BYTESWAP_H)
# Dependencies
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
## MPI
INCLUDE(SetupMPI)
INCLUDE_DIRECTORIES(${MPI_C_INCLUDE_PATH})
LIST(APPEND MFU_EXTERNAL_LIBS ${MPI_C_LIBRARIES})
## DTCMP
FIND_PACKAGE(DTCMP REQUIRED)
INCLUDE_DIRECTORIES(${DTCMP_INCLUDE_DIRS})
LIST(APPEND MFU_EXTERNAL_LIBS ${DTCMP_LIBRARIES})
## LIBARCHIVE
# TODO how would we pass a version from spack?
FIND_PACKAGE(LibArchive REQUIRED)
INCLUDE_DIRECTORIES(${LibArchive_INCLUDE_DIRS})
LIST(APPEND MFU_EXTERNAL_LIBS ${LibArchive_LIBRARIES})
## LIBCIRCLE
FIND_PACKAGE(LibCircle REQUIRED)
INCLUDE_DIRECTORIES(${LibCircle_INCLUDE_DIRS})
LIST(APPEND MFU_EXTERNAL_LIBS ${LibCircle_LIBRARIES})
## BZip2
FIND_PACKAGE(BZip2 REQUIRED)
LIST(APPEND MFU_EXTERNAL_LIBS ${BZIP2_LIBRARIES})
## OPENSSL for ddup
FIND_PACKAGE(OpenSSL)
# Setup Installation
INCLUDE(GNUInstallDirs)
SET(X_BINDIR ${CMAKE_INSTALL_FULL_BINDIR} CACHE INTERNAL "bin")
SET(X_DATADIR ${CMAKE_INSTALL_FULL_DATADIR} CACHE INTERNAL "share")
SET(X_INCLUDEDIR ${CMAKE_INSTALL_FULL_INCLUDEDIR} CACHE INTERNAL "include")
SET(X_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR} CACHE INTERNAL "lib")
# Subdirectories
INCLUDE(MFU_ADD_TOOL)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src/common)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(test)
ADD_SUBDIRECTORY(man)
IF(ENABLE_EXPERIMENTAL)
ADD_SUBDIRECTORY(experimental)
ENDIF(ENABLE_EXPERIMENTAL)