Commit 5a2d26ab authored by Matthieu Dorier's avatar Matthieu Dorier

Initial commit

parents
#
# general cmake flags:
# -DCMAKE_INSTALL_PREFIX=/usr/local -- the prefix for installing
# -DCMAKE_BUILD_TYPE=type -- type can be Debug, Release, ...
# -DCMAKE_PREFIX_PATH=/dir -- external packages
#
# note that CMAKE_PREFIX_PATH can be a list of directories:
# -DCMAKE_PREFIX_PATH='/dir1;/dir2;/dir3'
#
cmake_minimum_required (VERSION 3.0)
project (remi C CXX)
enable_testing ()
# add our cmake module directory to the path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# link shared lib with full rpath
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# setup cache variables for ccmake
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release
CACHE STRING "Choose the type of build." FORCE)
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "RelWithDebInfo" "MinSizeRel")
endif ()
set (CMAKE_PREFIX_PATH "" CACHE STRING "External dependencies path")
set (BUILD_SHARED_LIBS "OFF" CACHE BOOL "Build a shared library")
# packages we depend on
include (xpkg-import)
find_package (thallium REQUIRED)
xpkg_import_module (margo REQUIRED margo)
add_subdirectory (src)
add_subdirectory (test)
#
# Find the CppUnit includes and library
#
# This module defines
# CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc.
# CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
# CPPUNIT_FOUND, If false, do not try to use CppUnit.
# also defined, but not for general use are
# CPPUNIT_LIBRARY, where to find the CppUnit library.
# CPPUNIT_DEBUG_LIBRARY, where to find the CppUnit library in debug mode.
FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/TestCase.h HINTS
/usr/local/include
/usr/include
ENV CppUnit_ROOT
)
# With Win32, important to have both
IF(WIN32)
FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
${CPPUNIT_INCLUDE_DIR}/../lib
/usr/local/lib
/usr/lib)
FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunitd
${CPPUNIT_INCLUDE_DIR}/../lib
/usr/local/lib
/usr/lib)
ELSE(WIN32)
# On unix system, debug and release have the same name
FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
${CPPUNIT_INCLUDE_DIR}/../lib
/usr/local/lib
/usr/lib)
FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunit
${CPPUNIT_INCLUDE_DIR}/../lib
/usr/local/lib
/usr/lib)
ENDIF(WIN32)
IF(CPPUNIT_INCLUDE_DIR)
IF(CPPUNIT_LIBRARY)
SET(CPPUNIT_FOUND "YES")
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
SET(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY}
${CMAKE_DL_LIBS})
ENDIF(CPPUNIT_LIBRARY)
ENDIF(CPPUNIT_INCLUDE_DIR)
This diff is collapsed.
#ifndef __REMI_CLIENT_H
#define __REMI_CLIENT_H
#include <remi/remi-common.h>
#include <margo.h>
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(__cplusplus)
}
#endif
#endif
#ifndef __REMI_COMMON_H
#define __REMI_COMMON_H
#if defined(__cplusplus)
extern "C" {
#endif
#define REMI_KEEP_SOURCE 0
#define REMI_REMOBE_SOURCE 1
#define REMI_SUCCESS 0 /* Success */
#define REMI_ERR_ALLOCATION -1 /* Error allocating something */
#define REMI_ERR_INVALID_ARG -2 /* An argument is invalid */
#define REMI_ERR_MERCURY -3 /* An error happened calling a Mercury function */
#define REMI_ERR_UNKNOWN_CLASS -4 /* Database refered to by id is not known to provider */
#define REMI_ERR_UNKNOWN_PR -5 /* Mplex id could not be matched with a provider */
#define REMI_ERR_SIZE -6 /* Client did not allocate enough for the requested data */
#define REMI_ERR_MIGRATION -7 /* Error during data migration */
typedef struct remi_fileset* remi_fileset_t;
#define REMI_FILESET_NULL ((remi_fileset_t)0)
#if defined(__cplusplus)
}
#endif
#endif
#ifndef __REMI_SERVER_H
#define __REMI_SERVER_H
#include <remi/remi-common.h>
#include <margo.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct remi_provider* remi_provider_t;
#define REMI_PROVIDER_NULL ((remi_provider_t)0)
typedef void (*remi_migration_callback_t)(remi_provider_t, remi_fileset_t, void*);
#define REMI_MIGRATION_CALLBACK_NULL ((remi_migration_callback_t)0)
#if defined(__cplusplus)
}
#endif
#endif
# list of source files
set(remi-src remi-server.cpp remi-client.cpp)
# load package helper for generating cmake CONFIG packages
include (CMakePackageConfigHelpers)
# where to install files for "find_package"
set (remi-pkg "share/cmake/remi")
#
# library version set here (e.g. for shared libs).
#
set (REMI_VERSION_MAJOR 1)
set (REMI_VERSION_MINOR 0)
set (REMI_VERSION_PATCH 0)
set (remi-vers "${REMI_VERSION_MAJOR}.${REMI_VERSION_MINOR}")
set (REMI_VERSION "${remi-vers}.${REMI_VERSION_PATCH}")
add_library(remi ${remi-src})
target_link_libraries (remi thallium margo)
target_include_directories (remi PUBLIC $<INSTALL_INTERFACE:include>)
# local include's BEFORE, in case old incompatable .h files in prefix/include
target_include_directories (remi BEFORE PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>)
# for shared libs, establish the lib version
set_target_properties (remi
PROPERTIES VERSION ${REMI_VERSION}
SOVERSION ${REMI_VERSION_MAJOR})
#
# installation stuff (packaging and install commands)
#
write_basic_package_version_file(
"remi-config-version.cmake"
VERSION ${REMI_VERSION}
COMPATIBILITY AnyNewerVersion)
# generate our config file for find_package()
configure_file (remi-config.cmake.in remi-config.cmake @ONLY)
#
# "make install" rules
#
install (TARGETS remi EXPORT remi-targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install (EXPORT remi-targets
DESTINATION ${remi-pkg}
FILE "remi-targets.cmake")
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/remi-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/remi-config-version.cmake"
"../cmake/xpkg-import.cmake"
DESTINATION ${remi-pkg} )
install (DIRECTORY ../include/remi
DESTINATION include
FILES_MATCHING PATTERN "*.h")
#
# remi-config.cmake.in
#
# adjust module path to make it easy to pick up files from the config directory
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}")
include (CMakeFindDependencyMacro)
include (xpkg-import)
find_dependency (thallium)
xpkg_import_module (margo REQUIRED margo)
include ("${CMAKE_CURRENT_LIST_DIR}/remi-targets.cmake")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment